summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp')
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
index 9701d10e244..a32db3b7606 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
@@ -53,6 +53,20 @@ bool LocalSingleStoreElimPass::AllExtensionsSupported() const {
if (extensions_allowlist_.find(extName) == extensions_allowlist_.end())
return false;
}
+ // only allow NonSemantic.Shader.DebugInfo.100, we cannot safely optimise
+ // around unknown extended
+ // instruction sets even if they are non-semantic
+ for (auto& inst : context()->module()->ext_inst_imports()) {
+ assert(inst.opcode() == SpvOpExtInstImport &&
+ "Expecting an import of an extension's instruction set.");
+ const char* extension_name =
+ reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
+ if (0 == std::strncmp(extension_name, "NonSemantic.", 12) &&
+ 0 != std::strncmp(extension_name, "NonSemantic.Shader.DebugInfo.100",
+ 32)) {
+ return false;
+ }
+ }
return true;
}
@@ -126,6 +140,7 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() {
"SPV_KHR_subgroup_uniform_control_flow",
"SPV_KHR_integer_dot_product",
"SPV_EXT_shader_image_int64",
+ "SPV_KHR_non_semantic_info",
});
}
bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {