@@ -489,11 +489,7 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
489489 RID vertex_array_rd;
490490 RID index_array_rd;
491491 RID pipeline_rd;
492- uint32_t ubershader_iterations = 2 ;
493- if constexpr (p_pass_mode == PASS_MODE_DEPTH_MATERIAL || p_pass_mode == PASS_MODE_SDF) {
494- ubershader_iterations = 1 ;
495- }
496-
492+ const uint32_t ubershader_iterations = 2 ;
497493 bool pipeline_valid = false ;
498494 while (pipeline_key.ubershader < ubershader_iterations) {
499495 // Skeleton and blend shape.
@@ -519,9 +515,8 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
519515 pipeline_hash = pipeline_key.hash ();
520516
521517 if (shader != prev_shader || pipeline_hash != prev_pipeline_hash) {
522- bool wait_for_compilation = (ubershader_iterations == 1 ) || pipeline_key.ubershader ;
523- RS::PipelineSource pipeline_source = wait_for_compilation ? RS::PIPELINE_SOURCE_DRAW : RS::PIPELINE_SOURCE_SPECIALIZATION;
524- pipeline_rd = shader->pipeline_hash_map .get_pipeline (pipeline_key, pipeline_hash, wait_for_compilation, pipeline_source);
518+ RS::PipelineSource pipeline_source = pipeline_key.ubershader ? RS::PIPELINE_SOURCE_DRAW : RS::PIPELINE_SOURCE_SPECIALIZATION;
519+ pipeline_rd = shader->pipeline_hash_map .get_pipeline (pipeline_key, pipeline_hash, pipeline_key.ubershader , pipeline_source);
525520
526521 if (pipeline_rd.is_valid ()) {
527522 pipeline_valid = true ;
@@ -3787,7 +3782,7 @@ RID RenderForwardClustered::_setup_sdfgi_render_pass_uniform_set(RID p_albedo_te
37873782 // The variant for SDF from the default material should only be retrieved when SDFGI is required.
37883783 ERR_FAIL_NULL_V (scene_shader.default_material_shader_ptr , RID ());
37893784 scene_shader.enable_advanced_shader_group ();
3790- scene_shader.default_shader_sdfgi_rd = scene_shader.default_material_shader_ptr ->get_shader_variant (SceneShaderForwardClustered::PIPELINE_VERSION_DEPTH_PASS_WITH_SDF, 0 , false );
3785+ scene_shader.default_shader_sdfgi_rd = scene_shader.default_material_shader_ptr ->get_shader_variant (SceneShaderForwardClustered::PIPELINE_VERSION_DEPTH_PASS_WITH_SDF, 0 , true );
37913786 ERR_FAIL_COND_V (scene_shader.default_shader_sdfgi_rd .is_null (), RID ());
37923787 }
37933788
@@ -4579,11 +4574,11 @@ void RenderForwardClustered::_mesh_compile_pipelines_for_surface(const SurfacePi
45794574 // Depth pass with SDFGI support.
45804575 pipeline_key.version = SceneShaderForwardClustered::PIPELINE_VERSION_DEPTH_PASS_WITH_SDF;
45814576 pipeline_key.framebuffer_format_id = _get_depth_framebuffer_format_for_pipeline (buffers_can_be_storage, RD::TextureSamples (p_global.texture_samples ), false , false );
4582- _mesh_compile_pipeline_for_surface (p_surface.shader , p_surface.mesh_surface , false , p_surface.instanced , p_source, pipeline_key, r_pipeline_pairs);
4577+ _mesh_compile_pipeline_for_surface (p_surface.shader , p_surface.mesh_surface , true , p_surface.instanced , p_source, pipeline_key, r_pipeline_pairs);
45834578
45844579 // Depth pass with SDFGI support for an empty framebuffer.
45854580 pipeline_key.framebuffer_format_id = RD::get_singleton ()->framebuffer_format_create_empty ();
4586- _mesh_compile_pipeline_for_surface (p_surface.shader , p_surface.mesh_surface , false , p_surface.instanced , p_source, pipeline_key, r_pipeline_pairs);
4581+ _mesh_compile_pipeline_for_surface (p_surface.shader , p_surface.mesh_surface , true , p_surface.instanced , p_source, pipeline_key, r_pipeline_pairs);
45874582 }
45884583
45894584 // The dedicated depth passes use a different version of the surface and the shader.
0 commit comments