diff options
author | DeeJayLSP <djlsplays@gmail.com> | 2023-06-06 02:19:51 -0300 |
---|---|---|
committer | DeeJayLSP <djlsplays@gmail.com> | 2023-06-06 12:40:04 -0300 |
commit | 1b642d283c8daf27a4d5141ed212b6568b9ad21b (patch) | |
tree | 401c5ba01a1a0e57fae548a4da5d9d44de9c8825 /thirdparty/glslang/SPIRV/SpvTools.h | |
parent | e7d2e49688bdaec65e326e7b2bfcc0642b4f2a8d (diff) | |
download | redot-engine-1b642d283c8daf27a4d5141ed212b6568b9ad21b.tar.gz |
Update Vulkan and related libraries to 1.3.250.0
Diffstat (limited to 'thirdparty/glslang/SPIRV/SpvTools.h')
-rw-r--r-- | thirdparty/glslang/SPIRV/SpvTools.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/thirdparty/glslang/SPIRV/SpvTools.h b/thirdparty/glslang/SPIRV/SpvTools.h index 5386048ab6..6fc4e40b02 100644 --- a/thirdparty/glslang/SPIRV/SpvTools.h +++ b/thirdparty/glslang/SPIRV/SpvTools.h @@ -65,6 +65,9 @@ struct SpvOptions { #if ENABLE_OPT +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); + // Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv); @@ -80,6 +83,22 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector< void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv, spv::SpvBuildLogger*, const SpvOptions*); +// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|. +void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|. +// Return true if the result is valid. +bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv, + std::unordered_set<uint32_t>* live_locs, + std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using +// |live_locs|. Put result in |spirv|. +void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv, + std::unordered_set<uint32_t>* live_locs, + std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*); + // Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by // SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if // optimization is disabled. |