GPUShader: Port 3D uniform color clipped shaders to use shaderCreateInfo

This should have no functional changes.
This commit is contained in:
Clément Foucault
2022-05-02 00:44:58 +02:00
parent 0676963809
commit 5e5e198bbe
2 changed files with 17 additions and 3 deletions

View File

@@ -223,8 +223,7 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = {
[GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR] =
{
.name = "GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR",
.vert = datatoc_gpu_shader_3D_clipped_uniform_color_vert_glsl,
.frag = datatoc_gpu_shader_uniform_color_frag_glsl,
.create_info = "gpu_shader_3D_clipped_uniform_color",
},
[GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR] = {.name = "GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR",

View File

@@ -19,4 +19,19 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_uniform_color)
GPU_SHADER_CREATE_INFO(gpu_shader_3D_uniform_color_clipped)
.additional_info("gpu_shader_3D_uniform_color")
.additional_info("gpu_clip_planes");
.additional_info("gpu_clip_planes")
.do_static_compilation(true);
/* Confusing naming convention. But this is a version with only one local clip plane. */
GPU_SHADER_CREATE_INFO(gpu_shader_3D_clipped_uniform_color)
.vertex_in(0, Type::VEC3, "pos")
.fragment_out(0, Type::VEC4, "fragColor")
.push_constant(Type::MAT4, "ModelViewProjectionMatrix")
.push_constant(Type::VEC4, "color")
/* TODO(fclem): Put thoses two to one UBO. */
.push_constant(Type::MAT4, "ModelMatrix")
.push_constant(Type::VEC4, "ClipPlane")
.vertex_source("gpu_shader_3D_clipped_uniform_color_vert.glsl")
.fragment_source("gpu_shader_uniform_color_frag.glsl")
.additional_info("gpu_srgb_to_framebuffer_space")
.do_static_compilation(true);