File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Graphics/GraphicsEngineVulkan/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2019-2024 Diligent Graphics LLC
2+ * Copyright 2019-2025 Diligent Graphics LLC
33 * Copyright 2015-2019 Egor Yusov
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -740,7 +740,12 @@ void PipelineStateVkImpl::RemapOrVerifyShaderResources(
740740 // SPIR-V module not valid: DecorateStringGOOGLE requires one of the following extensions: SPV_GOOGLE_decorate_string
741741 // Optimizer also performs validation and may catch problems with the byte code.
742742 // NB: SPIRV offsets become INVALID after this operation.
743- auto StrippedSPIRV = OptimizeSPIRV (SPIRV, SPV_ENV_MAX, SPIRV_OPTIMIZATION_FLAG_STRIP_REFLECTION);
743+ SPIRV_OPTIMIZATION_FLAGS OptimizationFlags = SPIRV_OPTIMIZATION_FLAG_STRIP_REFLECTION;
744+ if (pShader->GetShaderResources ()->IsHLSLSource ())
745+ {
746+ OptimizationFlags |= SPIRV_OPTIMIZATION_FLAG_LEGALIZATION;
747+ }
748+ auto StrippedSPIRV = OptimizeSPIRV (SPIRV, SPV_ENV_MAX, OptimizationFlags);
744749 if (!StrippedSPIRV.empty ())
745750 SPIRV = std::move (StrippedSPIRV);
746751 else
You can’t perform that action at this time.
0 commit comments