[Bf-blender-cvs] [6654e109df9] master: Cleanup: strip trailing space in GPU module

Campbell Barton noreply at git.blender.org
Mon Jun 4 09:10:18 CEST 2018


Commit: 6654e109df952be3a3128fae2508a02c196ae593
Author: Campbell Barton
Date:   Mon Jun 4 09:09:12 2018 +0200
Branches: master
https://developer.blender.org/rB6654e109df952be3a3128fae2508a02c196ae593

Cleanup: strip trailing space in GPU module

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

M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/GPU_texture.h
M	source/blender/gpu/intern/gpu_basic_shader.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_codegen.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_framebuffer.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/gpu/intern/gpu_select_pick.c
M	source/blender/gpu/intern/gpu_select_sample_query.c
M	source/blender/gpu/intern/gpu_shader.c
M	source/blender/gpu/intern/gpu_texture.c
M	source/blender/gpu/shaders/gpu_shader_basic_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_material.glsl
M	source/blender/gpu/shaders/gpu_shader_vertex.glsl

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

diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index 6ffaa29ead6..8fd34348f03 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -108,17 +108,17 @@ typedef struct GPUDrawObject {
 	struct GPUVertPointLink *vert_points_mem;
 	int vert_points_usage;
 #endif
-	
+
 	int colType;
 
 	GPUBufferMaterial *materials;
 	int totmaterial;
-	
+
 	unsigned int tot_triangle_point;
 	unsigned int tot_loose_point;
 	/* different than total loops since ngons get tesselated still */
 	unsigned int tot_loop_verts;
-	
+
 	/* caches of the original DerivedMesh values */
 	unsigned int totvert;
 	unsigned int totedge;
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 90b65af87c8..245a10a38c2 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -66,7 +66,7 @@ void GPU_state_init(void);
  *   GPU_object_material_bind returns 0 if drawing should be skipped
  * - after drawing, the material must be disabled again */
 
-void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, 
+void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d,
                                 struct Scene *scene, struct Object *ob, bool glsl, bool *do_alpha_after);
 void GPU_end_object_materials(void);
 bool GPU_object_materials_check(void);
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 756fe79151b..1ae3d73991e 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -39,7 +39,7 @@ extern "C" {
 struct Image;
 struct ImageUser;
 struct PreviewImage;
-	
+
 struct GPUFrameBuffer;
 typedef struct GPUTexture GPUTexture;
 
diff --git a/source/blender/gpu/intern/gpu_basic_shader.c b/source/blender/gpu/intern/gpu_basic_shader.c
index 8505bd847a0..5d23de78451 100644
--- a/source/blender/gpu/intern/gpu_basic_shader.c
+++ b/source/blender/gpu/intern/gpu_basic_shader.c
@@ -295,7 +295,7 @@ void GPU_basic_shaders_init(void)
 void GPU_basic_shaders_exit(void)
 {
 	int i;
-	
+
 	for (i = 0; i < GPU_SHADER_OPTION_COMBINATIONS; i++)
 		if (GPU_MATERIAL_STATE.cached_shaders[i])
 			GPU_shader_free(GPU_MATERIAL_STATE.cached_shaders[i]);
@@ -336,7 +336,7 @@ static int detect_options()
 	glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &two_sided);
 	if (two_sided == GL_TRUE)
 		options |= GPU_SHADER_TWO_SIDED;
-	
+
 	return options;
 }
 #endif
@@ -389,7 +389,7 @@ static GPUShader *gpu_basic_shader(int options)
 			geom_glsl,
 			NULL,
 			defines, 0, 0, 0);
-		
+
 		if (shader) {
 			/* set texture map to first texture unit */
 			if (options & (GPU_SHADER_TEXTURE_2D | GPU_SHADER_TEXTURE_RECT)) {
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 38e847da967..a35f678f8dc 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -222,7 +222,7 @@ static void gpu_buffer_pool_free(GPUBufferPool *pool)
 {
 	if (!pool)
 		return;
-	
+
 	while (pool->totbuf)
 		gpu_buffer_pool_delete_last(pool);
 
@@ -236,7 +236,7 @@ static void gpu_buffer_pool_free_unused(GPUBufferPool *pool)
 		return;
 
 	BLI_mutex_lock(&buffer_mutex);
-	
+
 	while (pool->totbuf)
 		gpu_buffer_pool_delete_last(pool);
 
@@ -294,7 +294,7 @@ static GPUBuffer *gpu_buffer_alloc_intern(size_t size)
 	 * twice as big */
 	for (i = 0; i < pool->totbuf; i++) {
 		bufsize = pool->buffers[i]->size;
-		
+
 		/* check for an exact size match */
 		if (bufsize == size) {
 			bestfit = i;
@@ -621,7 +621,7 @@ void GPU_vertex_setup(DerivedMesh *dm)
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glBindBuffer(GL_ARRAY_BUFFER, dm->drawObject->points->id);
 	glVertexPointer(3, GL_FLOAT, 0, 0);
-	
+
 	GLStates |= GPU_BUFFER_VERTEX_STATE;
 }
 
@@ -716,7 +716,7 @@ void GPU_edge_setup(DerivedMesh *dm)
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glBindBuffer(GL_ARRAY_BUFFER, dm->drawObject->points->id);
 	glVertexPointer(3, GL_FLOAT, 0, 0);
-	
+
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, dm->drawObject->edges->id);
 
 	GLStates |= (GPU_BUFFER_VERTEX_STATE | GPU_BUFFER_ELEMENT_STATE);
@@ -730,7 +730,7 @@ void GPU_uvedge_setup(DerivedMesh *dm)
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glBindBuffer(GL_ARRAY_BUFFER, dm->drawObject->uvedges->id);
 	glVertexPointer(2, GL_FLOAT, 0, 0);
-	
+
 	GLStates |= GPU_BUFFER_VERTEX_STATE;
 }
 
@@ -792,7 +792,7 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
 		elementsize = element_size;
 
 	glBindBuffer(GL_ARRAY_BUFFER, buffer->id);
-	
+
 	for (i = 0; i < numdata; i++) {
 		glEnableVertexAttribArray(data[i].index);
 		int info = 0;
@@ -804,13 +804,13 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
 		glVertexAttribPointer(data[i].index, data[i].size, data[i].type,
 		                         GL_TRUE, elementsize, BUFFER_OFFSET(offset));
 		offset += data[i].size * gpu_typesize(data[i].type);
-		
+
 		attribData[i].index = data[i].index;
 		attribData[i].size = data[i].size;
 		attribData[i].type = data[i].type;
 	}
-	
-	attribData[numdata].index = -1;	
+
+	attribData[numdata].index = -1;
 }
 
 void GPU_interleaved_attrib_unbind(void)
@@ -952,7 +952,7 @@ typedef struct {
 	 * boundary; drastically increases viewport performance on my
 	 * drivers (Gallium/Radeon) --nicholasbishop */
 	char pad[2];
-	
+
 	unsigned char color[3];
 } VertexBufferFormat;
 
@@ -1283,7 +1283,7 @@ void GPU_pbvh_grid_buffers_update(
 				for (y = 0; y < key->grid_size; y++) {
 					for (x = 0; x < key->grid_size; x++) {
 						CCGElem *elem = CCG_grid_elem(key, grid, x, y);
-						
+
 						copy_v3_v3(vd->co, CCG_elem_co(key, elem));
 						if (buffers->smooth) {
 							normal_float_to_short_v3(vd->no, CCG_elem_no(key, elem));
@@ -1301,7 +1301,7 @@ void GPU_pbvh_grid_buffers_update(
 						vd++;
 					}
 				}
-				
+
 				if (!buffers->smooth) {
 					/* for flat shading, recalc normals and set the last vertex of
 					 * each triangle in the index buffer to have the flat normal as
@@ -1739,7 +1739,7 @@ void GPU_pbvh_bmesh_buffers_update(
 						fmask += BM_ELEM_CD_GET_FLOAT(v[i], cd_vert_mask_offset);
 					}
 					fmask /= 3.0f;
-					
+
 					for (i = 0; i < 3; i++) {
 						gpu_bmesh_vert_to_buffer_copy(v[i], vert_data,
 						                              &v_index, f->no, &fmask,
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index b5512aa108d..a9cef0b5ad3 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -109,7 +109,7 @@ static int gpu_str_prefix(const char *str, const char *prefix)
 		str++;
 		prefix++;
 	}
-	
+
 	return (*prefix == '\0');
 }
 
@@ -221,7 +221,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
 	GPUFunction *function;
 	char *name, *prototypes;
 	int a;
-	
+
 	/* automatically generate function prototypes to add to the top of the
 	 * generated code, to avoid have to add the actual code & recompile all */
 	ghi = BLI_ghashIterator_new(hash);
@@ -610,7 +610,7 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
 
 	for (node = nodes->first; node; node = node->next) {
 		BLI_dynstr_appendf(ds, "\t%s(", node->name);
-		
+
 		for (input = node->inputs.first; input; input = input->next) {
 			if (input->source == GPU_SOURCE_TEX) {
 				BLI_dynstr_appendf(ds, "samp%d", input->texid);
@@ -740,7 +740,7 @@ static char *code_generate_vertex(ListBase *nodes, const GPUMatType type)
 	GPUInput *input;
 	char *code;
 	char *vertcode = NULL;
-	
+
 	for (node = nodes->first; node; node = node->next) {
 		for (input = node->inputs.first; input; input = input->next) {
 			if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
@@ -781,7 +781,7 @@ static char *code_generate_vertex(ListBase *nodes, const GPUMatType type)
 	}
 
 	BLI_dynstr_append(ds, vertcode);
-	
+
 	for (node = nodes->first; node; node = node->next)
 		for (input = node->inputs.first; input; input = input->next)
 			if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
@@ -1084,7 +1084,7 @@ void GPU_pass_unbind(GPUPass *pass)
 		if (input->ima || input->prv)
 			input->tex = NULL;
 	}
-	
+
 	GPU_shader_unbind();
 }
 
@@ -1105,7 +1105,7 @@ static void gpu_node_link_free(GPUNodeLink *link)
 
 	if (link->users < 0)
 		fprintf(stderr, "GPU_node_link_free: negative refcount\n");
-	
+
 	if (link->users == 0) {
 		if (link->output)
 			link->output->link = NULL;
@@ -1146,7 +1146,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, const GPUType
 			return;
 		}
 	}
-	
+
 	input = MEM_callocN(sizeof(GPUInput), "GPUInput");
 	input->node = node;
 
@@ -1372,7 +1372,7 @@ static void gpu_nodes_get_builtin_flag(ListBase *nodes, int *builtin)
 {
 	GPUNode *node;
 	GPUInput *input;
-	
+
 	*builtin = 0;
 
 	for (node = nodes->first; node; node = node->next)
@@ -1443,10 +1443,10 @@ GPUNodeLink *GPU_cube_map(Image *ima, ImageUser *iuser, bool is_data)
 GPUNodeLink *GPU_image_preview(PreviewImage *prv)
 {
 	GPUNodeLink *link = GPU_node_link_create();
-	
+
 	link->image = GPU_NODE_LINK_IMAGE_PREVIEW;
 	link->ptr1 = prv;
-	
+
 	return link;
 }
 
@@ -1550,7 +1550,7 @@ bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNod
 			totin++;
 		}
 	}
-	
+
 	if (out) {
 		for (i = 0; out[i].type != GPU_NONE; i++) {
 			gpu_node_output(node, out[i].type, &out[i].link);
@@ -1583,7 +1583,7 @@ bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNod
 	va_end(params);
 
 	gpu_material_add_node(mat, node);
-	
+
 	return true;
 }
 
@@ -1621,7 +1621,7 @@ static void gpu_nodes_tag(GPUNodeLink *link)
 	node = link->output->node;
 	if (node->tag)
 		return;
-	
+
 	node->tag = true;
 	for (input = node->inputs.first; input; input = input->next)
 		if (input->link)
@@ -1704,7 +1704,7 @@ GPUPass *GPU_generate_pass(
 		gpu_nodes_free(nodes);
 		return NULL;
 	}
-	
+
 	/* create pass */
 	pass = MEM_callocN(sizeof(GPUPass), "GPUPass");
 
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 514f2f71bd7..947cd43d27b 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/int

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list