diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-02-06 05:49:10 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-02-06 05:49:10 +0000 |
| commit | a13fe40ab6b365270a2f438ecb0c0d615f29e3e5 (patch) | |
| tree | 8400c92fdd8cfdd5c4ab9d1a88b61b57b26f5ed0 /Graphics/GraphicsEngineVulkan | |
| parent | Updated third-party submodules (diff) | |
| download | DiligentCore-a13fe40ab6b365270a2f438ecb0c0d615f29e3e5.tar.gz DiligentCore-a13fe40ab6b365270a2f438ecb0c0d615f29e3e5.zip | |
Vulkan backend: added output for SPIRV Optimizer
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp index 338f0f50..8cbe331f 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp @@ -44,6 +44,18 @@ namespace Diligent { + +#if !DILIGENT_NO_HLSL +namespace GLSLangUtils +{ +void SpvOptimizerMessageConsumer( + spv_message_level_t level, + const char* /* source */, + const spv_position_t& /* position */, + const char* message); +} +#endif + namespace { @@ -62,6 +74,7 @@ bool StripReflection(const VulkanUtilities::VulkanLogicalDevice& LogicalDevice, Target = SPV_ENV_VULKAN_1_1_SPIRV_1_4; spvtools::Optimizer SpirvOptimizer(Target); + SpirvOptimizer.SetMessageConsumer(GLSLangUtils::SpvOptimizerMessageConsumer); // 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()); |
