summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-spirv-ops.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-07-01 19:09:29 -0700
committerGitHub <noreply@github.com>2025-07-02 02:09:29 +0000
commitc701ec00ccce6dfa8094d6550ce2db929fc8cefe (patch)
tree4f729e8fa5700b2d6d7d99f34514682e3ad351f8 /source/slang/slang-emit-spirv-ops.h
parent83c72fd8772d312233f4e3ccd4154b81030d4795 (diff)
Defer immutable buffer loads when emitting spirv. (#7579)
* Defer immutable buffer loads when emitting spirv. * Fix. * Fix. * Fix. * Fix tests. * Fix test.
Diffstat (limited to 'source/slang/slang-emit-spirv-ops.h')
-rw-r--r--source/slang/slang-emit-spirv-ops.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-emit-spirv-ops.h b/source/slang/slang-emit-spirv-ops.h
index 4d33e045e..a5e4d730a 100644
--- a/source/slang/slang-emit-spirv-ops.h
+++ b/source/slang/slang-emit-spirv-ops.h
@@ -672,6 +672,21 @@ SpvInst* emitOpAccessChain(
return emitInst(parent, inst, SpvOpAccessChain, idResultType, kResultID, base, indexes);
}
+// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpInBoundsAccessChain
+template<typename T1, typename T2, typename Ts>
+SpvInst* emitOpInBoundsAccessChain(
+ SpvInstParent* parent,
+ IRInst* inst,
+ const T1& idResultType,
+ const T2& base,
+ const Ts& indexes)
+{
+ static_assert(isSingular<T1>);
+ static_assert(isSingular<T2>);
+ static_assert(isPlural<Ts>);
+ return emitInst(parent, inst, SpvOpInBoundsAccessChain, idResultType, kResultID, base, indexes);
+}
+
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpPtrAccessChain
template<typename T1, typename T2, typename T3>