[Bf-blender-cvs] [804205babe2] blender2.8: Cleanup: rename 'ct' to 'len' for gawain

Campbell Barton noreply at git.blender.org
Sun Jul 8 13:20:54 CEST 2018


Commit: 804205babe212972dd800c5a2f6d9ebfb64feefb
Author: Campbell Barton
Date:   Sun Jul 8 13:05:41 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB804205babe212972dd800c5a2f6d9ebfb64feefb

Cleanup: rename 'ct' to 'len' for gawain

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

M	intern/gawain/gawain/gwn_batch.h
M	intern/gawain/gawain/gwn_element.h
M	intern/gawain/gawain/gwn_immediate.h
M	intern/gawain/gawain/gwn_shader_interface.h
M	intern/gawain/gawain/gwn_vertex_buffer.h
M	intern/gawain/gawain/gwn_vertex_format.h
M	intern/gawain/gawain/gwn_vertex_format_private.h
M	intern/gawain/src/gwn_attr_binding.c
M	intern/gawain/src/gwn_batch.c
M	intern/gawain/src/gwn_buffer_id.cpp
M	intern/gawain/src/gwn_element.c
M	intern/gawain/src/gwn_immediate.c
M	intern/gawain/src/gwn_shader_interface.c
M	intern/gawain/src/gwn_vertex_array_id.cpp
M	intern/gawain/src/gwn_vertex_buffer.c
M	intern/gawain/src/gwn_vertex_format.c
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache_impl_curve.c
M	source/blender/draw/intern/draw_cache_impl_displist.c
M	source/blender/draw/intern/draw_cache_impl_lattice.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/draw/intern/draw_cache_impl_particles.c
M	source/blender/draw/intern/draw_instance_data.c
M	source/blender/draw/intern/draw_manager_data.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/mask/mask_draw.c
M	source/blender/editors/space_file/file_draw.c
M	source/blender/editors/uvedit/uvedit_draw.c
M	source/blender/editors/uvedit/uvedit_smart_stitch.c
M	source/blender/gpu/intern/gpu_batch.c
M	source/blender/gpu/intern/gpu_batch_presets.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_texture.c
M	source/blender/python/gawain/gwn_py_types.c

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

diff --git a/intern/gawain/gawain/gwn_batch.h b/intern/gawain/gawain/gwn_batch.h
index e0cf66637f6..cf7b0c9f1b5 100644
--- a/intern/gawain/gawain/gwn_batch.h
+++ b/intern/gawain/gawain/gwn_batch.h
@@ -149,9 +149,9 @@ typedef struct BatchWithOwnVertexBufferAndElementList {
 	Gwn_VertBuf verts; // link batch.verts to this
 } BatchWithOwnVertexBufferAndElementList;
 
-Gwn_Batch* create_BatchWithOwnVertexBuffer(Gwn_PrimType, Gwn_VertFormat*, unsigned v_ct, Gwn_IndexBuf*);
-Gwn_Batch* create_BatchWithOwnElementList(Gwn_PrimType, Gwn_VertBuf*, unsigned prim_ct);
-Gwn_Batch* create_BatchWithOwnVertexBufferAndElementList(Gwn_PrimType, Gwn_VertFormat*, unsigned v_ct, unsigned prim_ct);
+Gwn_Batch* create_BatchWithOwnVertexBuffer(Gwn_PrimType, Gwn_VertFormat*, unsigned v_len, Gwn_IndexBuf*);
+Gwn_Batch* create_BatchWithOwnElementList(Gwn_PrimType, Gwn_VertBuf*, unsigned prim_len);
+Gwn_Batch* create_BatchWithOwnVertexBufferAndElementList(Gwn_PrimType, Gwn_VertFormat*, unsigned v_len, unsigned prim_len);
 // verts: shared, own
 // elem: none, shared, own
 Gwn_Batch* create_BatchInGeneral(Gwn_PrimType, VertexBufferStuff, ElementListStuff);
diff --git a/intern/gawain/gawain/gwn_element.h b/intern/gawain/gawain/gwn_element.h
index 4bd0c34675a..53a54cdfd76 100644
--- a/intern/gawain/gawain/gwn_element.h
+++ b/intern/gawain/gawain/gwn_element.h
@@ -24,7 +24,7 @@ typedef enum {
 } Gwn_IndexBufType;
 
 typedef struct Gwn_IndexBuf {
-	unsigned index_ct;
+	unsigned index_len;
 #if GWN_TRACK_INDEX_RANGE
 	Gwn_IndexBufType index_type;
 	uint32_t gl_index_type;
@@ -41,8 +41,8 @@ unsigned GWN_indexbuf_size_get(const Gwn_IndexBuf*);
 
 typedef struct Gwn_IndexBufBuilder {
 	unsigned max_allowed_index;
-	unsigned max_index_ct;
-	unsigned index_ct;
+	unsigned max_index_len;
+	unsigned index_len;
 	Gwn_PrimType prim_type;
 	unsigned* data;
 	bool use_prim_restart;
@@ -50,10 +50,10 @@ typedef struct Gwn_IndexBufBuilder {
 
 
 // supports all primitive types.
-void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned index_ct, unsigned vertex_ct, bool use_prim_restart);
+void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned index_len, unsigned vertex_len, bool use_prim_restart);
 
 // supports only GWN_PRIM_POINTS, GWN_PRIM_LINES and GWN_PRIM_TRIS.
-void GWN_indexbuf_init(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned prim_ct, unsigned vertex_ct);
+void GWN_indexbuf_init(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned prim_len, unsigned vertex_len);
 
 void GWN_indexbuf_add_generic_vert(Gwn_IndexBufBuilder*, unsigned v);
 void GWN_indexbuf_add_primitive_restart(Gwn_IndexBufBuilder*);
diff --git a/intern/gawain/gawain/gwn_immediate.h b/intern/gawain/gawain/gwn_immediate.h
index 35f9c9d9e2c..c3ea2b911a0 100644
--- a/intern/gawain/gawain/gwn_immediate.h
+++ b/intern/gawain/gawain/gwn_immediate.h
@@ -23,8 +23,8 @@ Gwn_VertFormat* immVertexFormat(void); // returns a cleared vertex format, ready
 void immBindProgram(uint32_t program, const Gwn_ShaderInterface*); // every immBegin must have a program bound first
 void immUnbindProgram(void); // call after your last immEnd, or before binding another program
 
-void immBegin(Gwn_PrimType, unsigned vertex_ct); // must supply exactly vertex_ct vertices
-void immBeginAtMost(Gwn_PrimType, unsigned max_vertex_ct); // can supply fewer vertices
+void immBegin(Gwn_PrimType, unsigned vertex_len); // must supply exactly vertex_len vertices
+void immBeginAtMost(Gwn_PrimType, unsigned max_vertex_len); // can supply fewer vertices
 void immEnd(void); // finishes and draws
 
 #if IMM_BATCH_COMBO
@@ -32,8 +32,8 @@ void immEnd(void); // finishes and draws
 // immBegin a batch, then use standard immFunctions as usual.
 // immEnd will finalize the batch instead of drawing.
 // Then you can draw it as many times as you like! Partially replaces the need for display lists.
-Gwn_Batch* immBeginBatch(Gwn_PrimType, unsigned vertex_ct);
-Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType, unsigned vertex_ct);
+Gwn_Batch* immBeginBatch(Gwn_PrimType, unsigned vertex_len);
+Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType, unsigned vertex_len);
 #endif
 
 
diff --git a/intern/gawain/gawain/gwn_shader_interface.h b/intern/gawain/gawain/gwn_shader_interface.h
index ee3d51fb3cc..b27b12c18d8 100644
--- a/intern/gawain/gawain/gwn_shader_interface.h
+++ b/intern/gawain/gawain/gwn_shader_interface.h
@@ -65,7 +65,7 @@ typedef struct Gwn_ShaderInterface {
 	Gwn_ShaderInput* builtin_uniforms[GWN_NUM_UNIFORMS];
 	char* name_buffer;
 	struct Gwn_Batch** batches; // references to batches using this interface
-	unsigned batches_ct;
+	unsigned batches_len;
 } Gwn_ShaderInterface;
 
 Gwn_ShaderInterface* GWN_shaderinterface_create(int32_t program_id);
diff --git a/intern/gawain/gawain/gwn_vertex_buffer.h b/intern/gawain/gawain/gwn_vertex_buffer.h
index b92e4a87698..0eac4838e65 100644
--- a/intern/gawain/gawain/gwn_vertex_buffer.h
+++ b/intern/gawain/gawain/gwn_vertex_buffer.h
@@ -17,7 +17,7 @@
 // How to create a Gwn_VertBuf:
 // 1) verts = GWN_vertbuf_create() or GWN_vertbuf_init(verts)
 // 2) GWN_vertformat_attr_add(verts->format, ...)
-// 3) GWN_vertbuf_data_alloc(verts, vertex_ct) <-- finalizes/packs vertex format
+// 3) GWN_vertbuf_data_alloc(verts, vertex_len) <-- finalizes/packs vertex format
 // 4) GWN_vertbuf_attr_fill(verts, pos, application_pos_buffer)
 
 // Is Gwn_VertBuf always used as part of a Gwn_Batch?
@@ -31,8 +31,8 @@ typedef enum {
 
 typedef struct Gwn_VertBuf {
 	Gwn_VertFormat format;
-	unsigned vertex_ct;    // number of verts we want to draw
-	unsigned vertex_alloc; // number of verts data
+	unsigned vertex_len;    /* number of verts we want to draw */
+	unsigned vertex_alloc;  /* number of verts data */
 	bool dirty;
 	unsigned char* data; // NULL indicates data in VRAM (unmapped)
 	uint32_t vbo_id; // 0 indicates not yet allocated
@@ -54,9 +54,9 @@ void GWN_vertbuf_init_with_format_ex(Gwn_VertBuf*, const Gwn_VertFormat*, Gwn_Us
 	GWN_vertbuf_init_with_format_ex(verts, format, GWN_USAGE_STATIC)
 
 unsigned GWN_vertbuf_size_get(const Gwn_VertBuf*);
-void GWN_vertbuf_data_alloc(Gwn_VertBuf*, unsigned v_ct);
-void GWN_vertbuf_data_resize(Gwn_VertBuf*, unsigned v_ct);
-void GWN_vertbuf_vertex_count_set(Gwn_VertBuf*, unsigned v_ct);
+void GWN_vertbuf_data_alloc(Gwn_VertBuf*, unsigned v_len);
+void GWN_vertbuf_data_resize(Gwn_VertBuf*, unsigned v_len);
+void GWN_vertbuf_vertex_count_set(Gwn_VertBuf*, unsigned v_len);
 
 // The most important set_attrib variant is the untyped one. Get it right first.
 // It takes a void* so the app developer is responsible for matching their app data types
diff --git a/intern/gawain/gawain/gwn_vertex_format.h b/intern/gawain/gawain/gwn_vertex_format.h
index 503c2d03c42..a4593e4615b 100644
--- a/intern/gawain/gawain/gwn_vertex_format.h
+++ b/intern/gawain/gawain/gwn_vertex_format.h
@@ -42,16 +42,16 @@ typedef struct Gwn_VertAttr {
 	Gwn_VertFetchMode fetch_mode;
 	Gwn_VertCompType comp_type;
 	unsigned gl_comp_type;
-	unsigned comp_ct; // 1 to 4 or 8 or 12 or 16
+	unsigned comp_len; // 1 to 4 or 8 or 12 or 16
 	unsigned sz; // size in bytes, 1 to 64
 	unsigned offset; // from beginning of vertex, in bytes
-	unsigned name_ct; // up to GWN_VERT_ATTR_MAX_NAMES
+	unsigned name_len; // up to GWN_VERT_ATTR_MAX_NAMES
 	const char* name[GWN_VERT_ATTR_MAX_NAMES];
 } Gwn_VertAttr;
 
 typedef struct Gwn_VertFormat {
-	unsigned attrib_ct; // 0 to 16 (GWN_VERT_ATTR_MAX_LEN)
-	unsigned name_ct; // total count of active vertex attrib
+	unsigned attr_len; // 0 to 16 (GWN_VERT_ATTR_MAX_LEN)
+	unsigned name_len; // total count of active vertex attrib
 	unsigned stride; // stride in bytes, 1 to 256
 	unsigned name_offset;
 	bool packed;
@@ -62,7 +62,7 @@ typedef struct Gwn_VertFormat {
 void GWN_vertformat_clear(Gwn_VertFormat*);
 void GWN_vertformat_copy(Gwn_VertFormat* dest, const Gwn_VertFormat* src);
 
-unsigned GWN_vertformat_attr_add(Gwn_VertFormat*, const char* name, Gwn_VertCompType, unsigned comp_ct, Gwn_VertFetchMode);
+unsigned GWN_vertformat_attr_add(Gwn_VertFormat*, const char* name, Gwn_VertCompType, unsigned comp_len, Gwn_VertFetchMode);
 void GWN_vertformat_alias_add(Gwn_VertFormat*, const char* alias);
 
 // format conversion
diff --git a/intern/gawain/gawain/gwn_vertex_format_private.h b/intern/gawain/gawain/gwn_vertex_format_private.h
index c1a0f734eda..90cd8412e53 100644
--- a/intern/gawain/gawain/gwn_vertex_format_private.h
+++ b/intern/gawain/gawain/gwn_vertex_format_private.h
@@ -13,4 +13,4 @@
 
 void VertexFormat_pack(Gwn_VertFormat*);
 unsigned padding(unsigned offset, unsigned alignment);
-unsigned vertex_buffer_size(const Gwn_VertFormat*, unsigned vertex_ct);
+unsigned vertex_buffer_size(const Gwn_VertFormat*, unsigned vertex_len);
diff --git a/intern/gawain/src/gwn_attr_binding.c b/intern/gawain/src/gwn_attr_binding.c
index 7647a927b1e..c702a0ae99d 100644
--- a/intern/gawain/src/gwn_attr_binding.c
+++ b/intern/gawain/src/gwn_attr_binding.c
@@ -52,10 +52,10 @@ void get_attrib_locations(const Gwn_VertFormat* format, Gwn_AttrBinding* binding
 	{
 	AttribBinding_clear(binding);
 
-	for (unsigned a_idx = 0; a_idx < format->attrib_ct; ++a_idx)
+	for (unsigned a_idx = 0; a_idx < format->attr_len; ++a_idx)
 		{
 		const Gwn_VertAttr* a = format->attribs + a_idx;
-		for (unsigned n_idx = 0; n_idx < a->name_ct; ++n_idx)
+		for (unsigned n_idx = 0; n_idx < a->name_len; ++n_idx)
 			{
 			const Gwn_ShaderInput* input = GWN_shaderinterface_attr(shaderface, a->name[n_idx]);
 
diff --git a/intern/gawain/src/gwn_batch.c b/intern/gawain/src/gwn_batch.c
index adc72e171c0..62342cfc42f 100644
--- a/intern/gawain/src/gwn_batch.c
+++ b/intern/gawain/src/gwn_batch.c
@@ -168,9 +168,9 @@ int GWN_batch_vertbuf_add_ex(
 		if (batch->verts[v] == NULL)
 			{
 #if TRUST_NO_ONE
-			// for now all VertexBuffers must have same vertex_ct
-			assert(verts->vertex_ct == batch->verts[0]->vertex_ct);
-			// in the near future we will enable instanced attribs which have their own vertex_ct
+			// for now all VertexBuffers must have same vertex_len
+			assert(verts->vertex_len == batch->verts[0]->vertex_len);
+			// in the near future we will enable instanced attribs which have their own vertex_len
 #endif
 			batch->verts[v] = verts;
 			// 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list