mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #63829 from clayjohn/VULKAN-disable-multiview
Disable multiview shader versions when xr is disabled
This commit is contained in:
commit
7990b76ad8
@ -353,6 +353,11 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) {
|
||||
}
|
||||
|
||||
int variant = shader_version + shader_flags;
|
||||
|
||||
if (!static_cast<SceneShaderForwardClustered *>(singleton)->shader.is_variant_enabled(variant)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
RID shader_variant = shader_singleton->shader.version_get_shader(version, variant);
|
||||
color_pipelines[i][j][l].setup(shader_variant, primitive_rd, raster_state, multisample_state, depth_stencil, blend_state, 0, singleton->default_specialization_constants);
|
||||
}
|
||||
@ -503,7 +508,14 @@ void SceneShaderForwardClustered::init(const String p_defines) {
|
||||
shader.set_variant_enabled(SHADER_VERSION_DEPTH_PASS_MULTIVIEW, false);
|
||||
shader.set_variant_enabled(SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS_MULTIVIEW, false);
|
||||
shader.set_variant_enabled(SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS_AND_VOXEL_GI_MULTIVIEW, false);
|
||||
// TODO Add a way to enable/disable color pass flags
|
||||
|
||||
// Disable Color Passes
|
||||
for (int i = 0; i < SHADER_COLOR_PASS_FLAG_COUNT; i++) {
|
||||
// Selectively disable any shader pass that includes Multiview.
|
||||
if ((i & SHADER_COLOR_PASS_FLAG_MULTIVIEW)) {
|
||||
shader.set_variant_enabled(i + SHADER_VERSION_COLOR_PASS, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user