summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-09-02 22:59:01 +0000
committerazhirnov <zh1dron@gmail.com>2020-09-02 22:59:01 +0000
commitab01643f73deb37e828d46a007e8643e449b28f9 (patch)
treed333d91ed570f8ce297b82e6b18e35eb48715b6d /Graphics/GraphicsEngineVulkan
parentfixed compilation on UWP, use FXC by default on D3D12 (diff)
downloadDiligentCore-ab01643f73deb37e828d46a007e8643e449b28f9.tar.gz
DiligentCore-ab01643f73deb37e828d46a007e8643e449b28f9.zip
fixed validation errors for SPIRV that compiled with DXC
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 65150c48..6ca51b1e 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -39,7 +39,7 @@
#if !DILIGENT_NO_HLSL
-# include "spirv-tools/optimizer.hpp"
+# include "SPIRVUtils.hpp"
#endif
namespace Diligent
@@ -129,25 +129,12 @@ RenderPassDesc PipelineStateVkImpl::GetImplicitRenderPassDesc(
return RPDesc;
}
+#if DILIGENT_NO_HLSL
static std::vector<uint32_t> StripReflection(const std::vector<uint32_t>& OriginalSPIRV)
{
-#if DILIGENT_NO_HLSL
return OriginalSPIRV;
-#else
- std::vector<uint32_t> StrippedSPIRV;
- spvtools::Optimizer SpirvOptimizer(SPV_ENV_VULKAN_1_0);
- // Decorations defined in SPV_GOOGLE_hlsl_functionality1 are the only instructions
- // removed by strip-reflect-info pass. SPIRV offsets become INVALID after this operation.
- SpirvOptimizer.RegisterPass(spvtools::CreateStripReflectInfoPass());
- auto res = SpirvOptimizer.Run(OriginalSPIRV.data(), OriginalSPIRV.size(), &StrippedSPIRV);
- if (!res)
- {
- // Optimized SPIRV may be invalid
- StrippedSPIRV.clear();
- }
- return StrippedSPIRV;
-#endif
}
+#endif
PipelineStateVkImpl::PipelineStateVkImpl(IReferenceCounters* pRefCounters,
RenderDeviceVkImpl* pDeviceVk,