34 return "gpu_shader_text";
36 return "gpu_shader_keyframe_shape";
38 return "gpu_shader_simple_lighting";
40 return "gpu_shader_3D_image";
42 return "gpu_shader_3D_image_scene_linear";
44 return "gpu_shader_3D_image_color";
46 return "gpu_shader_3D_image_color_scene_linear";
48 return "gpu_shader_2D_checker";
50 return "gpu_shader_2D_diag_stripes";
52 return "gpu_shader_2D_image_overlays_merge";
54 return "gpu_shader_2D_image_overlays_stereo_merge";
56 return "gpu_shader_2D_image_desaturate_color";
58 return "gpu_shader_2D_image_shuffle_color";
60 return "gpu_shader_2D_image_rect_color";
62 return "gpu_shader_icon";
64 return "gpu_shader_3D_uniform_color";
66 return "gpu_shader_3D_flat_color";
68 return "gpu_shader_3D_smooth_color";
70 return "gpu_shader_3D_clipped_uniform_color";
72 return "gpu_shader_polyline_uniform_color";
74 return "gpu_shader_polyline_uniform_color_clipped";
76 return "gpu_shader_polyline_flat_color";
78 return "gpu_shader_polyline_smooth_color";
80 return "gpu_shader_3D_line_dashed_uniform_color";
82 return "gpu_shader_3D_point_uniform_size_uniform_color_outline_aa";
84 return "gpu_shader_3D_point_varying_size_varying_color";
87 return "gpu_shader_3D_point_uniform_size_uniform_color_aa";
89 return "gpu_shader_3D_point_flat_color";
91 return "gpu_shader_3D_point_uniform_color";
93 return "gpu_shader_2D_area_borders";
95 return "gpu_shader_2D_rounded_corner_mask";
97 return "gpu_shader_2D_widget_base";
99 return "gpu_shader_2D_widget_base_inst";
101 return "gpu_shader_2D_widget_shadow";
103 return "gpu_shader_2D_node_socket";
105 return "gpu_shader_2D_node_socket_inst";
107 return "gpu_shader_2D_nodelink";
109 return "gpu_shader_annotation";
111 return "gpu_shader_sequencer_strips";
113 return "gpu_shader_sequencer_thumbs";
115 return "gpu_shader_sequencer_scope_raster";
117 return "gpu_shader_sequencer_scope_resolve";
119 return "gpu_shader_sequencer_zebra";
121 return "gpu_shader_index_2d_array_points";
123 return "gpu_shader_index_2d_array_lines";
125 return "gpu_shader_index_2d_array_tris";
128 return "gpu_shader_2D_update_mipmaps_unorm_8";
130 return "gpu_shader_2D_update_mipmaps_unorm_8_layered";
132 return "gpu_shader_2D_update_mipmaps_unorm_8_8_8_8";
134 return "gpu_shader_2D_update_mipmaps_unorm_8_8_8_8_layered";
136 return "gpu_shader_2D_update_mipmaps_sfloat_16";
138 return "gpu_shader_2D_update_mipmaps_sfloat_16_layered";
140 return "gpu_shader_2D_update_mipmaps_sfloat_16_16_16_16";
142 return "gpu_shader_2D_update_mipmaps_sfloat_16_16_16_16_layered";
144 return "gpu_shader_2D_update_mipmaps_sfloat_32";
146 return "gpu_shader_2D_update_mipmaps_sfloat_32_layered";
148 return "gpu_shader_2D_update_mipmaps_sfloat_32_32_32_32";
150 return "gpu_shader_2D_update_mipmaps_sfloat_32_32_32_32_layered";
152 return "gpu_shader_2D_update_mipmaps_srgba_8_8_8_8";
154 return "gpu_shader_2D_update_mipmaps_srgba_8_8_8_8_layered";
165 return "gpu_shader_3D_uniform_color_clipped";
167 return "gpu_shader_3D_flat_color_clipped";
169 return "gpu_shader_3D_smooth_color_clipped";
171 return "gpu_shader_3D_line_dashed_uniform_color_clipped";
173 return "gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped";
175 return "gpu_shader_polyline_uniform_color_clipped";
177 BLI_assert_msg(
false,
"Clipped shader configuration not available.");
188# pragma GCC diagnostic push
189# pragma GCC diagnostic ignored "-Warray-bounds"
193# pragma GCC diagnostic pop
196 if (*sh_p ==
nullptr) {
200 *sh_p = MEM_new<BuiltinShader>(__func__, info_name);
206 *sh_p = MEM_new<BuiltinShader>(__func__, info_name_clipped);
214 if ((*sh_p)->init ==
false) {
215 (*sh_p)->init =
true;
232 return (*sh_p)->
get();
240# pragma GCC diagnostic push
241# pragma GCC diagnostic ignored "-Warray-bounds"
245# pragma GCC diagnostic pop
248 if (*sh_p ==
nullptr) {
252 *sh_p = MEM_new<BuiltinShader>(__func__, info_name);
258 *sh_p = MEM_new<BuiltinShader>(__func__, info_name_clipped);
#define GPU_SHADER_BUILTIN_LEN
#define GPU_SHADER_CFG_LEN
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
constexpr StringRefNull()
void ensure_compile_async()
StaticShader(std::string info_name)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void GPU_shader_builtin_warm_up()
bool GPU_use_subprocess_compilation()
void GPU_shader_free_builtin_shaders()
GPUBackendType GPU_backend_get_type()
static void gpu_shader_warm_builtin_shader_async(GPUBuiltinShader shader, GPUShaderConfig sh_cfg)
static const char * builtin_shader_create_info_name_clipped(GPUBuiltinShader shader)
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_16_16_16_16
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_32_32_32_32_LAYERED
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SRGBA_8_8_8_8_LAYERED
@ GPU_SHADER_SEQUENCER_SCOPE_RASTER
@ GPU_SHADER_2D_UPDATE_MIPMAPS_UNORM_8_8_8_8
@ GPU_SHADER_SEQUENCER_ZEBRA
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
@ GPU_SHADER_2D_NODE_SOCKET
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_32_LAYERED
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_SHADER_INDEXBUF_LINES
@ GPU_SHADER_2D_UPDATE_MIPMAPS_UNORM_8
@ GPU_SHADER_2D_AREA_BORDERS
@ GPU_SHADER_3D_IMAGE_COLOR_SCENE_LINEAR_TO_REC709_SRGB
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SRGBA_8_8_8_8
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_32
@ GPU_SHADER_SIMPLE_LIGHTING
@ GPU_SHADER_INDEXBUF_POINTS
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_16_16_16_16_LAYERED
@ GPU_SHADER_2D_WIDGET_BASE_INST
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_SHADER_2D_DIAG_STRIPES
@ GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_16_LAYERED
@ GPU_SHADER_2D_ROUNDED_CORNER_MASK
@ GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE
@ GPU_SHADER_3D_IMAGE_SCENE_LINEAR_TO_REC709_SRGB
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_GPENCIL_STROKE
@ GPU_SHADER_3D_POINT_UNIFORM_COLOR
@ GPU_SHADER_2D_NODE_SOCKET_INST
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
@ GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_2D_UPDATE_MIPMAPS_UNORM_8_LAYERED
@ GPU_SHADER_SEQUENCER_SCOPE_RESOLVE
@ GPU_SHADER_2D_IMAGE_DESATURATE_COLOR
@ GPU_SHADER_SEQUENCER_STRIPS
@ GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR
@ GPU_SHADER_INDEXBUF_TRIS
@ GPU_SHADER_2D_WIDGET_BASE
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_16
@ GPU_SHADER_2D_UPDATE_MIPMAPS_UNORM_8_8_8_8_LAYERED
@ GPU_SHADER_2D_IMAGE_RECT_COLOR
@ GPU_SHADER_SEQUENCER_THUMBS
@ GPU_SHADER_2D_WIDGET_SHADOW
@ GPU_SHADER_3D_POINT_FLAT_COLOR
@ GPU_SHADER_2D_UPDATE_MIPMAPS_SFLOAT_32_32_32_32
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(gpu::Shader *sh, const char *name, int value)
static const char * builtin_shader_create_info_name(GPUBuiltinShader shader)
gpu::Shader * GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
gpu::Shader * GPU_shader_get_builtin_shader_with_config(GPUBuiltinShader shader, GPUShaderConfig sh_cfg)
static BuiltinShader * builtin_shaders[GPU_SHADER_CFG_LEN][GPU_SHADER_BUILTIN_LEN]
BuiltinShader(std::string info_name)