diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-08 14:05:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-08 14:05:41 +0300 |
commit | 804205babe212972dd800c5a2f6d9ebfb64feefb (patch) | |
tree | 14fb50ce24a26e30f52448afc063401116889e40 /source/blender/gpu | |
parent | 392ed710d62ce496491566f9743ad9e66737072a (diff) |
Cleanup: rename 'ct' to 'len' for gawain
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_batch.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_batch_presets.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 12 |
4 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index 59d88e81822..6194e720156 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -126,7 +126,7 @@ Gwn_Batch *GPU_batch_tris_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -230,7 +230,7 @@ Gwn_Batch *GPU_batch_wire_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c index 10cbd16490b..eaf0a6821ff 100644 --- a/source/blender/gpu/intern/gpu_batch_presets.c +++ b/source/blender/gpu/intern/gpu_batch_presets.c @@ -65,7 +65,7 @@ static ListBase presets_list = {NULL, NULL}; static Gwn_VertFormat *preset_3D_format(void) { - if (g_presets_3d.format.attrib_ct == 0) { + if (g_presets_3d.format.attr_len == 0) { Gwn_VertFormat *format = &g_presets_3d.format; g_presets_3d.attr_id.pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_presets_3d.attr_id.nor = GWN_vertformat_attr_add(format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 688386810ea..dfaa5cb5d72 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -133,7 +133,7 @@ static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int v /* match 'VertexBufferFormat' */ static Gwn_VertFormat format = {0}; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { g_vbo_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_vbo_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); g_vbo_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -142,7 +142,7 @@ static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int v buffers->vert_buf = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_DYNAMIC); GWN_vertbuf_data_alloc(buffers->vert_buf, vert_ct); } - else if (vert_ct != buffers->vert_buf->vertex_ct) { + else if (vert_ct != buffers->vert_buf->vertex_len) { GWN_vertbuf_data_resize(buffers->vert_buf, vert_ct); } #else diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index ae037ca442e..b7385bdf07c 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -823,12 +823,12 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) Gwn_VertAttr *attr = &format->attribs[0]; /* Detect incompatible cases (not supported by texture buffers) */ - BLI_assert(format->attrib_ct == 1 && vert->vbo_id != 0); - BLI_assert(attr->comp_ct != 3); /* Not until OGL 4.0 */ + BLI_assert(format->attr_len == 1 && vert->vbo_id != 0); + BLI_assert(attr->comp_len != 3); /* Not until OGL 4.0 */ BLI_assert(attr->comp_type != GWN_COMP_I10); BLI_assert(attr->fetch_mode != GWN_FETCH_INT_TO_FLOAT); - unsigned int byte_per_comp = attr->sz / attr->comp_ct; + unsigned int byte_per_comp = attr->sz / attr->comp_len; bool is_uint = ELEM(attr->comp_type, GWN_COMP_U8, GWN_COMP_U16, GWN_COMP_U32); /* Cannot fetch signed int or 32bit ints as normalized float. */ @@ -839,7 +839,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) GPUTextureFormat data_type; switch (attr->fetch_mode) { case GWN_FETCH_FLOAT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = GPU_R32F; break; case 2: data_type = GPU_RG32F; break; // case 3: data_type = GPU_RGB32F; break; /* Not supported */ @@ -847,7 +847,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: switch (byte_per_comp) { case 1: data_type = (is_uint) ? GPU_R8UI : GPU_R8I; break; @@ -872,7 +872,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT_TO_FLOAT_UNIT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = (byte_per_comp == 1) ? GPU_R8 : GPU_R16; break; case 2: data_type = (byte_per_comp == 1) ? GPU_RG8 : GPU_RG16; break; default: data_type = (byte_per_comp == 1) ? GPU_RGBA8 : GPU_RGBA16; break; |