diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-13 18:28:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 18:28:49 +0200 |
commit | 8fee88947e7c5ac7171b056088c3ac5ae20e954e (patch) | |
tree | 3331e2f1fc65464a10b9014a24f2c9d62c95fb31 /servers/rendering | |
parent | 312b70115a557e572366a302c39f0291bd250033 (diff) | |
parent | 259e50f447051baec85873fb4608b249ffe79933 (diff) |
Merge pull request #60213 from JFonS/fix_depth_state
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index 99a7fe6280..6b0d245e44 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -293,16 +293,16 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) { raster_state.cull_mode = cull_mode_rd; raster_state.wireframe = wireframe; - RD::PipelineColorBlendState blend_state; - RD::PipelineDepthStencilState depth_stencil = depth_stencil_state; - RD::PipelineMultisampleState multisample_state; - if (k == PIPELINE_VERSION_COLOR_PASS) { for (int l = 0; l < PIPELINE_COLOR_PASS_FLAG_COUNT; l++) { if (!shader_singleton->valid_color_pass_pipelines.has(l)) { continue; } + RD::PipelineColorBlendState blend_state; + RD::PipelineDepthStencilState depth_stencil = depth_stencil_state; + RD::PipelineMultisampleState multisample_state; + int shader_flags = 0; if (l & PIPELINE_COLOR_PASS_FLAG_TRANSPARENT) { if (alpha_antialiasing_mode == ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE) { @@ -338,6 +338,10 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) { color_pipelines[i][j][l].setup(shader_variant, primitive_rd, raster_state, multisample_state, depth_stencil, blend_state, 0, singleton->default_specialization_constants); } } else { + RD::PipelineColorBlendState blend_state; + RD::PipelineDepthStencilState depth_stencil = depth_stencil_state; + RD::PipelineMultisampleState multisample_state; + if (k == PIPELINE_VERSION_DEPTH_PASS || k == PIPELINE_VERSION_DEPTH_PASS_DP || k == PIPELINE_VERSION_DEPTH_PASS_MULTIVIEW) { //none, leave empty } else if (k == PIPELINE_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS) { |