Cleanup: compare to GPU_SHADER_CFG_CLIPPED when checking configurations

Don't assume a non-zero eGPUShaderConfig is clipped, as this would cause
unexpected behavior if other configurations are added.
This commit is contained in:
Campbell Barton 2023-01-16 10:21:32 +11:00
parent e1aef2e87e
commit 6d07b459f2
1 changed files with 122 additions and 82 deletions

View File

@ -146,7 +146,8 @@ GPUShader *OVERLAY_shader_depth_only(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->depth_only) {
sh_data->depth_only = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_depth_only_clipped" : "overlay_depth_only");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_depth_only_clipped" :
"overlay_depth_only");
}
return sh_data->depth_only;
}
@ -157,7 +158,8 @@ GPUShader *OVERLAY_shader_edit_mesh_vert(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_vert) {
sh_data->edit_mesh_vert = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_vert_clipped" : "overlay_edit_mesh_vert");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_vert_clipped" :
"overlay_edit_mesh_vert");
}
return sh_data->edit_mesh_vert;
}
@ -169,7 +171,7 @@ GPUShader *OVERLAY_shader_edit_mesh_edge(bool use_flat_interp)
GPUShader **sh = use_flat_interp ? &sh_data->edit_mesh_edge_flat : &sh_data->edit_mesh_edge;
if (*sh == nullptr) {
*sh = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ?
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
(use_flat_interp ? "overlay_edit_mesh_edge_flat_clipped" :
"overlay_edit_mesh_edge_clipped") :
(use_flat_interp ? "overlay_edit_mesh_edge_flat" : "overlay_edit_mesh_edge"));
@ -183,13 +185,13 @@ GPUShader *OVERLAY_shader_armature_sphere(bool use_outline)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (use_outline && !sh_data->armature_sphere_outline) {
sh_data->armature_sphere_outline = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_sphere_outline_clipped" :
"overlay_armature_sphere_outline");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_sphere_outline_clipped" :
"overlay_armature_sphere_outline");
}
else if (!sh_data->armature_sphere_solid) {
sh_data->armature_sphere_solid = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_sphere_solid_clipped" :
"overlay_armature_sphere_solid");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_sphere_solid_clipped" :
"overlay_armature_sphere_solid");
}
return use_outline ? sh_data->armature_sphere_outline : sh_data->armature_sphere_solid;
}
@ -200,13 +202,13 @@ GPUShader *OVERLAY_shader_armature_shape(bool use_outline)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (use_outline && !sh_data->armature_shape_outline) {
sh_data->armature_shape_outline = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_shape_outline_clipped" :
"overlay_armature_shape_outline");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_shape_outline_clipped" :
"overlay_armature_shape_outline");
}
else if (!sh_data->armature_shape_solid) {
sh_data->armature_shape_solid = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_shape_solid_clipped" :
"overlay_armature_shape_solid");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_shape_solid_clipped" :
"overlay_armature_shape_solid");
}
return use_outline ? sh_data->armature_shape_outline : sh_data->armature_shape_solid;
}
@ -217,7 +219,8 @@ GPUShader *OVERLAY_shader_armature_shape_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->armature_shape_wire) {
sh_data->armature_shape_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_shape_wire_clipped" : "overlay_armature_shape_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_shape_wire_clipped" :
"overlay_armature_shape_wire");
}
return sh_data->armature_shape_wire;
}
@ -228,13 +231,14 @@ GPUShader *OVERLAY_shader_armature_envelope(bool use_outline)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (use_outline && !sh_data->armature_envelope_outline) {
sh_data->armature_envelope_outline = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_envelope_outline_clipped" :
"overlay_armature_envelope_outline");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
"overlay_armature_envelope_outline_clipped" :
"overlay_armature_envelope_outline");
}
else if (!sh_data->armature_envelope_solid) {
sh_data->armature_envelope_solid = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_envelope_solid_clipped" :
"overlay_armature_envelope_solid");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_envelope_solid_clipped" :
"overlay_armature_envelope_solid");
}
return use_outline ? sh_data->armature_envelope_outline : sh_data->armature_envelope_solid;
}
@ -245,7 +249,8 @@ GPUShader *OVERLAY_shader_armature_stick(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->armature_stick) {
sh_data->armature_stick = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_stick_clipped" : "overlay_armature_stick");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_stick_clipped" :
"overlay_armature_stick");
}
return sh_data->armature_stick;
}
@ -256,7 +261,8 @@ GPUShader *OVERLAY_shader_armature_degrees_of_freedom_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->armature_dof_wire) {
sh_data->armature_dof_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_dof_wire_clipped" : "overlay_armature_dof_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_dof_wire_clipped" :
"overlay_armature_dof_wire");
}
return sh_data->armature_dof_wire;
}
@ -267,7 +273,8 @@ GPUShader *OVERLAY_shader_armature_degrees_of_freedom_solid(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->armature_dof_solid) {
sh_data->armature_dof_solid = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_dof_solid_clipped" : "overlay_armature_dof_solid");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_dof_solid_clipped" :
"overlay_armature_dof_solid");
}
return sh_data->armature_dof_solid;
}
@ -278,7 +285,8 @@ GPUShader *OVERLAY_shader_armature_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->armature_wire) {
sh_data->armature_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_armature_wire_clipped" : "overlay_armature_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_armature_wire_clipped" :
"overlay_armature_wire");
}
return sh_data->armature_wire;
}
@ -289,7 +297,8 @@ GPUShader *OVERLAY_shader_edit_curve_handle(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_curve_handle) {
sh_data->edit_curve_handle = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_curve_handle_clipped" : "overlay_edit_curve_handle");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_curve_handle_clipped" :
"overlay_edit_curve_handle");
}
return sh_data->edit_curve_handle;
}
@ -300,7 +309,8 @@ GPUShader *OVERLAY_shader_edit_curve_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_curve_point) {
sh_data->edit_curve_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_curve_point_clipped" : "overlay_edit_curve_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_curve_point_clipped" :
"overlay_edit_curve_point");
}
return sh_data->edit_curve_point;
}
@ -311,7 +321,8 @@ GPUShader *OVERLAY_shader_edit_curve_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_curve_wire) {
sh_data->edit_curve_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_curve_wire_clipped" : "overlay_edit_curve_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_curve_wire_clipped" :
"overlay_edit_curve_wire");
}
return sh_data->edit_curve_wire;
}
@ -322,8 +333,8 @@ GPUShader *OVERLAY_shader_edit_gpencil_guide_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_gpencil_guide_point) {
sh_data->edit_gpencil_guide_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_gpencil_guide_point_clipped" :
"overlay_edit_gpencil_guide_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_gpencil_guide_point_clipped" :
"overlay_edit_gpencil_guide_point");
}
return sh_data->edit_gpencil_guide_point;
}
@ -334,7 +345,8 @@ GPUShader *OVERLAY_shader_edit_gpencil_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_gpencil_point) {
sh_data->edit_gpencil_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_gpencil_point_clipped" : "overlay_edit_gpencil_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_gpencil_point_clipped" :
"overlay_edit_gpencil_point");
}
return sh_data->edit_gpencil_point;
}
@ -345,7 +357,8 @@ GPUShader *OVERLAY_shader_edit_gpencil_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_gpencil_wire) {
sh_data->edit_gpencil_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_gpencil_wire_clipped" : "overlay_edit_gpencil_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_gpencil_wire_clipped" :
"overlay_edit_gpencil_wire");
}
return sh_data->edit_gpencil_wire;
}
@ -356,7 +369,8 @@ GPUShader *OVERLAY_shader_edit_lattice_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_lattice_point) {
sh_data->edit_lattice_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_lattice_point_clipped" : "overlay_edit_lattice_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_lattice_point_clipped" :
"overlay_edit_lattice_point");
}
return sh_data->edit_lattice_point;
}
@ -367,7 +381,8 @@ GPUShader *OVERLAY_shader_edit_lattice_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_lattice_wire) {
sh_data->edit_lattice_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_lattice_wire_clipped" : "overlay_edit_lattice_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_lattice_wire_clipped" :
"overlay_edit_lattice_wire");
}
return sh_data->edit_lattice_wire;
}
@ -378,7 +393,8 @@ GPUShader *OVERLAY_shader_edit_mesh_face(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_face) {
sh_data->edit_mesh_face = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_face_clipped" : "overlay_edit_mesh_face");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_face_clipped" :
"overlay_edit_mesh_face");
}
return sh_data->edit_mesh_face;
}
@ -389,7 +405,8 @@ GPUShader *OVERLAY_shader_edit_mesh_facedot(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_facedot) {
sh_data->edit_mesh_facedot = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_facedot_clipped" : "overlay_edit_mesh_facedot");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_facedot_clipped" :
"overlay_edit_mesh_facedot");
}
return sh_data->edit_mesh_facedot;
}
@ -400,7 +417,8 @@ GPUShader *OVERLAY_shader_edit_mesh_normal(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_normals) {
sh_data->edit_mesh_normals = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_normal_clipped" : "overlay_edit_mesh_normal");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_normal_clipped" :
"overlay_edit_mesh_normal");
}
return sh_data->edit_mesh_normals;
}
@ -411,7 +429,8 @@ GPUShader *OVERLAY_shader_edit_mesh_analysis(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_analysis) {
sh_data->edit_mesh_analysis = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_analysis_clipped" : "overlay_edit_mesh_analysis");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_analysis_clipped" :
"overlay_edit_mesh_analysis");
}
return sh_data->edit_mesh_analysis;
}
@ -422,7 +441,8 @@ GPUShader *OVERLAY_shader_edit_mesh_skin_root(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_mesh_skin_root) {
sh_data->edit_mesh_skin_root = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_mesh_skin_root_clipped" : "overlay_edit_mesh_skin_root");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_mesh_skin_root_clipped" :
"overlay_edit_mesh_skin_root");
}
return sh_data->edit_mesh_skin_root;
}
@ -433,8 +453,8 @@ GPUShader *OVERLAY_shader_edit_particle_strand(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_particle_strand) {
sh_data->edit_particle_strand = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_particle_strand_clipped" :
"overlay_edit_particle_strand");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_particle_strand_clipped" :
"overlay_edit_particle_strand");
}
return sh_data->edit_particle_strand;
}
@ -445,7 +465,8 @@ GPUShader *OVERLAY_shader_edit_particle_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->edit_particle_point) {
sh_data->edit_particle_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_edit_particle_point_clipped" : "overlay_edit_particle_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_edit_particle_point_clipped" :
"overlay_edit_particle_point");
}
return sh_data->edit_particle_point;
}
@ -457,8 +478,9 @@ GPUShader *OVERLAY_shader_extra(bool is_select)
GPUShader **sh = (is_select) ? &sh_data->extra_select : &sh_data->extra;
if (!*sh) {
*sh = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? (is_select ? "overlay_extra_select_clipped" : "overlay_extra_clipped") :
(is_select ? "overlay_extra_select" : "overlay_extra"));
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
(is_select ? "overlay_extra_select_clipped" : "overlay_extra_clipped") :
(is_select ? "overlay_extra_select" : "overlay_extra"));
}
return *sh;
}
@ -469,7 +491,8 @@ GPUShader *OVERLAY_shader_extra_grid(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->extra_lightprobe_grid) {
sh_data->extra_lightprobe_grid = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_extra_grid_clipped" : "overlay_extra_grid");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_extra_grid_clipped" :
"overlay_extra_grid");
}
return sh_data->extra_lightprobe_grid;
}
@ -480,7 +503,8 @@ GPUShader *OVERLAY_shader_extra_groundline(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->extra_groundline) {
sh_data->extra_groundline = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_extra_groundline_clipped" : "overlay_extra_groundline");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_extra_groundline_clipped" :
"overlay_extra_groundline");
}
return sh_data->extra_groundline;
}
@ -520,7 +544,8 @@ GPUShader *OVERLAY_shader_extra_loose_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->extra_loose_point) {
sh_data->extra_loose_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_extra_loose_point_clipped" : "overlay_extra_loose_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_extra_loose_point_clipped" :
"overlay_extra_loose_point");
}
return sh_data->extra_loose_point;
}
@ -531,7 +556,8 @@ GPUShader *OVERLAY_shader_extra_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->extra_point) {
sh_data->extra_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_extra_point_clipped" : "overlay_extra_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_extra_point_clipped" :
"overlay_extra_point");
}
return sh_data->extra_point;
}
@ -542,7 +568,8 @@ GPUShader *OVERLAY_shader_facing(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->facing) {
sh_data->facing = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_facing_clipped" : "overlay_facing");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_facing_clipped" :
"overlay_facing");
}
return sh_data->facing;
}
@ -624,7 +651,8 @@ GPUShader *OVERLAY_shader_motion_path_line(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->motion_path_line) {
sh_data->motion_path_line = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_motion_path_line_clipped" : "overlay_motion_path_line");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_motion_path_line_clipped" :
"overlay_motion_path_line");
}
return sh_data->motion_path_line;
}
@ -635,7 +663,8 @@ GPUShader *OVERLAY_shader_motion_path_vert(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->motion_path_vert) {
sh_data->motion_path_vert = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_motion_path_point_clipped" : "overlay_motion_path_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_motion_path_point_clipped" :
"overlay_motion_path_point");
}
return sh_data->motion_path_vert;
}
@ -646,13 +675,13 @@ GPUShader *OVERLAY_shader_outline_prepass(bool use_wire)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (use_wire && !sh_data->outline_prepass_wire) {
sh_data->outline_prepass_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_outline_prepass_wire_clipped" :
"overlay_outline_prepass_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_outline_prepass_wire_clipped" :
"overlay_outline_prepass_wire");
}
else if (!sh_data->outline_prepass) {
sh_data->outline_prepass = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_outline_prepass_mesh_clipped" :
"overlay_outline_prepass_mesh");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_outline_prepass_mesh_clipped" :
"overlay_outline_prepass_mesh");
}
return use_wire ? sh_data->outline_prepass_wire : sh_data->outline_prepass;
}
@ -663,8 +692,8 @@ GPUShader *OVERLAY_shader_outline_prepass_curves()
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->outline_prepass_curves) {
sh_data->outline_prepass_curves = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_outline_prepass_curves_clipped" :
"overlay_outline_prepass_curves");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_outline_prepass_curves_clipped" :
"overlay_outline_prepass_curves");
}
return sh_data->outline_prepass_curves;
}
@ -675,8 +704,8 @@ GPUShader *OVERLAY_shader_outline_prepass_gpencil(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->outline_prepass_gpencil) {
sh_data->outline_prepass_gpencil = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_outline_prepass_gpencil_clipped" :
"overlay_outline_prepass_gpencil");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_outline_prepass_gpencil_clipped" :
"overlay_outline_prepass_gpencil");
}
return sh_data->outline_prepass_gpencil;
}
@ -687,8 +716,9 @@ GPUShader *OVERLAY_shader_outline_prepass_pointcloud(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->outline_prepass_pointcloud) {
sh_data->outline_prepass_pointcloud = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_outline_prepass_pointcloud_clipped" :
"overlay_outline_prepass_pointcloud");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
"overlay_outline_prepass_pointcloud_clipped" :
"overlay_outline_prepass_pointcloud");
}
return sh_data->outline_prepass_pointcloud;
}
@ -708,8 +738,8 @@ GPUShader *OVERLAY_shader_paint_face(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->paint_face) {
sh_data->paint_face = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_paint_face_clipped" :
"overlay_paint_face");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_paint_face_clipped" :
"overlay_paint_face");
}
return sh_data->paint_face;
}
@ -720,8 +750,8 @@ GPUShader *OVERLAY_shader_paint_point(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->paint_point) {
sh_data->paint_point = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_paint_point_clipped" :
"overlay_paint_point");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_paint_point_clipped" :
"overlay_paint_point");
}
return sh_data->paint_point;
}
@ -732,7 +762,8 @@ GPUShader *OVERLAY_shader_paint_texture(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->paint_texture) {
sh_data->paint_texture = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_paint_texture_clipped" : "overlay_paint_texture");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_paint_texture_clipped" :
"overlay_paint_texture");
}
return sh_data->paint_texture;
}
@ -743,7 +774,8 @@ GPUShader *OVERLAY_shader_paint_vertcol(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->paint_vertcol) {
sh_data->paint_vertcol = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_paint_vertcol_clipped" : "overlay_paint_vertcol");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_paint_vertcol_clipped" :
"overlay_paint_vertcol");
}
return sh_data->paint_vertcol;
}
@ -770,7 +802,8 @@ GPUShader *OVERLAY_shader_paint_wire(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->paint_wire) {
sh_data->paint_wire = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_paint_wire_clipped" : "overlay_paint_wire");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_paint_wire_clipped" :
"overlay_paint_wire");
}
return sh_data->paint_wire;
}
@ -781,7 +814,8 @@ GPUShader *OVERLAY_shader_particle_dot(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->particle_dot) {
sh_data->particle_dot = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_particle_dot_clipped" : "overlay_particle_dot");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_particle_dot_clipped" :
"overlay_particle_dot");
}
return sh_data->particle_dot;
}
@ -792,7 +826,8 @@ GPUShader *OVERLAY_shader_particle_shape(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->particle_shape) {
sh_data->particle_shape = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_particle_shape_clipped" : "overlay_particle_shape");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_particle_shape_clipped" :
"overlay_particle_shape");
}
return sh_data->particle_shape;
}
@ -803,7 +838,8 @@ GPUShader *OVERLAY_shader_sculpt_mask(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->sculpt_mask) {
sh_data->sculpt_mask = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_sculpt_mask_clipped" : "overlay_sculpt_mask");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_sculpt_mask_clipped" :
"overlay_sculpt_mask");
}
return sh_data->sculpt_mask;
}
@ -814,8 +850,8 @@ GPUShader *OVERLAY_shader_sculpt_curves_selection(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->sculpt_curves_selection) {
sh_data->sculpt_curves_selection = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_sculpt_curves_selection_clipped" :
"overlay_sculpt_curves_selection");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_sculpt_curves_selection_clipped" :
"overlay_sculpt_curves_selection");
}
return sh_data->sculpt_curves_selection;
}
@ -826,8 +862,8 @@ GPUShader *OVERLAY_shader_viewer_attribute_mesh(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->viewer_attribute_mesh) {
sh_data->viewer_attribute_mesh = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_mesh_clipped" :
"overlay_viewer_attribute_mesh");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_viewer_attribute_mesh_clipped" :
"overlay_viewer_attribute_mesh");
}
return sh_data->viewer_attribute_mesh;
}
@ -838,7 +874,7 @@ GPUShader *OVERLAY_shader_viewer_attribute_pointcloud(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->viewer_attribute_pointcloud) {
sh_data->viewer_attribute_pointcloud = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ?
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
"overlay_viewer_attribute_pointcloud_clipped" :
"overlay_viewer_attribute_pointcloud");
}
@ -851,8 +887,8 @@ GPUShader *OVERLAY_shader_viewer_attribute_curve(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->viewer_attribute_curve) {
sh_data->viewer_attribute_curve = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_curve_clipped" :
"overlay_viewer_attribute_curve");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_viewer_attribute_curve_clipped" :
"overlay_viewer_attribute_curve");
}
return sh_data->viewer_attribute_curve;
}
@ -863,8 +899,8 @@ GPUShader *OVERLAY_shader_viewer_attribute_curves(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->viewer_attribute_curves) {
sh_data->viewer_attribute_curves = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_curves_clipped" :
"overlay_viewer_attribute_curves");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_viewer_attribute_curves_clipped" :
"overlay_viewer_attribute_curves");
}
return sh_data->viewer_attribute_curves;
}
@ -875,7 +911,8 @@ struct GPUShader *OVERLAY_shader_uniform_color(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->uniform_color) {
sh_data->uniform_color = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_uniform_color_clipped" : "overlay_uniform_color");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_uniform_color_clipped" :
"overlay_uniform_color");
}
return sh_data->uniform_color;
}
@ -886,8 +923,8 @@ struct GPUShader *OVERLAY_shader_uniform_color_pointcloud()
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->uniform_color_pointcloud) {
sh_data->uniform_color_pointcloud = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_uniform_color_pointcloud_clipped" :
"overlay_uniform_color_pointcloud");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_uniform_color_pointcloud_clipped" :
"overlay_uniform_color_pointcloud");
}
return sh_data->uniform_color_pointcloud;
}
@ -947,7 +984,8 @@ GPUShader *OVERLAY_shader_wireframe_select(void)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->wireframe_select) {
sh_data->wireframe_select = GPU_shader_create_from_info_name(
draw_ctx->sh_cfg ? "overlay_wireframe_select_clipped" : "overlay_wireframe_select");
(draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_wireframe_select_clipped" :
"overlay_wireframe_select");
}
return sh_data->wireframe_select;
}
@ -958,9 +996,11 @@ GPUShader *OVERLAY_shader_wireframe(bool custom_bias)
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
if (!sh_data->wireframe[custom_bias]) {
sh_data->wireframe[custom_bias] = GPU_shader_create_from_info_name(
custom_bias ? (draw_ctx->sh_cfg ? "overlay_wireframe_custom_depth_clipped" :
"overlay_wireframe_custom_depth") :
(draw_ctx->sh_cfg ? "overlay_wireframe_clipped" : "overlay_wireframe"));
custom_bias ? ((draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ?
"overlay_wireframe_custom_depth_clipped" :
"overlay_wireframe_custom_depth") :
((draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) ? "overlay_wireframe_clipped" :
"overlay_wireframe"));
}
return sh_data->wireframe[custom_bias];
}