diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-10 03:02:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-10 03:02:06 +0300 |
commit | 16d7967c2b404cbe6719192e073c7685376f6ab1 (patch) | |
tree | 67cce46fa7b7fafccf7a7ddc9ed450f0afd18e2e /source/blender/draw/intern | |
parent | 66c23ea2b4a4eb66490a8b9b6c57ed60ec934a42 (diff) |
Cleanup: use shorter name for shader config
The struct name is descriptive,
this isn't going to be confused with other variables.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 74 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 120 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 34 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_shader.c | 4 |
6 files changed, 119 insertions, 119 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index fbd5b4d8f31..6b636bfc018 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -578,7 +578,7 @@ typedef struct DRWContextState { eObjectMode object_mode; - eGPUShaderConfig shader_cfg; + eGPUShaderConfig sh_cfg; /** Last resort (some functions take this as an arg so we can't easily avoid). * May be NULL when used for selection or depth buffer. */ diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index e062948ccec..0210e010c31 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -118,17 +118,17 @@ static struct { static void drw_shgroup_bone_octahedral( const float (*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], - const eGPUShaderConfig shader_cfg) + const eGPUShaderConfig sh_cfg) { if (g_data.bone_octahedral_outline == NULL) { struct GPUBatch *geom = DRW_cache_bone_octahedral_wire_get(); g_data.bone_octahedral_outline = shgroup_instance_bone_shape_outline( - g_data.passes.bone_outline, geom, shader_cfg); + g_data.passes.bone_outline, geom, sh_cfg); } if (g_data.bone_octahedral_solid == NULL) { struct GPUBatch *geom = DRW_cache_bone_octahedral_get(); g_data.bone_octahedral_solid = shgroup_instance_bone_shape_solid( - g_data.passes.bone_solid, geom, g_data.transparent, shader_cfg); + g_data.passes.bone_solid, geom, g_data.transparent, sh_cfg); } float final_bonemat[4][4]; mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat); @@ -142,17 +142,17 @@ static void drw_shgroup_bone_octahedral( static void drw_shgroup_bone_box( const float (*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], - const eGPUShaderConfig shader_cfg) + const eGPUShaderConfig sh_cfg) { if (g_data.bone_box_wire == NULL) { struct GPUBatch *geom = DRW_cache_bone_box_wire_get(); g_data.bone_box_outline = shgroup_instance_bone_shape_outline( - g_data.passes.bone_outline, geom, shader_cfg); + g_data.passes.bone_outline, geom, sh_cfg); } if (g_data.bone_box_solid == NULL) { struct GPUBatch *geom = DRW_cache_bone_box_get(); g_data.bone_box_solid = shgroup_instance_bone_shape_solid( - g_data.passes.bone_solid, geom, g_data.transparent, shader_cfg); + g_data.passes.bone_solid, geom, g_data.transparent, sh_cfg); } float final_bonemat[4][4]; mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat); @@ -165,10 +165,10 @@ static void drw_shgroup_bone_box( /* Wire */ static void drw_shgroup_bone_wire( const float (*bone_mat)[4], const float color[4], - const eGPUShaderConfig shader_cfg) + const eGPUShaderConfig sh_cfg) { if (g_data.bone_wire == NULL) { - g_data.bone_wire = shgroup_dynlines_flat_color(g_data.passes.bone_wire, shader_cfg); + g_data.bone_wire = shgroup_dynlines_flat_color(g_data.passes.bone_wire, sh_cfg); } float head[3], tail[3]; mul_v3_m4v3(head, g_data.ob->obmat, bone_mat[3]); @@ -183,10 +183,10 @@ static void drw_shgroup_bone_wire( static void drw_shgroup_bone_stick( const float (*bone_mat)[4], const float col_wire[4], const float col_bone[4], const float col_head[4], const float col_tail[4], - const eGPUShaderConfig shader_cfg) + const eGPUShaderConfig sh_cfg) { if (g_data.bone_stick == NULL) { - g_data.bone_stick = shgroup_instance_bone_stick(g_data.passes.bone_wire, shader_cfg); + g_data.bone_stick = shgroup_instance_bone_stick(g_data.passes.bone_wire, sh_cfg); } float final_bonemat[4][4], tail[4]; mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat); @@ -313,7 +313,7 @@ extern void drw_batch_cache_generate_requested(Object *custom); static void drw_shgroup_bone_custom_solid( const float (*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], - const eGPUShaderConfig shader_cfg, Object *custom) + const eGPUShaderConfig sh_cfg, Object *custom) { /* grr, not re-using instances! */ struct GPUBatch *surf = DRW_cache_object_surface_get(custom); @@ -330,13 +330,13 @@ static void drw_shgroup_bone_custom_solid( if (surf) { DRWShadingGroup *shgrp_geom_solid = shgroup_instance_bone_shape_solid( - g_data.passes.bone_solid, surf, g_data.transparent, shader_cfg); + g_data.passes.bone_solid, surf, g_data.transparent, sh_cfg); DRW_shgroup_call_dynamic_add(shgrp_geom_solid, final_bonemat, bone_color, hint_color); } if (edges && outline_color[3] > 0.0f) { DRWShadingGroup *shgrp_geom_wire = shgroup_instance_bone_shape_outline( - g_data.passes.bone_outline, edges, shader_cfg); + g_data.passes.bone_outline, edges, sh_cfg); DRW_shgroup_call_dynamic_add(shgrp_geom_wire, final_bonemat, outline_color); } @@ -1257,7 +1257,7 @@ static void draw_points( static void draw_bone_custom_shape( EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, - const eGPUShaderConfig shader_cfg, const int select_id) + const eGPUShaderConfig sh_cfg, const int select_id) { const float *col_solid = get_bone_solid_color(eBone, pchan, arm, boneflag, constflag); const float *col_wire = get_bone_wire_color(eBone, pchan, arm, boneflag, constflag); @@ -1269,7 +1269,7 @@ static void draw_bone_custom_shape( } if ((boneflag & BONE_DRAWWIRE) == 0) { - drw_shgroup_bone_custom_solid(disp_mat, col_solid, col_hint, col_wire, shader_cfg, pchan->custom); + drw_shgroup_bone_custom_solid(disp_mat, col_solid, col_hint, col_wire, sh_cfg, pchan->custom); } else { drw_shgroup_bone_custom_wire(disp_mat, col_wire, pchan->custom); @@ -1326,7 +1326,7 @@ static void draw_bone_envelope( static void draw_bone_line( EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, - const eGPUShaderConfig shader_cfg, const int select_id) + const eGPUShaderConfig sh_cfg, const int select_id) { const float *col_bone = get_bone_solid_with_consts_color(eBone, pchan, arm, boneflag, constflag); const float *col_wire = get_bone_wire_color(eBone, pchan, arm, boneflag, constflag); @@ -1364,20 +1364,20 @@ static void draw_bone_line( if (select_id == -1) { /* Not in selection mode, draw everything at once. */ - drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, col_bone, col_head, col_tail, shader_cfg); + drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, col_bone, col_head, col_tail, sh_cfg); } else { /* In selection mode, draw bone, root and tip separately. */ DRW_select_load_id(select_id | BONESEL_BONE); - drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, col_bone, no_display, no_display, shader_cfg); + drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, col_bone, no_display, no_display, sh_cfg); if (col_head[3] > 0.0f) { DRW_select_load_id(select_id | BONESEL_ROOT); - drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, no_display, col_head, no_display, shader_cfg); + drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, no_display, col_head, no_display, sh_cfg); } DRW_select_load_id(select_id | BONESEL_TIP); - drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, no_display, no_display, col_tail, shader_cfg); + drw_shgroup_bone_stick(BONE_VAR(eBone, pchan, disp_mat), col_wire, no_display, no_display, col_tail, sh_cfg); DRW_select_load_id(-1); } @@ -1386,7 +1386,7 @@ static void draw_bone_line( static void draw_bone_wire( EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, - const eGPUShaderConfig shader_cfg, const int select_id) + const eGPUShaderConfig sh_cfg, const int select_id) { const float *col_wire = get_bone_wire_color(eBone, pchan, arm, boneflag, constflag); @@ -1399,12 +1399,12 @@ static void draw_bone_wire( BLI_assert(bbones_mat != NULL); for (int i = pchan->bone->segments; i--; bbones_mat++) { - drw_shgroup_bone_wire(bbones_mat->mat, col_wire, shader_cfg); + drw_shgroup_bone_wire(bbones_mat->mat, col_wire, sh_cfg); } } else if (eBone) { for (int i = 0; i < eBone->segments; i++) { - drw_shgroup_bone_wire(eBone->disp_bbone_mat[i], col_wire, shader_cfg); + drw_shgroup_bone_wire(eBone->disp_bbone_mat[i], col_wire, sh_cfg); } } @@ -1420,7 +1420,7 @@ static void draw_bone_wire( static void draw_bone_box( EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, - const eGPUShaderConfig shader_cfg, const int select_id) + const eGPUShaderConfig sh_cfg, const int select_id) { const float *col_solid = get_bone_solid_with_consts_color(eBone, pchan, arm, boneflag, constflag); const float *col_wire = get_bone_wire_color(eBone, pchan, arm, boneflag, constflag); @@ -1435,12 +1435,12 @@ static void draw_bone_box( BLI_assert(bbones_mat != NULL); for (int i = pchan->bone->segments; i--; bbones_mat++) { - drw_shgroup_bone_box(bbones_mat->mat, col_solid, col_hint, col_wire, shader_cfg); + drw_shgroup_bone_box(bbones_mat->mat, col_solid, col_hint, col_wire, sh_cfg); } } else if (eBone) { for (int i = 0; i < eBone->segments; i++) { - drw_shgroup_bone_box(eBone->disp_bbone_mat[i], col_solid, col_hint, col_wire, shader_cfg); + drw_shgroup_bone_box(eBone->disp_bbone_mat[i], col_solid, col_hint, col_wire, sh_cfg); } } @@ -1456,7 +1456,7 @@ static void draw_bone_box( static void draw_bone_octahedral( EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, - const eGPUShaderConfig shader_cfg, const int select_id) + const eGPUShaderConfig sh_cfg, const int select_id) { const float *col_solid = get_bone_solid_with_consts_color(eBone, pchan, arm, boneflag, constflag); const float *col_wire = get_bone_wire_color(eBone, pchan, arm, boneflag, constflag); @@ -1466,7 +1466,7 @@ static void draw_bone_octahedral( DRW_select_load_id(select_id | BONESEL_BONE); } - drw_shgroup_bone_octahedral(BONE_VAR(eBone, pchan, disp_mat), col_solid, col_hint, col_wire, shader_cfg); + drw_shgroup_bone_octahedral(BONE_VAR(eBone, pchan, disp_mat), col_solid, col_hint, col_wire, sh_cfg); if (select_id != -1) { DRW_select_load_id(-1); @@ -1720,19 +1720,19 @@ static void draw_armature_edit(Object *ob) } else if (arm->drawtype == ARM_LINE) { draw_bone_update_disp_matrix_default(eBone, NULL); - draw_bone_line(eBone, NULL, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_line(eBone, NULL, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else if (arm->drawtype == ARM_WIRE) { draw_bone_update_disp_matrix_bbone(eBone, NULL); - draw_bone_wire(eBone, NULL, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_wire(eBone, NULL, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else if (arm->drawtype == ARM_B_BONE) { draw_bone_update_disp_matrix_bbone(eBone, NULL); - draw_bone_box(eBone, NULL, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_box(eBone, NULL, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else { draw_bone_update_disp_matrix_default(eBone, NULL); - draw_bone_octahedral(eBone, NULL, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_octahedral(eBone, NULL, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } /* Draw names of bone */ @@ -1827,7 +1827,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) { draw_bone_update_disp_matrix_custom(pchan); - draw_bone_custom_shape(NULL, pchan, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_custom_shape(NULL, pchan, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else if (arm->drawtype == ARM_ENVELOPE) { draw_bone_update_disp_matrix_default(NULL, pchan); @@ -1835,19 +1835,19 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) } else if (arm->drawtype == ARM_LINE) { draw_bone_update_disp_matrix_default(NULL, pchan); - draw_bone_line(NULL, pchan, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_line(NULL, pchan, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else if (arm->drawtype == ARM_WIRE) { draw_bone_update_disp_matrix_bbone(NULL, pchan); - draw_bone_wire(NULL, pchan, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_wire(NULL, pchan, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else if (arm->drawtype == ARM_B_BONE) { draw_bone_update_disp_matrix_bbone(NULL, pchan); - draw_bone_box(NULL, pchan, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_box(NULL, pchan, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } else { draw_bone_update_disp_matrix_default(NULL, pchan); - draw_bone_octahedral(NULL, pchan, arm, boneflag, constflag, draw_ctx->shader_cfg, select_id); + draw_bone_octahedral(NULL, pchan, arm, boneflag, constflag, draw_ctx->sh_cfg, select_id); } if (!is_pose_select && show_relations && diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 819e895ed21..e222a6bba25 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -305,9 +305,9 @@ void DRW_shgroup_world_clip_planes_from_rv3d(DRWShadingGroup *shgrp, const Regio DRW_shgroup_state_enable(shgrp, DRW_STATE_CLIP_PLANES); } -DRWShadingGroup *shgroup_dynlines_flat_color(DRWPass *pass, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_dynlines_flat_color(DRWPass *pass, eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_FLAT_COLOR, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_FLAT_COLOR, sh_cfg); DRW_shgroup_instance_format(g_formats.dynlines_color, { {"pos", DRW_ATTR_FLOAT, 3}, @@ -315,7 +315,7 @@ DRWShadingGroup *shgroup_dynlines_flat_color(DRWPass *pass, eGPUShaderConfig sha }); DRWShadingGroup *grp = DRW_shgroup_line_batch_create_with_format(sh, pass, g_formats.dynlines_color); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -338,49 +338,49 @@ DRWShadingGroup *shgroup_dynlines_dashed_uniform_color(DRWPass *pass, const floa } DRWShadingGroup *shgroup_dynpoints_uniform_color( - DRWPass *pass, const float color[4], const float *size, eGPUShaderConfig shader_cfg) + DRWPass *pass, const float color[4], const float *size, eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA, sh_cfg); DRWShadingGroup *grp = DRW_shgroup_point_batch_create(sh, pass); DRW_shgroup_uniform_vec4(grp, "color", color, 1); DRW_shgroup_uniform_float(grp, "size", size, 1); DRW_shgroup_state_enable(grp, DRW_STATE_POINT); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_groundlines_uniform_color(DRWPass *pass, const float color[4], eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_groundlines_uniform_color(DRWPass *pass, const float color[4], eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_GROUNDLINE, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_GROUNDLINE, sh_cfg); DRWShadingGroup *grp = DRW_shgroup_point_batch_create(sh, pass); DRW_shgroup_uniform_vec4(grp, "color", color, 1); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_groundpoints_uniform_color(DRWPass *pass, const float color[4], eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_groundpoints_uniform_color(DRWPass *pass, const float color[4], eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_GROUNDPOINT, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_GROUNDPOINT, sh_cfg); DRWShadingGroup *grp = DRW_shgroup_point_batch_create(sh, pass); DRW_shgroup_uniform_vec4(grp, "color", color, 1); DRW_shgroup_state_enable(grp, DRW_STATE_POINT); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } DRWShadingGroup *shgroup_instance_screenspace( - DRWPass *pass, struct GPUBatch *geom, const float *size, eGPUShaderConfig shader_cfg) + DRWPass *pass, struct GPUBatch *geom, const float *size, eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_SCREENSPACE_VARIYING_COLOR, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_SCREENSPACE_VARIYING_COLOR, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_screenspace, { {"world_pos", DRW_ATTR_FLOAT, 3}, @@ -391,7 +391,7 @@ DRWShadingGroup *shgroup_instance_screenspace( DRW_shgroup_uniform_float(grp, "size", size, 1); DRW_shgroup_uniform_float(grp, "pixel_size", DRW_viewport_pixelsize_get(), 1); DRW_shgroup_uniform_vec3(grp, "screen_vecs[0]", DRW_viewport_screenvecs_get(), 2); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -428,9 +428,9 @@ DRWShadingGroup *shgroup_instance_wire(DRWPass *pass, struct GPUBatch *geom) } DRWShadingGroup *shgroup_instance_screen_aligned( - DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) + DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_INSTANCE_SCREEN_ALIGNED, shader_cfg); + GPUShader *sh = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_INSTANCE_SCREEN_ALIGNED, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_screen_aligned, { {"color", DRW_ATTR_FLOAT, 3}, @@ -440,15 +440,15 @@ DRWShadingGroup *shgroup_instance_screen_aligned( DRWShadingGroup *grp = DRW_shgroup_instance_create(sh, pass, geom, g_formats.instance_screen_aligned); DRW_shgroup_uniform_vec3(grp, "screen_vecs[0]", DRW_viewport_screenvecs_get(), 2); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_instance_scaled(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance_scaled(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SCALE, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SCALE, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_scaled, { {"color", DRW_ATTR_FLOAT, 3}, @@ -457,15 +457,15 @@ DRWShadingGroup *shgroup_instance_scaled(DRWPass *pass, struct GPUBatch *geom, e }); DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_inst, pass, geom, g_formats.instance_scaled); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_sized, { {"color", DRW_ATTR_FLOAT, 4}, @@ -475,15 +475,15 @@ DRWShadingGroup *shgroup_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShad DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_inst, pass, geom, g_formats.instance_sized); DRW_shgroup_state_disable(grp, DRW_STATE_BLEND); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_instance_alpha(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance_alpha(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_sized, { {"color", DRW_ATTR_FLOAT, 4}, @@ -492,17 +492,17 @@ DRWShadingGroup *shgroup_instance_alpha(DRWPass *pass, struct GPUBatch *geom, eG }); DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_inst, pass, geom, g_formats.instance_sized); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_instance_empty_axes(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance_empty_axes(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - COMMON_Shaders *sh_data = &g_shaders[shader_cfg]; - const char *world_clip_lib_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; - const char *world_clip_def_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; + COMMON_Shaders *sh_data = &g_shaders[sh_cfg]; + const char *world_clip_lib_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; + const char *world_clip_def_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; if (sh_data->empty_axes_sh == NULL) { sh_data->empty_axes_sh = GPU_shader_create_from_arrays({ .vert = (const char *[]){world_clip_lib_or_empty, datatoc_object_empty_axes_vert_glsl, NULL}, @@ -519,7 +519,7 @@ DRWShadingGroup *shgroup_instance_empty_axes(DRWPass *pass, struct GPUBatch *geo DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_data->empty_axes_sh, pass, geom, g_formats.instance_sized); DRW_shgroup_uniform_vec3(grp, "screenVecs[0]", DRW_viewport_screenvecs_get(), 2); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -541,9 +541,9 @@ DRWShadingGroup *shgroup_instance_outline(DRWPass *pass, struct GPUBatch *geom, return grp; } -DRWShadingGroup *shgroup_camera_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_camera_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_CAMERA, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_CAMERA, sh_cfg); DRW_shgroup_instance_format(g_formats.instance_camera, { {"color", DRW_ATTR_FLOAT, 3}, @@ -554,15 +554,15 @@ DRWShadingGroup *shgroup_camera_instance(DRWPass *pass, struct GPUBatch *geom, e }); DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_inst, pass, geom, g_formats.instance_camera); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_distance_lines_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_distance_lines_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_DISTANCE_LINES, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_DISTANCE_LINES, sh_cfg); static float point_size = 4.0f; DRW_shgroup_instance_format(g_formats.instance_distance_lines, { @@ -574,15 +574,15 @@ DRWShadingGroup *shgroup_distance_lines_instance(DRWPass *pass, struct GPUBatch DRWShadingGroup *grp = DRW_shgroup_instance_create(sh_inst, pass, geom, g_formats.instance_distance_lines); DRW_shgroup_uniform_float(grp, "size", &point_size, 1); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } -DRWShadingGroup *shgroup_spot_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_spot_instance(DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_EDGES_VARIYING_COLOR, shader_cfg); + GPUShader *sh_inst = GPU_shader_get_builtin_shader_with_config(GPU_SHADER_INSTANCE_EDGES_VARIYING_COLOR, sh_cfg); static const int True = true; static const int False = false; @@ -595,7 +595,7 @@ DRWShadingGroup *shgroup_spot_instance(DRWPass *pass, struct GPUBatch *geom, eGP DRW_shgroup_uniform_bool(grp, "drawFront", &False, 1); DRW_shgroup_uniform_bool(grp, "drawBack", &False, 1); DRW_shgroup_uniform_bool(grp, "drawSilhouette", &True, 1); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -698,11 +698,11 @@ DRWShadingGroup *shgroup_instance_bone_envelope_solid(DRWPass *pass, bool transp return grp; } -DRWShadingGroup *shgroup_instance_mball_handles(DRWPass *pass, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance_mball_handles(DRWPass *pass, eGPUShaderConfig sh_cfg) { - COMMON_Shaders *sh_data = &g_shaders[shader_cfg]; + COMMON_Shaders *sh_data = &g_shaders[sh_cfg]; if (sh_data->mball_handles == NULL) { - bool is_clip = (shader_cfg == GPU_SHADER_CFG_CLIPPED); + bool is_clip = (sh_cfg == GPU_SHADER_CFG_CLIPPED); const char *world_clip_lib_or_empty = is_clip ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; const char *world_clip_def_or_empty = is_clip ? "#define USE_WORLD_CLIP_PLANES\n" : ""; sh_data->mball_handles = GPU_shader_create_from_arrays({ @@ -723,7 +723,7 @@ DRWShadingGroup *shgroup_instance_mball_handles(DRWPass *pass, eGPUShaderConfig DRW_cache_screenspace_circle_get(), g_formats.instance_mball_handles); DRW_shgroup_uniform_vec3(grp, "screen_vecs[0]", DRW_viewport_screenvecs_get(), 2); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -731,12 +731,12 @@ DRWShadingGroup *shgroup_instance_mball_handles(DRWPass *pass, eGPUShaderConfig /* Only works with batches with adjacency infos. */ DRWShadingGroup *shgroup_instance_bone_shape_outline( - DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg) + DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg) { - COMMON_Shaders *sh_data = &g_shaders[shader_cfg]; + COMMON_Shaders *sh_data = &g_shaders[sh_cfg]; if (sh_data->shape_outline == NULL) { - const char *world_clip_lib_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; - const char *world_clip_def_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; + const char *world_clip_lib_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; + const char *world_clip_def_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; sh_data->shape_outline = GPU_shader_create_from_arrays({ .vert = (const char *[]){world_clip_lib_or_empty, datatoc_armature_shape_outline_vert_glsl, NULL}, .geom = (const char *[]){world_clip_lib_or_empty, datatoc_armature_shape_outline_geom_glsl, NULL}, @@ -754,19 +754,19 @@ DRWShadingGroup *shgroup_instance_bone_shape_outline( sh_data->shape_outline, pass, geom, g_formats.instance_bone_outline); DRW_shgroup_uniform_vec2(grp, "viewportSize", DRW_viewport_size_get(), 1); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; } DRWShadingGroup *shgroup_instance_bone_shape_solid( - DRWPass *pass, struct GPUBatch *geom, bool transp, eGPUShaderConfig shader_cfg) + DRWPass *pass, struct GPUBatch *geom, bool transp, eGPUShaderConfig sh_cfg) { - COMMON_Shaders *sh_data = &g_shaders[shader_cfg]; + COMMON_Shaders *sh_data = &g_shaders[sh_cfg]; if (sh_data->shape_solid == NULL) { - const char *world_clip_lib_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; - const char *world_clip_def_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; + const char *world_clip_lib_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; + const char *world_clip_def_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; sh_data->shape_solid = GPU_shader_create_from_arrays({ .vert = (const char *[]){world_clip_lib_or_empty, datatoc_armature_shape_solid_vert_glsl, NULL}, .frag = (const char *[]){datatoc_armature_shape_solid_frag_glsl, NULL}, @@ -784,7 +784,7 @@ DRWShadingGroup *shgroup_instance_bone_shape_solid( sh_data->shape_solid, pass, geom, g_formats.instance_bone); DRW_shgroup_uniform_float_copy(grp, "alpha", transp ? 0.6f : 1.0f); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; @@ -837,12 +837,12 @@ DRWShadingGroup *shgroup_instance_bone_sphere_outline(DRWPass *pass) return grp; } -DRWShadingGroup *shgroup_instance_bone_stick(DRWPass *pass, eGPUShaderConfig shader_cfg) +DRWShadingGroup *shgroup_instance_bone_stick(DRWPass *pass, eGPUShaderConfig sh_cfg) { - COMMON_Shaders *sh_data = &g_shaders[shader_cfg]; + COMMON_Shaders *sh_data = &g_shaders[sh_cfg]; if (sh_data->bone_stick == NULL) { - const char *world_clip_lib_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; - const char *world_clip_def_or_empty = (shader_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; + const char *world_clip_lib_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? datatoc_gpu_shader_cfg_world_clip_lib_glsl : ""; + const char *world_clip_def_or_empty = (sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "#define USE_WORLD_CLIP_PLANES\n" : ""; sh_data->bone_stick = GPU_shader_create_from_arrays({ .vert = (const char *[]){world_clip_lib_or_empty, datatoc_armature_stick_vert_glsl, NULL}, .frag = (const char *[]){datatoc_armature_stick_frag_glsl, NULL}, @@ -865,7 +865,7 @@ DRWShadingGroup *shgroup_instance_bone_stick(DRWPass *pass, eGPUShaderConfig sha g_formats.instance_bone_stick); DRW_shgroup_uniform_vec2(grp, "viewportSize", DRW_viewport_size_get(), 1); DRW_shgroup_uniform_float_copy(grp, "stickSize", 5.0f * U.pixelsize); - if (shader_cfg == GPU_SHADER_CFG_CLIPPED) { + if (sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d); } return grp; diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 2caf4974482..426cde52654 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -123,33 +123,33 @@ void DRW_globals_free(void); void DRW_shgroup_world_clip_planes_from_rv3d(struct DRWShadingGroup *shgrp, const RegionView3D *rv3d); -struct DRWShadingGroup *shgroup_dynlines_flat_color(struct DRWPass *pass, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_dynlines_flat_color(struct DRWPass *pass, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_dynlines_dashed_uniform_color(struct DRWPass *pass, const float color[4]); -struct DRWShadingGroup *shgroup_dynpoints_uniform_color(struct DRWPass *pass, const float color[4], const float *size, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_groundlines_uniform_color(struct DRWPass *pass, const float color[4], eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_groundpoints_uniform_color(struct DRWPass *pass, const float color[4], eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_screenspace(struct DRWPass *pass, struct GPUBatch *geom, const float *size, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_dynpoints_uniform_color(struct DRWPass *pass, const float color[4], const float *size, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_groundlines_uniform_color(struct DRWPass *pass, const float color[4], eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_groundpoints_uniform_color(struct DRWPass *pass, const float color[4], eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_screenspace(struct DRWPass *pass, struct GPUBatch *geom, const float *size, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_instance_solid(struct DRWPass *pass, struct GPUBatch *geom); struct DRWShadingGroup *shgroup_instance_wire(struct DRWPass *pass, struct GPUBatch *geom); -struct DRWShadingGroup *shgroup_instance_screen_aligned(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_empty_axes(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_scaled(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_alpha(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_instance_screen_aligned(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_empty_axes(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_scaled(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_alpha(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_instance_outline(struct DRWPass *pass, struct GPUBatch *geom, int *baseid); -struct DRWShadingGroup *shgroup_camera_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_distance_lines_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_spot_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_mball_handles(struct DRWPass *pass, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_camera_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_distance_lines_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_spot_instance(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_mball_handles(struct DRWPass *pass, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_instance_bone_axes(struct DRWPass *pass); struct DRWShadingGroup *shgroup_instance_bone_envelope_distance(struct DRWPass *pass); struct DRWShadingGroup *shgroup_instance_bone_envelope_outline(struct DRWPass *pass); struct DRWShadingGroup *shgroup_instance_bone_envelope_solid(struct DRWPass *pass, bool transp); -struct DRWShadingGroup *shgroup_instance_bone_shape_outline(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig shader_cfg); -struct DRWShadingGroup *shgroup_instance_bone_shape_solid(struct DRWPass *pass, struct GPUBatch *geom, bool transp, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_instance_bone_shape_outline(struct DRWPass *pass, struct GPUBatch *geom, eGPUShaderConfig sh_cfg); +struct DRWShadingGroup *shgroup_instance_bone_shape_solid(struct DRWPass *pass, struct GPUBatch *geom, bool transp, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_instance_bone_sphere_outline(struct DRWPass *pass); struct DRWShadingGroup *shgroup_instance_bone_sphere_solid(struct DRWPass *pass, bool transp); -struct DRWShadingGroup *shgroup_instance_bone_stick(struct DRWPass *pass, eGPUShaderConfig shader_cfg); +struct DRWShadingGroup *shgroup_instance_bone_stick(struct DRWPass *pass, eGPUShaderConfig sh_cfg); struct DRWShadingGroup *shgroup_instance_bone_dof(struct DRWPass *pass, struct GPUBatch *geom); struct GPUShader *mpath_line_shader_get(void); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 29fbe9a862b..bd43a35bd47 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -536,9 +536,9 @@ static void drw_context_state_init(void) DST.draw_ctx.object_pose = NULL; } - DST.draw_ctx.shader_cfg = GPU_SHADER_CFG_DEFAULT; + DST.draw_ctx.sh_cfg = GPU_SHADER_CFG_DEFAULT; if (DST.draw_ctx.rv3d && DST.draw_ctx.rv3d->rflag & RV3D_CLIPPING) { - DST.draw_ctx.shader_cfg = GPU_SHADER_CFG_CLIPPED; + DST.draw_ctx.sh_cfg = GPU_SHADER_CFG_CLIPPED; } } diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index 93aab9c0629..2c83316d1fa 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -311,9 +311,9 @@ GPUShader *DRW_shader_create_fullscreen(const char *frag, const char *defines) return GPU_shader_create(datatoc_common_fullscreen_vert_glsl, frag, NULL, NULL, defines, __func__); } -GPUShader *DRW_shader_create_3D_depth_only(eGPUShaderConfig shader_cfg) +GPUShader *DRW_shader_create_3D_depth_only(eGPUShaderConfig sh_cfg) { - return GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_DEPTH_ONLY, shader_cfg); + return GPU_shader_get_builtin_shader_with_config(GPU_SHADER_3D_DEPTH_ONLY, sh_cfg); } GPUMaterial *DRW_shader_find_from_world(World *wo, const void *engine_type, int options, bool deferred) |