[Bf-blender-cvs] [38321fa] master: cleanup: use spaces for alignment

Mike Erwin noreply at git.blender.org
Mon Mar 23 20:40:58 CET 2015


Commit: 38321faa8d111ec51ebdeb7f2e939062d5e080a1
Author: Mike Erwin
Date:   Mon Mar 23 15:29:42 2015 -0400
Branches: master
https://developer.blender.org/rB38321faa8d111ec51ebdeb7f2e939062d5e080a1

cleanup: use spaces for alignment

while studying GPU lib

===================================================================

M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/GPU_compositing.h
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/GPU_extensions.h
M	source/blender/gpu/GPU_material.h
M	source/blender/gpu/GPU_simple_shader.h
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_codegen.c
M	source/blender/gpu/intern/gpu_codegen.h
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/gpu/intern/gpu_debug.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/gpu/intern/gpu_material.c

===================================================================

diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index e9b600a..54153cf 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -51,10 +51,10 @@ struct GPUVertPointLink;
 struct PBVH;
 
 typedef struct GPUBuffer {
-	int size;	/* in bytes */
-	void *pointer;	/* used with vertex arrays */
-	unsigned int id;	/* used with vertex buffer objects */
-	bool use_vbo;	/* true for VBOs, false for vertex arrays */
+	int size;        /* in bytes */
+	void *pointer;   /* used with vertex arrays */
+	unsigned int id; /* used with vertex buffer objects */
+	bool use_vbo;    /* true for VBOs, false for vertex arrays */
 } GPUBuffer;
 
 typedef struct GPUBufferMaterial {
diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h
index 5589084..57d8c06 100644
--- a/source/blender/gpu/GPU_compositing.h
+++ b/source/blender/gpu/GPU_compositing.h
@@ -52,7 +52,7 @@ enum eGPUFXFlags;
 
 typedef enum GPUFXShaderEffect {
 	/* Screen space ambient occlusion shader */
-	GPU_SHADER_FX_SSAO           = 1,
+	GPU_SHADER_FX_SSAO = 1,
 
 	/* depth of field passes. Yep, quite a complex effect */
 	GPU_SHADER_FX_DEPTH_OF_FIELD_PASS_ONE = 2,
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 57aa7f2..0c0ab10 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -84,6 +84,7 @@ int GPU_get_material_alpha_blend(void);
 
 int GPU_set_tpage(struct MTFace *tface, int mipmap, int transp);
 void GPU_clear_tpage(bool force);
+
 /* Lights
  * - returns how many lights were enabled
  * - this affects fixed functions materials and texface, not glsl */
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 401711e..c006540 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -72,26 +72,26 @@ void GPU_code_generate_glsl_lib(void);
 /* GPU Types */
 
 typedef enum GPUDeviceType {
-	GPU_DEVICE_NVIDIA =		(1<<0),
-	GPU_DEVICE_ATI =		(1<<1),
-	GPU_DEVICE_INTEL =		(1<<2),
-	GPU_DEVICE_SOFTWARE =	(1<<3),
-	GPU_DEVICE_UNKNOWN = 	(1<<4),
-	GPU_DEVICE_ANY = 		(0xff)
+	GPU_DEVICE_NVIDIA =     (1<<0),
+	GPU_DEVICE_ATI =        (1<<1),
+	GPU_DEVICE_INTEL =      (1<<2),
+	GPU_DEVICE_SOFTWARE =   (1<<3),
+	GPU_DEVICE_UNKNOWN =    (1<<4),
+	GPU_DEVICE_ANY =        (0xff)
 } GPUDeviceType;
 
 typedef enum GPUOSType {
-	GPU_OS_WIN = 			(1<<8),
-	GPU_OS_MAC = 			(1<<9),
-	GPU_OS_UNIX =			(1<<10),
-	GPU_OS_ANY =			(0xff00)
+	GPU_OS_WIN =            (1<<8),
+	GPU_OS_MAC =            (1<<9),
+	GPU_OS_UNIX =           (1<<10),
+	GPU_OS_ANY =            (0xff00)
 } GPUOSType;
 
 typedef enum GPUDriverType {
-	GPU_DRIVER_OFFICIAL =	(1<<16),
+	GPU_DRIVER_OFFICIAL =   (1<<16),
 	GPU_DRIVER_OPENSOURCE = (1<<17),
-	GPU_DRIVER_SOFTWARE =	(1<<18),
-	GPU_DRIVER_ANY =		(0xff0000)
+	GPU_DRIVER_SOFTWARE =   (1<<18),
+	GPU_DRIVER_ANY =        (0xff0000)
 } GPUDriverType;
 
 bool GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
@@ -204,8 +204,8 @@ int GPU_shader_get_attribute(GPUShader *shader, const char *name);
 
 /* Builtin/Non-generated shaders */
 typedef enum GPUBuiltinShader {
-	GPU_SHADER_VSM_STORE =			(1<<0),
-	GPU_SHADER_SEP_GAUSSIAN_BLUR =	(1<<1),
+	GPU_SHADER_VSM_STORE =         (1<<0),
+	GPU_SHADER_SEP_GAUSSIAN_BLUR = (1<<1),
 } GPUBuiltinShader;
 
 GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader);
@@ -215,7 +215,7 @@ void GPU_shader_free_builtin_shaders(void);
 
 /* Vertex attributes for shaders */
 
-#define GPU_MAX_ATTRIB		32
+#define GPU_MAX_ATTRIB 32
 
 typedef struct GPUVertexAttribs {
 	struct {
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 64ce936..2d21b1a 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -92,7 +92,7 @@ typedef enum GPUBuiltin {
 	GPU_VIEW_NORMAL =           (1 << 5),
 	GPU_OBCOLOR =               (1 << 6),
 	GPU_AUTO_BUMPSCALE =        (1 << 7),
-	GPU_CAMERA_TEXCO_FACTORS =       (1 << 8),
+	GPU_CAMERA_TEXCO_FACTORS =  (1 << 8),
 } GPUBuiltin;
 
 typedef enum GPUOpenGLBuiltin {
@@ -213,7 +213,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr);
 
 typedef enum GPUDataType {
 	GPU_DATA_NONE = 0,
-	GPU_DATA_1I = 1,	// 1 integer
+	GPU_DATA_1I = 1,   /* 1 integer */
 	GPU_DATA_1F = 2,
 	GPU_DATA_2F = 3,
 	GPU_DATA_3F = 4,
@@ -226,23 +226,23 @@ typedef enum GPUDataType {
 /* this structure gives information of each uniform found in the shader */
 typedef struct GPUInputUniform {
 	struct GPUInputUniform *next, *prev;
-	char varname[32];		/* name of uniform in shader */
-	GPUDynamicType type;	/* type of uniform, data format and calculation derive from it */
-	GPUDataType datatype;	/* type of uniform data */
-	struct Object *lamp;	/* when type=GPU_DYNAMIC_LAMP_... or GPU_DYNAMIC_SAMPLER_2DSHADOW */
-	struct Image *image;	/* when type=GPU_DYNAMIC_SAMPLER_2DIMAGE */
-	int texnumber;			/* when type=GPU_DYNAMIC_SAMPLER, texture number: 0.. */
-	unsigned char *texpixels;	/* for internally generated texture, pixel data in RGBA format */
-	int texsize;			/* size in pixel of the texture in texpixels buffer: for 2D textures, this is S and T size (square texture) */
+	char varname[32];         /* name of uniform in shader */
+	GPUDynamicType type;      /* type of uniform, data format and calculation derive from it */
+	GPUDataType datatype;     /* type of uniform data */
+	struct Object *lamp;      /* when type=GPU_DYNAMIC_LAMP_... or GPU_DYNAMIC_SAMPLER_2DSHADOW */
+	struct Image *image;      /* when type=GPU_DYNAMIC_SAMPLER_2DIMAGE */
+	int texnumber;            /* when type=GPU_DYNAMIC_SAMPLER, texture number: 0.. */
+	unsigned char *texpixels; /* for internally generated texture, pixel data in RGBA format */
+	int texsize;              /* size in pixel of the texture in texpixels buffer: for 2D textures, this is S and T size (square texture) */
 } GPUInputUniform;
 
 typedef struct GPUInputAttribute {
 	struct GPUInputAttribute *next, *prev;
-	char varname[32];	/* name of attribute in shader */
-	int type;			/* from CustomData.type, data type derives from it */
-	GPUDataType datatype;	/* type of attribute data */
-	const char *name;	/* layer name */
-	int number;			/* generic attribute number */
+	char varname[32];     /* name of attribute in shader */
+	int type;             /* from CustomData.type, data type derives from it */
+	GPUDataType datatype; /* type of attribute data */
+	const char *name;     /* layer name */
+	int number;           /* generic attribute number */
 } GPUInputAttribute;
 
 typedef struct GPUShaderExport {
diff --git a/source/blender/gpu/GPU_simple_shader.h b/source/blender/gpu/GPU_simple_shader.h
index c8fb1f0..2392962 100644
--- a/source/blender/gpu/GPU_simple_shader.h
+++ b/source/blender/gpu/GPU_simple_shader.h
@@ -42,11 +42,11 @@ extern "C" {
 
 typedef enum GPUSimpleShaderOption {
 	GPU_SHADER_OVERRIDE_DIFFUSE = (1<<0),   /* replace diffuse with glcolor */
-	GPU_SHADER_LIGHTING = (1<<1),           /* use lighting */
-	GPU_SHADER_TWO_SIDED = (1<<2),          /* flip normals towards viewer */
-	GPU_SHADER_TEXTURE_2D = (1<<3),         /* use 2D texture to replace diffuse color */
+	GPU_SHADER_LIGHTING =         (1<<1),   /* use lighting */
+	GPU_SHADER_TWO_SIDED =        (1<<2),   /* flip normals towards viewer */
+	GPU_SHADER_TEXTURE_2D =       (1<<3),   /* use 2D texture to replace diffuse color */
 
-	GPU_SHADER_SOLID_LIGHTING = (1<<4),     /* use faster lighting (set automatically) */
+	GPU_SHADER_SOLID_LIGHTING =   (1<<4),   /* use faster lighting (set automatically) */
 	GPU_SHADER_OPTIONS_NUM = 5,
 	GPU_SHADER_OPTION_COMBINATIONS = (1<<GPU_SHADER_OPTIONS_NUM)
 } GPUSimpleShaderOption;
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index e622943..4b7dc7f 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -383,8 +383,9 @@ void GPU_buffer_free(GPUBuffer *buffer)
 	BLI_mutex_unlock(&buffer_mutex);
 }
 
-/* currently unused */
-// #define USE_GPU_POINT_LINK
+#if 0 /* currently unused */
+#  define USE_GPU_POINT_LINK
+#endif
 
 typedef struct GPUVertPointLink {
 #ifdef USE_GPU_POINT_LINK
@@ -452,7 +453,7 @@ static void gpu_drawobject_init_vert_points(GPUDrawObject *gdo, MFace *f, int to
 	int i, *mat_orig_to_new;
 
 	mat_orig_to_new = MEM_callocN(sizeof(*mat_orig_to_new) * totmat,
-	                                             "GPUDrawObject.mat_orig_to_new");
+	                              "GPUDrawObject.mat_orig_to_new");
 	/* allocate the array and space for links */
 	gdo->vert_points = MEM_mallocN(sizeof(GPUVertPointLink) * gdo->totvert,
 	                               "GPUDrawObject.vert_points");
@@ -1007,7 +1008,7 @@ const GPUBufferTypeSettings gpu_buffer_type_settings[] = {
 	{GPU_buffer_copy_normal, GL_ARRAY_BUFFER_ARB, 3},
 	{GPU_buffer_copy_mcol, GL_ARRAY_BUFFER_ARB, 3},
 	{GPU_buffer_copy_uv, GL_ARRAY_BUFFER_ARB, 2},
-    {GPU_buffer_copy_uv_texpaint, GL_ARRAY_BUFFER_ARB, 4},
+	{GPU_buffer_copy_uv_texpaint, GL_ARRAY_BUFFER_ARB, 4},
 	{GPU_buffer_copy_edge, GL_ELEMENT_ARRAY_BUFFER_ARB, 2},
 	{GPU_buffer_copy_uvedge, GL_ELEMENT_ARRAY_BUFFER_ARB, 4}
 };
@@ -1498,6 +1499,7 @@ struct GPU_PBVH_Buffers {
 	bool use_matcaps;
 	float diffuse_color[4];
 };
+
 typedef enum {
 	VBO_ENABLED,
 	VBO_DISABLED
@@ -1577,8 +1579,8 @@ static void gpu_color_from_mask_quad_set(const CCGKey *key,
 }
 
 void GPU_update_mesh_pbvh_buffers(GPU_PBVH_Buffers *buffers, MVert *mvert,
-                             int *vert_indices, int totvert, const float *vmask,
-                             int (*face_vert_indices)[4], bool show_diffuse_color)
+                                  int *vert_indices, int totvert, const float *vmask,
+                                  int (*face_vert_indices)[4], bool show_diffuse_color)
 {
 	VertexBufferFormat *vert_data;
 	int i, j, k;
@@ -1715,9 +1717,9 @@ void GPU_update_mesh_pbvh_buffers(GPU_PBVH_Buffers *buffers, MVert *mvert,
 }
 
 GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(int (*face_vert_indices)[4],
-                                    MFace *mface, MVert *mvert,
-                

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list