Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-08 14:05:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-08 14:05:41 +0300
commit804205babe212972dd800c5a2f6d9ebfb64feefb (patch)
tree14fb50ce24a26e30f52448afc063401116889e40 /source
parent392ed710d62ce496491566f9743ad9e66737072a (diff)
Cleanup: rename 'ct' to 'len' for gawain
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_cache.c100
-rw-r--r--source/blender/draw/intern/draw_cache_impl_curve.c12
-rw-r--r--source/blender/draw/intern/draw_cache_impl_displist.c4
-rw-r--r--source/blender/draw/intern/draw_cache_impl_lattice.c2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c36
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c6
-rw-r--r--source/blender/draw/intern/draw_instance_data.c4
-rw-r--r--source/blender/draw/intern/draw_manager_data.c12
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/mask/mask_draw.c6
-rw-r--r--source/blender/editors/space_file/file_draw.c8
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c4
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c2
-rw-r--r--source/blender/gpu/intern/gpu_batch.c4
-rw-r--r--source/blender/gpu/intern/gpu_batch_presets.c2
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c4
-rw-r--r--source/blender/gpu/intern/gpu_texture.c12
-rw-r--r--source/blender/python/gawain/gwn_py_types.c22
18 files changed, 121 insertions, 121 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 5c3546f07a7..2251285be74 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -164,7 +164,7 @@ static Gwn_VertBuf *fill_arrows_vbo(const float scale)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -211,7 +211,7 @@ static Gwn_VertBuf *sphere_wire_vbo(const float rad)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -263,7 +263,7 @@ Gwn_Batch *DRW_cache_fullscreen_quad_get(void)
/* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos, uvs; } 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);
attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
@@ -291,7 +291,7 @@ Gwn_Batch *DRW_cache_quad_get(void)
/* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos, uvs; } 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);
attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
@@ -344,7 +344,7 @@ Gwn_Batch *DRW_cache_cube_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -369,7 +369,7 @@ Gwn_Batch *DRW_cache_circle_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -400,7 +400,7 @@ Gwn_Batch *DRW_cache_square_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -427,7 +427,7 @@ Gwn_Batch *DRW_cache_single_line_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -452,7 +452,7 @@ Gwn_Batch *DRW_cache_single_line_endpoints_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -476,7 +476,7 @@ Gwn_Batch *DRW_cache_screenspace_circle_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -613,7 +613,7 @@ Gwn_Batch *DRW_cache_plain_axes_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -644,7 +644,7 @@ Gwn_Batch *DRW_cache_single_arrow_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -700,7 +700,7 @@ Gwn_Batch *DRW_cache_empty_cone_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -752,7 +752,7 @@ Gwn_Batch *DRW_cache_axis_names_get(void)
/* Position Only 3D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* Using 3rd component as axis indicator */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -810,7 +810,7 @@ Gwn_Batch *DRW_cache_image_plane_get(void)
const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
static Gwn_VertFormat format = { 0 };
static struct { uint pos, texCoords; } 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);
attr_id.texCoords = GWN_vertformat_attr_add(&format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
@@ -831,7 +831,7 @@ Gwn_Batch *DRW_cache_image_plane_wire_get(void)
const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
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);
}
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
@@ -854,7 +854,7 @@ Gwn_Batch *DRW_cache_field_wind_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -891,7 +891,7 @@ Gwn_Batch *DRW_cache_field_force_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -929,7 +929,7 @@ Gwn_Batch *DRW_cache_field_vortex_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -966,7 +966,7 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1015,7 +1015,7 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1070,7 +1070,7 @@ Gwn_Batch *DRW_cache_lamp_get(void)
/* Position Only 3D format */
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);
}
@@ -1102,7 +1102,7 @@ Gwn_Batch *DRW_cache_lamp_shadows_get(void)
/* Position Only 3D format */
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);
}
@@ -1133,7 +1133,7 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void)
/* Position Only 2D format */
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);
}
@@ -1168,7 +1168,7 @@ Gwn_Batch *DRW_cache_lamp_area_square_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1201,7 +1201,7 @@ Gwn_Batch *DRW_cache_lamp_area_disk_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1235,7 +1235,7 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1313,7 +1313,7 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void)
/* Position Only 3D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos, n1, n2; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
@@ -1372,7 +1372,7 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1410,7 +1410,7 @@ Gwn_Batch *DRW_cache_speaker_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1483,7 +1483,7 @@ Gwn_Batch *DRW_cache_lightprobe_cube_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1528,7 +1528,7 @@ Gwn_Batch *DRW_cache_lightprobe_grid_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1581,7 +1581,7 @@ Gwn_Batch *DRW_cache_lightprobe_planar_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -1709,7 +1709,7 @@ Gwn_Batch *DRW_cache_bone_octahedral_get(void)
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor, snor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
@@ -1875,7 +1875,7 @@ Gwn_Batch *DRW_cache_bone_box_get(void)
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor, snor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
@@ -1942,7 +1942,7 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
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, 3, GWN_FETCH_FLOAT);
}
@@ -1989,7 +1989,7 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void)
/* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos0, pos1, pos2; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
attr_id.pos2 = GWN_vertformat_attr_add(&format, "pos2", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
@@ -2045,7 +2045,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void)
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -2081,7 +2081,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void)
/* Position Only 2D format */
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);
}
@@ -2115,7 +2115,7 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void)
/* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos0, pos1; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
@@ -2172,7 +2172,7 @@ Gwn_Batch *DRW_cache_bone_stick_get(void)
/* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos, flag; } 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);
attr_id.flag = GWN_vertformat_attr_add(&format, "flag", GWN_COMP_U32, 1, GWN_FETCH_INT);
}
@@ -2314,7 +2314,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void)
/* Position Only 3D format */
static Gwn_VertFormat format = { 0 };
static struct { uint axis, pos, col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.axis = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
attr_id.pos = GWN_vertformat_attr_add(&format, "screenPos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
attr_id.col = GWN_vertformat_attr_add(&format, "colorAxis", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
@@ -2456,7 +2456,7 @@ Gwn_Batch *DRW_cache_camera_get(void)
if (!SHC.drw_camera) {
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, 1, GWN_FETCH_FLOAT);
}
@@ -2489,7 +2489,7 @@ Gwn_Batch *DRW_cache_camera_frame_get(void)
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, 1, GWN_FETCH_FLOAT);
}
@@ -2515,7 +2515,7 @@ Gwn_Batch *DRW_cache_camera_tria_get(void)
if (!SHC.drw_camera_tria) {
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, 1, GWN_FETCH_FLOAT);
}
@@ -2552,7 +2552,7 @@ Gwn_Batch *DRW_cache_single_vert_get(void)
/* Position Only 3D format */
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, 3, GWN_FETCH_FLOAT);
}
@@ -2987,7 +2987,7 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type)
static Gwn_VertFormat format = { 0 };
static uint pos_id, axis_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -3034,7 +3034,7 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type)
static Gwn_VertFormat format = { 0 };
static uint pos_id, axis_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -3085,7 +3085,7 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type)
static Gwn_VertFormat format = { 0 };
static uint pos_id, axis_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -3133,7 +3133,7 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines)
static Gwn_VertFormat format = { 0 };
static struct { uint pos, color; } 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);
attr_id.color = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
}
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index 1bf34953dc6..4de1dfd24f5 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -503,7 +503,7 @@ static Gwn_VertBuf *curve_batch_cache_get_wire_verts(CurveRenderData *rdata, Cur
if (cache->wire.verts == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -581,7 +581,7 @@ static Gwn_VertBuf *curve_batch_cache_get_normal_verts(CurveRenderData *rdata, C
if (cache->normal.verts == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -675,7 +675,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu)
if (cache->overlay.verts == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT);
@@ -743,7 +743,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu)
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT);
@@ -850,7 +850,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_select(CurveRenderData *rdata, C
EditFont *ef = rdata->text.edit_font;
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, 3, GWN_FETCH_FLOAT);
}
@@ -924,7 +924,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_cursor(CurveRenderData *rdata, C
if (cache->text.cursor == NULL) {
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/draw/intern/draw_cache_impl_displist.c b/source/blender/draw/intern/draw_cache_impl_displist.c
index 3eecff024a1..8d187af0501 100644
--- a/source/blender/draw/intern/draw_cache_impl_displist.c
+++ b/source/blender/draw/intern/draw_cache_impl_displist.c
@@ -122,7 +122,7 @@ Gwn_VertBuf *DRW_displist_vertbuf_calc_pos_with_normals(ListBase *lb)
{
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
@@ -228,7 +228,7 @@ Gwn_Batch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(Lis
static Gwn_VertFormat shaded_triangles_format = { 0 };
static struct { uint pos, nor, uv; } attr_id;
- if (shaded_triangles_format.attrib_ct == 0) {
+ if (shaded_triangles_format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&shaded_triangles_format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&shaded_triangles_format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c
index 6046d9854fb..99dce2d7343 100644
--- a/source/blender/draw/intern/draw_cache_impl_lattice.c
+++ b/source/blender/draw/intern/draw_cache_impl_lattice.c
@@ -507,7 +507,7 @@ static void lattice_batch_cache_create_overlay_batches(Lattice *lt)
if (cache->overlay_verts == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT);
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 6c6e2d78206..7a72622cb9e 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -2159,7 +2159,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_uv_active(
static Gwn_VertFormat format = { 0 };
static struct { uint uv; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.uv = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
@@ -2222,7 +2222,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_pos_and_normals_ex(
if (*r_vbo == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
}
@@ -2374,7 +2374,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_facedot_pos_with_normals_and_flag(
if (cache->ed_fcenter_pos_with_nor_and_sel == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.data = GWN_vertformat_attr_add(&format, "norAndFlag", GWN_COMP_I10, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
}
@@ -2418,7 +2418,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_edges_visible(
if (cache->ed_edge_pos == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -2463,7 +2463,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_verts_visible(
if (cache->ed_vert_pos == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -2513,7 +2513,7 @@ static Gwn_VertBuf *mesh_create_facedot_select_id(
{
static Gwn_VertFormat format = { 0 };
static struct { uint pos, col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -2561,7 +2561,7 @@ static Gwn_VertBuf *mesh_create_edges_select_id(
{
static Gwn_VertFormat format = { 0 };
static struct { uint pos, col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -2611,7 +2611,7 @@ static Gwn_VertBuf *mesh_create_verts_select_id(
{
static Gwn_VertFormat format = { 0 };
static struct { uint pos, col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -2671,7 +2671,7 @@ static Gwn_VertBuf *mesh_create_tri_weights(
static Gwn_VertFormat format = { 0 };
static struct { uint col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
@@ -2731,7 +2731,7 @@ static Gwn_VertBuf *mesh_create_tri_vert_colors(
static Gwn_VertFormat format = { 0 };
static struct { uint col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
}
@@ -2791,7 +2791,7 @@ static Gwn_VertBuf *mesh_create_tri_select_id(
static Gwn_VertFormat format = { 0 };
static struct { uint col; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
@@ -2847,7 +2847,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order(
if (cache->pos_in_order == NULL) {
static Gwn_VertFormat format = { 0 };
static struct { uint pos, nor; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* Normal is padded so that the vbo can be used as a buffer texture */
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
@@ -2887,7 +2887,7 @@ static Gwn_VertFormat *edit_mesh_overlay_pos_format(uint *r_pos_id)
{
static Gwn_VertFormat format_pos = { 0 };
static uint pos_id;
- if (format_pos.attrib_ct == 0) {
+ if (format_pos.attr_len == 0) {
pos_id = GWN_vertformat_attr_add(&format_pos, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
}
*r_pos_id = pos_id;
@@ -2899,7 +2899,7 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lno
static Gwn_VertFormat format_nor = { 0 };
static Gwn_VertFormat format_nor_loop = { 0 };
static uint vnor_id, vnor_loop_id, lnor_id;
- if (format_nor.attrib_ct == 0) {
+ if (format_nor.attr_len == 0) {
vnor_id = GWN_vertformat_attr_add(&format_nor, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
vnor_loop_id = GWN_vertformat_attr_add(&format_nor_loop, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
lnor_id = GWN_vertformat_attr_add(&format_nor_loop, "lnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
@@ -2919,7 +2919,7 @@ static Gwn_VertFormat *edit_mesh_overlay_data_format(uint *r_data_id)
{
static Gwn_VertFormat format_flag = { 0 };
static uint data_id;
- if (format_flag.attrib_ct == 0) {
+ if (format_flag.attr_len == 0) {
data_id = GWN_vertformat_attr_add(&format_flag, "data", GWN_COMP_U8, 4, GWN_FETCH_INT);
}
*r_data_id = data_id;
@@ -3657,7 +3657,7 @@ static Gwn_VertBuf *mesh_create_edge_pos_with_sel(
static Gwn_VertFormat format = { 0 };
static struct { uint pos, sel; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.sel = GWN_vertformat_attr_add(&format, "select", GWN_COMP_U8, 1, GWN_FETCH_INT);
}
@@ -3744,7 +3744,7 @@ static Gwn_VertBuf *mesh_create_vert_pos_with_overlay_data(
static Gwn_VertFormat format = { 0 };
static struct { uint data; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_I8, 1, GWN_FETCH_INT);
}
@@ -3997,7 +3997,7 @@ Gwn_Batch *DRW_mesh_batch_cache_get_fancy_edges(Mesh *me)
/* create batch from DM */
static Gwn_VertFormat format = { 0 };
static struct { uint pos, n1, n2; } attr_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 60b367f7b1a..df67d34d566 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -1219,7 +1219,7 @@ static void particle_batch_cache_ensure_pos(
GWN_VERTBUF_DISCARD_SAFE(point_cache->pos);
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
rot_id = GWN_vertformat_attr_add(&format, "rot", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
@@ -1424,7 +1424,7 @@ static void particle_batch_cache_ensure_edit_inner_pos(
GWN_VERTBUF_DISCARD_SAFE(cache->edit_inner_pos);
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
@@ -1495,7 +1495,7 @@ static void particle_batch_cache_ensure_edit_tip_pos(
GWN_VERTBUF_DISCARD_SAFE(cache->edit_tip_pos);
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
/* initialize vertex format */
pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c
index e5b5ec31823..e322d4780d5 100644
--- a/source/blender/draw/intern/draw_instance_data.c
+++ b/source/blender/draw/intern/draw_instance_data.c
@@ -215,7 +215,7 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
realloc_size = i + 1;
uint vert_len = DRW_shgroup_get_instance_count(bbuf->shgroup);
vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */
- if (vert_len + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_ct) {
+ if (vert_len + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_len) {
uint size = vert_len + BUFFER_VERTS_CHUNK - 1;
size = size - size % BUFFER_VERTS_CHUNK;
GWN_vertbuf_data_resize(bbuf->vert, size);
@@ -247,7 +247,7 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
realloc_size = i + 1;
uint vert_len = DRW_shgroup_get_instance_count(ibuf->shgroup);
vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */
- if (vert_len + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_ct) {
+ if (vert_len + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_len) {
uint size = vert_len + BUFFER_VERTS_CHUNK - 1;
size = size - size % BUFFER_VERTS_CHUNK;
GWN_vertbuf_data_resize(ibuf->vert, size);
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 2e6079e1661..c259633982e 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -553,7 +553,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at
{
#ifdef USE_GPU_SELECT
if (G.f & G_PICKSEL) {
- if (shgroup->instance_count == shgroup->inst_selectid->vertex_ct) {
+ if (shgroup->instance_count == shgroup->inst_selectid->vertex_len) {
GWN_vertbuf_data_resize(shgroup->inst_selectid, shgroup->instance_count + 32);
}
GWN_vertbuf_attr_set(shgroup->inst_selectid, 0, shgroup->instance_count, &DST.select_id);
@@ -564,7 +564,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at
UNUSED_VARS_NDEBUG(attr_len);
for (int i = 0; i < attr_len; ++i) {
- if (shgroup->instance_count == shgroup->instance_vbo->vertex_ct) {
+ if (shgroup->instance_count == shgroup->instance_vbo->vertex_len) {
GWN_vertbuf_data_resize(shgroup->instance_vbo, shgroup->instance_count + 32);
}
GWN_vertbuf_attr_set(shgroup->instance_vbo, i, shgroup->instance_count, attr[i]);
@@ -651,7 +651,7 @@ static void drw_shgroup_instance_init(
shgroup->instance_geom = batch;
#ifndef NDEBUG
- shgroup->attribs_count = format->attrib_ct;
+ shgroup->attribs_count = format->attr_len;
#endif
DRW_instancing_buffer_request(DST.idatalist, format, batch, shgroup,
@@ -662,7 +662,7 @@ static void drw_shgroup_instance_init(
/* Not actually used for rendering but alloced in one chunk.
* Plus we don't have to care about ownership. */
static Gwn_VertFormat inst_select_format = {0};
- if (inst_select_format.attrib_ct == 0) {
+ if (inst_select_format.attr_len == 0) {
GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
Gwn_Batch *batch_dummy; /* Not used */
@@ -679,7 +679,7 @@ static void drw_shgroup_batching_init(
drw_shgroup_init(shgroup, shader);
#ifndef NDEBUG
- shgroup->attribs_count = (format != NULL) ? format->attrib_ct : 0;
+ shgroup->attribs_count = (format != NULL) ? format->attr_len : 0;
#endif
BLI_assert(format != NULL);
@@ -698,7 +698,7 @@ static void drw_shgroup_batching_init(
if (G.f & G_PICKSEL) {
/* Not actually used for rendering but alloced in one chunk. */
static Gwn_VertFormat inst_select_format = {0};
- if (inst_select_format.attrib_ct == 0) {
+ if (inst_select_format.attr_len == 0) {
GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT);
}
Gwn_Batch *batch; /* Not used */
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index cfbf6e711c3..03ff6593c59 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -259,7 +259,7 @@ static struct {
static Gwn_VertFormat *vflag_format(void)
{
- if (g_ui_batch_cache.format.attrib_ct == 0) {
+ if (g_ui_batch_cache.format.attr_len == 0) {
Gwn_VertFormat *format = &g_ui_batch_cache.format;
g_ui_batch_cache.vflag_id = GWN_vertformat_attr_add(format, "vflag", GWN_COMP_U32, 1, GWN_FETCH_INT);
}
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index baeaeb018d7..4717ef309f3 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -371,10 +371,10 @@ static void mask_color_active_tint(unsigned char r_rgb[4], const unsigned char r
}
}
-static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_ct)
+static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_len)
{
- immBegin(prim_type, vertex_ct);
- for (unsigned int i = 0; i < vertex_ct; ++i) {
+ immBegin(prim_type, vertex_len);
+ for (unsigned int i = 0; i < vertex_len; ++i) {
immVertex2fv(pos, points[i]);
}
immEnd();
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 0416ecba72c..42ad34b659b 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -486,14 +486,14 @@ static void draw_dividers(FileLayout *layout, View2D *v2d)
const int step = (layout->tile_w + 2 * layout->tile_border_x);
- unsigned int vertex_ct = 0;
+ unsigned int vertex_len = 0;
int sx = (int)v2d->tot.xmin;
while (sx < v2d->cur.xmax) {
sx += step;
- vertex_ct += 4; /* vertex_count = 2 points per line * 2 lines per divider */
+ vertex_len += 4; /* vertex_count = 2 points per line * 2 lines per divider */
}
- if (vertex_ct > 0) {
+ if (vertex_len > 0) {
int v1[2], v2[2];
unsigned char col_hi[3], col_lo[3];
@@ -508,7 +508,7 @@ static void draw_dividers(FileLayout *layout, View2D *v2d)
uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBegin(GWN_PRIM_LINES, vertex_ct);
+ immBegin(GWN_PRIM_LINES, vertex_len);
sx = (int)v2d->tot.xmin;
while (sx < v2d->cur.xmax) {
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 24df0a61012..f0d6b5c2a71 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -765,7 +765,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
immEnd();
/* Then draw each face contour separately. */
- if (loop_vbo->vertex_ct != 0) {
+ if (loop_vbo->vertex_len != 0) {
GWN_batch_program_use_begin(loop_batch);
unsigned int index = 0, loop_vbo_count;
BM_ITER_MESH(efa, &iter, bm, BM_FACES_OF_MESH) {
@@ -792,7 +792,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
/* Create a color buffer. */
static Gwn_VertFormat format = { 0 };
static uint shdr_col;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
shdr_col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
}
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 9091f3eff0b..c3737787933 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -1567,7 +1567,7 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar
static Gwn_VertFormat format = { 0 };
static unsigned int pos_id;
- if (format.attrib_ct == 0) {
+ if (format.attr_len == 0) {
pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
}
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;
diff --git a/source/blender/python/gawain/gwn_py_types.c b/source/blender/python/gawain/gwn_py_types.c
index 9ddad009a12..7527830eb63 100644
--- a/source/blender/python/gawain/gwn_py_types.c
+++ b/source/blender/python/gawain/gwn_py_types.c
@@ -210,7 +210,7 @@ static void fill_format_elem(void *data_dst_void, PyObject *py_src, const Gwn_Ve
/* No error checking, callers must run PyErr_Occurred */
static void fill_format_tuple(void *data_dst_void, PyObject *py_src, const Gwn_VertAttr *attr)
{
- const uint len = attr->comp_ct;
+ const uint len = attr->comp_len;
/**
* Args are constants, so range checks will be optimized out if they're nop's.
@@ -247,15 +247,15 @@ static bool bpygwn_vertbuf_fill_impl(
const uint seq_len = PySequence_Fast_GET_SIZE(seq_fast);
- if (seq_len != vbo->vertex_ct) {
+ if (seq_len != vbo->vertex_len) {
PyErr_Format(PyExc_ValueError,
"Expected a sequence of size %d, got %d",
- vbo->vertex_ct, seq_len);
+ vbo->vertex_len, seq_len);
}
PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast);
- if (attr->comp_ct == 1) {
+ if (attr->comp_len == 1) {
for (uint i = 0; i < seq_len; i++) {
uchar *data = (uchar *)GWN_vertbuf_raw_step(&data_step);
PyObject *item = seq_items[i];
@@ -273,10 +273,10 @@ static bool bpygwn_vertbuf_fill_impl(
ok = false;
goto finally;
}
- if (PyTuple_GET_SIZE(item) != attr->comp_ct) {
+ if (PyTuple_GET_SIZE(item) != attr->comp_len) {
PyErr_Format(PyExc_ValueError,
"expected a tuple of size %d, got %d",
- attr->comp_ct, PyTuple_GET_SIZE(item));
+ attr->comp_len, PyTuple_GET_SIZE(item));
ok = false;
goto finally;
}
@@ -300,7 +300,7 @@ finally:
#if 0
static int bpygwn_find_id(const Gwn_VertFormat *fmt, const char *id)
{
- for (int i = 0; i < fmt->attrib_ct; i++) {
+ for (int i = 0; i < fmt->attr_len; i++) {
for (uint j = 0; j < fmt->name_ct; j++) {
if (STREQ(fmt->attribs[i].name[j], id)) {
return i;
@@ -346,7 +346,7 @@ static PyObject *bpygwn_VertFormat_attr_add(BPyGwn_VertFormat *self, PyObject *a
Gwn_VertFetchMode fetch_mode;
} params;
- if (self->fmt.attrib_ct == GWN_VERT_ATTR_MAX_LEN) {
+ if (self->fmt.attr_len == GWN_VERT_ATTR_MAX_LEN) {
PyErr_SetString(PyExc_ValueError, "Maxumum attr reached " STRINGIFY(GWN_VERT_ATTR_MAX_LEN));
return NULL;
}
@@ -440,7 +440,7 @@ static PyObject *bpygwn_VertBuf_fill(BPyGwn_VertBuf *self, PyObject *args, PyObj
return NULL;
}
- if (params.id >= self->buf->format.attrib_ct) {
+ if (params.id >= self->buf->format.attr_len) {
PyErr_Format(PyExc_ValueError,
"Format id %d out of range",
params.id);
@@ -532,10 +532,10 @@ static PyObject *bpygwn_VertBatch_vertbuf_add(BPyGwn_Batch *self, BPyGwn_VertBuf
return NULL;
}
- if (self->batch->verts[0]->vertex_ct != py_buf->buf->vertex_ct) {
+ if (self->batch->verts[0]->vertex_len != py_buf->buf->vertex_len) {
PyErr_Format(PyExc_TypeError,
"Expected %d length, got %d",
- self->batch->verts[0]->vertex_ct, py_buf->buf->vertex_ct);
+ self->batch->verts[0]->vertex_len, py_buf->buf->vertex_len);
return NULL;
}