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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl6
-rw-r--r--source/blender/draw/engines/overlay/overlay_edit_mesh.c8
-rw-r--r--source/blender/draw/engines/overlay/overlay_particle.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_shader.c6
-rw-r--r--source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/extra_wire_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl6
-rw-r--r--source/blender/draw/intern/DRW_render.h10
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.c22
-rw-r--r--source/blender/draw/intern/draw_cache_impl_gpencil.c6
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c10
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c16
-rw-r--r--source/blender/draw/intern/draw_hair_private.h2
-rw-r--r--source/blender/draw/intern/draw_manager.h2
-rw-r--r--source/blender/draw/intern/draw_manager_data.c17
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c2
-rw-r--r--source/blender/draw/intern/shaders/common_view_lib.glsl6
17 files changed, 62 insertions, 63 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index 54b2369b32b..e2606473d07 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -212,7 +212,7 @@ uniform vec4 layerTint;
uniform float layerOpacity; /* Used for onion skin. */
uniform float strokeIndexOffset = 0.0;
-/* All of these attribs are quad loaded the same way
+/* All of these attributes are quad loaded the same way
* as GL_LINES_ADJACENCY would feed a geometry shader:
* - ma reference the previous adjacency point.
* - ma1 reference the current line first point.
@@ -236,7 +236,7 @@ in vec4 uv2;
in vec4 col1;
in vec4 col2;
in vec4 fcol1;
-/* WARNING: Max attrib count is actually 14 because OSX OpenGL implementation
+/* WARNING: Max attribute count is actually 14 because OSX OpenGL implementation
* considers gl_VertexID and gl_InstanceID as vertex attribute. (see T74536) */
# define stroke_id1 ma1.y
# define point_id1 ma1.z
@@ -389,7 +389,7 @@ void stroke_vertex()
mat4 model_mat = model_matrix_get();
- /* Avoid using a vertex attrib for quad positioning. */
+ /* Avoid using a vertex attribute for quad positioning. */
float x = float(gl_VertexID & 1) * 2.0 - 1.0; /* [-1..1] */
float y = float(gl_VertexID & 2) - 1.0; /* [-1..1] */
diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
index be4e4a9e00e..7fc1a7fdce6 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
@@ -254,7 +254,7 @@ static void overlay_edit_mesh_add_ob_to_pass(OVERLAY_PrivateData *pd, Object *ob
if (has_skin_roots) {
circle = DRW_cache_circle_get();
skin_roots = DRW_mesh_batch_cache_get_edit_skin_roots(ob->data);
- DRW_shgroup_call_instances_with_attribs(skin_roots_shgrp, ob, circle, skin_roots);
+ DRW_shgroup_call_instances_with_attrs(skin_roots_shgrp, ob, circle, skin_roots);
}
}
@@ -292,15 +292,15 @@ void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob)
struct GPUBatch *normal_geom = DRW_cache_normal_arrow_get();
if (vnormals_do) {
geom = DRW_mesh_batch_cache_get_edit_vnors(ob->data);
- DRW_shgroup_call_instances_with_attribs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
+ DRW_shgroup_call_instances_with_attrs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
}
if (lnormals_do) {
geom = DRW_mesh_batch_cache_get_edit_lnors(ob->data);
- DRW_shgroup_call_instances_with_attribs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
+ DRW_shgroup_call_instances_with_attrs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
}
if (fnormals_do) {
geom = DRW_mesh_batch_cache_get_edit_facedots(ob->data);
- DRW_shgroup_call_instances_with_attribs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
+ DRW_shgroup_call_instances_with_attrs(pd->edit_mesh_normals_grp, ob, normal_geom, geom);
}
}
diff --git a/source/blender/draw/engines/overlay/overlay_particle.c b/source/blender/draw/engines/overlay/overlay_particle.c
index dc98c1b55c1..98bc62ae66a 100644
--- a/source/blender/draw/engines/overlay/overlay_particle.c
+++ b/source/blender/draw/engines/overlay/overlay_particle.c
@@ -205,7 +205,7 @@ void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
grp = DRW_shgroup_create_sub(pd->particle_shapes_grp);
DRW_shgroup_uniform_vec4_copy(grp, "color", color);
shape = DRW_cache_particles_get_prim(draw_as);
- DRW_shgroup_call_instances_with_attribs(grp, NULL, shape, geom);
+ DRW_shgroup_call_instances_with_attrs(grp, NULL, shape, geom);
break;
}
}
diff --git a/source/blender/draw/engines/overlay/overlay_shader.c b/source/blender/draw/engines/overlay/overlay_shader.c
index 8b70a0982af..2bb3555b8d1 100644
--- a/source/blender/draw/engines/overlay/overlay_shader.c
+++ b/source/blender/draw/engines/overlay/overlay_shader.c
@@ -713,7 +713,7 @@ GPUShader *OVERLAY_shader_edit_mesh_normal(void)
datatoc_edit_mesh_normal_vert_glsl,
NULL},
.frag = (const char *[]){datatoc_gpu_shader_flat_color_frag_glsl, NULL},
- .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTRIB\n", NULL},
+ .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTR\n", NULL},
});
}
return sh_data->edit_mesh_normals;
@@ -750,7 +750,7 @@ GPUShader *OVERLAY_shader_edit_mesh_skin_root(void)
datatoc_edit_mesh_skin_root_vert_glsl,
NULL},
.frag = (const char *[]){datatoc_gpu_shader_flat_color_frag_glsl, NULL},
- .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTRIB\n", NULL},
+ .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTR\n", NULL},
});
}
return sh_data->edit_mesh_skin_root;
@@ -1269,7 +1269,7 @@ GPUShader *OVERLAY_shader_particle_shape(void)
datatoc_particle_vert_glsl,
NULL},
.frag = (const char *[]){datatoc_gpu_shader_flat_color_frag_glsl, NULL},
- .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTRIB\n", NULL},
+ .defs = (const char *[]){sh_cfg->def, "#define INSTANCED_ATTR\n", NULL},
});
}
return sh_data->particle_shape;
diff --git a/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl
index fd37bc8c534..c2aeae4df91 100644
--- a/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl
@@ -21,7 +21,7 @@ void main()
GPU_INTEL_VERTEX_SHADER_WORKAROUND
vec3 nor;
- /* Select the right normal by cheking if the generic attrib is used. */
+ /* Select the right normal by checking if the generic attribute is used. */
if (!all(equal(lnor.xyz, vec3(0)))) {
if (lnor.w < 0.0) {
finalColor = vec4(0.0);
diff --git a/source/blender/draw/engines/overlay/shaders/extra_wire_vert.glsl b/source/blender/draw/engines/overlay/shaders/extra_wire_vert.glsl
index 97183638a71..474f3254389 100644
--- a/source/blender/draw/engines/overlay/shaders/extra_wire_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/extra_wire_vert.glsl
@@ -1,7 +1,7 @@
in vec3 pos;
in vec4 color;
-in int colorid; /* if equal 0 (i.e: Not specified) use color attrib and stippling. */
+in int colorid; /* if equal 0 (i.e: Not specified) use color attribute and stippling. */
noperspective out vec2 stipple_coord;
flat out vec2 stipple_start;
diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
index 3fefe2cc0bf..7e71f4ae587 100644
--- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
@@ -101,8 +101,8 @@ void wire_object_color_get(out vec3 rim_col, out vec3 wire_col)
void main()
{
- bool no_attrib = all(equal(nor, vec3(0)));
- vec3 wnor = no_attrib ? ViewMatrixInverse[2].xyz : normalize(normal_object_to_world(nor));
+ bool no_attr = all(equal(nor, vec3(0)));
+ vec3 wnor = no_attr ? ViewMatrixInverse[2].xyz : normalize(normal_object_to_world(nor));
vec3 wpos = point_object_to_world(pos);
@@ -152,7 +152,7 @@ void main()
#endif
/* Cull flat edges below threshold. */
- if (!no_attrib && (get_edge_sharpness(wd) < 0.0)) {
+ if (!no_attr && (get_edge_sharpness(wd) < 0.0)) {
edgeStart = vec2(-1.0);
}
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 2d6d6c7d9d0..de4bf0303fe 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -404,11 +404,11 @@ void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
Object *ob,
struct GPUBatch *geom,
uint count);
-/* Warning: Only use with Shaders that have INSTANCED_ATTRIB defined. */
-void DRW_shgroup_call_instances_with_attribs(DRWShadingGroup *shgroup,
- Object *ob,
- struct GPUBatch *geom,
- struct GPUBatch *inst_attributes);
+/* Warning: Only use with Shaders that have INSTANCED_ATTR defined. */
+void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
+ Object *ob,
+ struct GPUBatch *geom,
+ struct GPUBatch *inst_attributes);
void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask, bool vcol);
void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **sh, Object *ob, bool vcol);
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c
index 3f7421dc2f6..70fe6a55461 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -1775,10 +1775,10 @@ static void *extract_uv_init(const MeshRenderData *mr, void *buf)
for (int i = 0; i < MAX_MTFACE; i++) {
if (uv_layers & (1 << i)) {
- char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i);
- GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
/* UV layer name. */
BLI_snprintf(attr_name, sizeof(attr_name), "u%s", attr_safe_name);
GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -1882,9 +1882,9 @@ static void extract_tan_ex(const MeshRenderData *mr, GPUVertBuf *vbo, const bool
for (int i = 0; i < MAX_MTFACE; i++) {
if (tan_layers & (1 << i)) {
- char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i);
- GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
/* Tangent layer name. */
BLI_snprintf(attr_name, sizeof(attr_name), "t%s", attr_safe_name);
GPU_vertformat_attr_add(&format, attr_name, comp_type, 4, fetch_mode);
@@ -1959,9 +1959,9 @@ static void extract_tan_ex(const MeshRenderData *mr, GPUVertBuf *vbo, const bool
}
if (use_orco_tan) {
- char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_TANGENT, 0);
- GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
BLI_snprintf(attr_name, sizeof(*attr_name), "t%s", attr_safe_name);
GPU_vertformat_attr_add(&format, attr_name, comp_type, 4, fetch_mode);
GPU_vertformat_alias_add(&format, "t");
@@ -2090,9 +2090,9 @@ static void *extract_vcol_init(const MeshRenderData *mr, void *buf)
for (int i = 0; i < 8; i++) {
if (vcol_layers & (1 << i)) {
- char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPCOL, i);
- GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
BLI_snprintf(attr_name, sizeof(attr_name), "c%s", attr_safe_name);
GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_U16, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
@@ -2164,7 +2164,7 @@ static void *extract_orco_init(const MeshRenderData *mr, void *buf)
static GPUVertFormat format = {0};
if (format.attr_len == 0) {
/* FIXME(fclem): We use the last component as a way to differentiate from generic vertex
- * attribs. This is a substantial waste of Vram and should be done another way.
+ * attributes. This is a substantial waste of Vram and should be done another way.
* Unfortunately, at the time of writing, I did not found any other "non disruptive"
* alternative. */
GPU_vertformat_attr_add(&format, "orco", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
@@ -2192,7 +2192,7 @@ static void extract_orco_loop_bmesh(const MeshRenderData *UNUSED(mr),
MeshExtract_Orco_Data *orco_data = (MeshExtract_Orco_Data *)data;
float *loop_orco = orco_data->vbo_data[l];
copy_v3_v3(loop_orco, orco_data->orco[BM_elem_index_get(loop->v)]);
- loop_orco[3] = 0.0; /* Tag as not a generic attrib */
+ loop_orco[3] = 0.0; /* Tag as not a generic attribute. */
}
static void extract_orco_loop_mesh(const MeshRenderData *UNUSED(mr),
@@ -2205,7 +2205,7 @@ static void extract_orco_loop_mesh(const MeshRenderData *UNUSED(mr),
MeshExtract_Orco_Data *orco_data = (MeshExtract_Orco_Data *)data;
float *loop_orco = orco_data->vbo_data[l];
copy_v3_v3(loop_orco, orco_data->orco[mloop->v]);
- loop_orco[3] = 0.0; /* Tag as not a generic attrib */
+ loop_orco[3] = 0.0; /* Tag as not a generic attribute. */
}
static void extract_orco_finish(const MeshRenderData *UNUSED(mr), void *UNUSED(buf), void *data)
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c
index 3cbcdc1ede6..547a9a54b55 100644
--- a/source/blender/draw/intern/draw_cache_impl_gpencil.c
+++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c
@@ -174,7 +174,8 @@ static GPUVertFormat *gpencil_stroke_format(void)
GPU_vertformat_attr_add(&format, "ma", GPU_COMP_I32, 4, GPU_FETCH_INT);
GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
GPU_vertformat_attr_add(&format, "uv", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
- /* IMPORTANT: This means having only 4 attributes to fit into GPU module limit of 16 attrib. */
+ /* IMPORTANT: This means having only 4 attributes
+ * to fit into GPU module limit of 16 attributes. */
GPU_vertformat_multiload_enable(&format, 4);
}
return &format;
@@ -208,7 +209,8 @@ static GPUVertFormat *gpencil_color_format(void)
if (format.attr_len == 0) {
GPU_vertformat_attr_add(&format, "col", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
GPU_vertformat_attr_add(&format, "fcol", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
- /* IMPORTANT: This means having only 4 attributes to fit into GPU module limit of 16 attrib. */
+ /* IMPORTANT: This means having only 4 attributes
+ * to fit into GPU module limit of 16 attributes. */
GPU_vertformat_multiload_enable(&format, 4);
}
return &format;
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index fb0423a87a6..f6ffb8a1b8d 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -561,7 +561,7 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode)
mesh_batch_cache_discard_uvedit_select(cache);
break;
case BKE_MESH_BATCH_DIRTY_SELECT_PAINT:
- /* Paint mode selection flag is packed inside the nor attrib.
+ /* Paint mode selection flag is packed inside the nor attribute.
* Note that it can be slow if auto smooth is enabled. (see T63946) */
FOREACH_MESH_BUFFER_CACHE (cache, mbufcache) {
GPU_INDEXBUF_DISCARD_SAFE(mbufcache->ibo.lines_paint_mask);
@@ -1173,10 +1173,10 @@ void DRW_mesh_batch_cache_create_requested(
MeshBufferCache *mbufcache = &cache->final;
- /* Init batches and request VBOs & IBOs */
+ /* Initialize batches and request VBO's & IBO's. */
if (DRW_batch_requested(cache->batch.surface, GPU_PRIM_TRIS)) {
DRW_ibo_request(cache->batch.surface, &mbufcache->ibo.tris);
- /* Order matters. First ones override latest vbos' attribs. */
+ /* Order matters. First ones override latest VBO's attributes. */
DRW_vbo_request(cache->batch.surface, &mbufcache->vbo.lnor);
DRW_vbo_request(cache->batch.surface, &mbufcache->vbo.pos_nor);
if (cache->cd_used.uv != 0) {
@@ -1209,7 +1209,7 @@ void DRW_mesh_batch_cache_create_requested(
}
if (DRW_batch_requested(cache->batch.wire_loops, GPU_PRIM_LINES)) {
DRW_ibo_request(cache->batch.wire_loops, &mbufcache->ibo.lines_paint_mask);
- /* Order matters. First ones override latest vbos' attribs. */
+ /* Order matters. First ones override latest VBO's attributes. */
DRW_vbo_request(cache->batch.wire_loops, &mbufcache->vbo.lnor);
DRW_vbo_request(cache->batch.wire_loops, &mbufcache->vbo.pos_nor);
}
@@ -1241,7 +1241,7 @@ void DRW_mesh_batch_cache_create_requested(
else {
DRW_ibo_request(cache->surface_per_mat[i], &mbufcache->ibo.tris);
}
- /* Order matters. First ones override latest vbos' attribs. */
+ /* Order matters. First ones override latest VBO's attributes. */
DRW_vbo_request(cache->surface_per_mat[i], &mbufcache->vbo.lnor);
DRW_vbo_request(cache->surface_per_mat[i], &mbufcache->vbo.pos_nor);
if (cache->cd_used.uv != 0) {
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 42a1dce891d..dca4f8e01e6 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -877,9 +877,9 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit
GPU_vertbuf_data_alloc(cache->proc_uv_buf[i], cache->strands_len);
GPU_vertbuf_attr_get_raw_data(cache->proc_uv_buf[i], uv_id, &uv_step[i]);
- char attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPUV, i);
- GPU_vertformat_safe_attrib_name(name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
int n = 0;
BLI_snprintf(cache->uv_layer_names[i][n++], MAX_LAYER_NAME_LEN, "u%s", attr_safe_name);
@@ -898,9 +898,9 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit
GPU_vertbuf_data_alloc(cache->proc_col_buf[i], cache->strands_len);
GPU_vertbuf_attr_get_raw_data(cache->proc_col_buf[i], col_id, &col_step[i]);
- char attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPCOL, i);
- GPU_vertformat_safe_attrib_name(name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
int n = 0;
BLI_snprintf(cache->col_layer_names[i][n++], MAX_LAYER_NAME_LEN, "c%s", attr_safe_name);
@@ -1164,9 +1164,9 @@ static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit,
for (int i = 0; i < num_uv_layers; i++) {
- char uuid[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char uuid[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPUV, i);
- GPU_vertformat_safe_attrib_name(name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
BLI_snprintf(uuid, sizeof(uuid), "u%s", attr_safe_name);
uv_id[i] = GPU_vertformat_attr_add(&format, uuid, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -1177,9 +1177,9 @@ static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit,
}
for (int i = 0; i < num_col_layers; i++) {
- char uuid[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
+ char uuid[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME];
const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPCOL, i);
- GPU_vertformat_safe_attrib_name(name, attr_safe_name, GPU_MAX_SAFE_ATTRIB_NAME);
+ GPU_vertformat_safe_attr_name(name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME);
BLI_snprintf(uuid, sizeof(uuid), "c%s", attr_safe_name);
col_id[i] = GPU_vertformat_attr_add(&format, uuid, GPU_COMP_U16, 4, GPU_FETCH_FLOAT);
diff --git a/source/blender/draw/intern/draw_hair_private.h b/source/blender/draw/intern/draw_hair_private.h
index 4d9eaf88a7d..b599ad389c1 100644
--- a/source/blender/draw/intern/draw_hair_private.h
+++ b/source/blender/draw/intern/draw_hair_private.h
@@ -25,7 +25,7 @@
#define __DRAW_HAIR_PRIVATE_H__
#define MAX_LAYER_NAME_CT 4 /* u0123456789, u, au, a0123456789 */
-#define MAX_LAYER_NAME_LEN GPU_MAX_SAFE_ATTRIB_NAME + 2
+#define MAX_LAYER_NAME_LEN GPU_MAX_SAFE_ATTR_NAME + 2
#define MAX_THICKRES 2 /* see eHairType */
#define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index df7f0597017..f6d8179b193 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -210,7 +210,7 @@ typedef struct DRWCommandDrawInstance {
GPUBatch *batch;
DRWResourceHandle handle;
uint inst_count;
- uint use_attribs; /* bool */
+ uint use_attrs; /* bool */
} DRWCommandDrawInstance;
typedef struct DRWCommandDrawInstanceRange {
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 1d1ca575b02..fd13e22ff4e 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -657,17 +657,14 @@ static void drw_command_draw_range(
cmd->vert_count = count;
}
-static void drw_command_draw_instance(DRWShadingGroup *shgroup,
- GPUBatch *batch,
- DRWResourceHandle handle,
- uint count,
- bool use_attrib)
+static void drw_command_draw_instance(
+ DRWShadingGroup *shgroup, GPUBatch *batch, DRWResourceHandle handle, uint count, bool use_attr)
{
DRWCommandDrawInstance *cmd = drw_command_create(shgroup, DRW_CMD_DRAW_INSTANCE);
cmd->batch = batch;
cmd->handle = handle;
cmd->inst_count = count;
- cmd->use_attribs = use_attrib;
+ cmd->use_attrs = use_attr;
}
static void drw_command_draw_intance_range(
@@ -841,10 +838,10 @@ void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
drw_command_draw_instance(shgroup, geom, handle, count, false);
}
-void DRW_shgroup_call_instances_with_attribs(DRWShadingGroup *shgroup,
- Object *ob,
- struct GPUBatch *geom,
- struct GPUBatch *inst_attributes)
+void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
+ Object *ob,
+ struct GPUBatch *geom,
+ struct GPUBatch *inst_attributes)
{
BLI_assert(geom != NULL);
BLI_assert(inst_attributes != NULL);
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index 8e712295b61..6c62d4d2405 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -1376,7 +1376,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
0,
0,
cmd->instance.inst_count,
- cmd->instance.use_attribs == 0);
+ cmd->instance.use_attrs == 0);
break;
case DRW_CMD_DRAW_RANGE:
draw_call_single_do(shgroup,
diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl
index 3faefd485bf..1054f4d11c9 100644
--- a/source/blender/draw/intern/shaders/common_view_lib.glsl
+++ b/source/blender/draw/intern/shaders/common_view_lib.glsl
@@ -77,12 +77,12 @@ uniform int resourceChunk;
uniform int baseInstance;
# endif
-# if defined(IN_PLACE_INSTANCES) || defined(INSTANCED_ATTRIB)
+# if defined(IN_PLACE_INSTANCES) || defined(INSTANCED_ATTR)
/* When drawing instances of an object at the same position. */
# define instanceId 0
# elif defined(GPU_DEPRECATED_AMD_DRIVER)
/* A driver bug make it so that when using an attribute with GL_INT_2_10_10_10_REV as format,
- * the gl_InstanceID is incremented by the 2 bit component of the attrib.
+ * the gl_InstanceID is incremented by the 2 bit component of the attribute.
* Ignore gl_InstanceID then. */
# define instanceId 0
# else
@@ -124,7 +124,7 @@ flat in int resourceIDFrag;
/* Breaking this across multiple lines causes issues for some older GLSL compilers. */
/* clang-format off */
-#if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD_DRIVER) && !defined(OS_MAC) && !defined(INSTANCED_ATTRIB)
+#if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD_DRIVER) && !defined(OS_MAC) && !defined(INSTANCED_ATTR)
/* clang-format on */
struct ObjectMatrices {
mat4 drw_modelMatrix;