diff options
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_shader.c')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_shader.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_shader.c b/source/blender/draw/engines/overlay/overlay_shader.c index 7bd3cf4a067..6b8c5b23e58 100644 --- a/source/blender/draw/engines/overlay/overlay_shader.c +++ b/source/blender/draw/engines/overlay/overlay_shader.c @@ -47,6 +47,8 @@ extern char datatoc_armature_stick_frag_glsl[]; extern char datatoc_armature_stick_vert_glsl[]; extern char datatoc_armature_wire_frag_glsl[]; extern char datatoc_armature_wire_vert_glsl[]; +extern char datatoc_background_frag_glsl[]; +extern char datatoc_clipbound_vert_glsl[]; extern char datatoc_depth_only_vert_glsl[]; extern char datatoc_edit_curve_handle_geom_glsl[]; extern char datatoc_edit_curve_handle_vert_glsl[]; @@ -129,6 +131,8 @@ typedef struct OVERLAY_Shaders { GPUShader *armature_sphere_solid; GPUShader *armature_stick; GPUShader *armature_wire; + GPUShader *background; + GPUShader *clipbound; GPUShader *depth_only; GPUShader *edit_curve_handle; GPUShader *edit_curve_point; @@ -198,6 +202,31 @@ GPUShader *OVERLAY_shader_antialiasing(void) return sh_data->antialiasing; } +GPUShader *OVERLAY_shader_background(void) +{ + OVERLAY_Shaders *sh_data = &e_data.sh_data[0]; + if (!sh_data->background) { + sh_data->background = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_fullscreen_vert_glsl, NULL}, + .frag = + (const char *[]){datatoc_common_globals_lib_glsl, datatoc_background_frag_glsl, NULL}, + }); + } + return sh_data->background; +} + +GPUShader *OVERLAY_shader_clipbound(void) +{ + OVERLAY_Shaders *sh_data = &e_data.sh_data[0]; + if (!sh_data->clipbound) { + sh_data->clipbound = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, datatoc_clipbound_vert_glsl, NULL}, + .frag = (const char *[]){datatoc_gpu_shader_uniform_color_frag_glsl, NULL}, + }); + } + return sh_data->clipbound; +} + GPUShader *OVERLAY_shader_depth_only(void) { const DRWContextState *draw_ctx = DRW_context_state_get(); |