diff options
| author | 16-Bit-Dog <67922228+16-Bit-Dog@users.noreply.github.com> | 2025-10-10 13:09:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 17:09:24 +0000 |
| commit | 1e0908bd7107dfbdac912b693c3ab9bd6e1dc8b3 (patch) | |
| tree | cc39d2e18abc954fb76f9a54b11a8d492685c6e2 /source/slang/slang-emit-spirv-ops.h | |
| parent | b4023f715885ada9a2777ea3b0d6d9739860b39b (diff) | |
Addition of `Load`/`Store` coherent operations (#8395)
Fixes: https://github.com/shader-slang/slang/issues/7634
Duplicate of PR https://github.com/shader-slang/slang/pull/8052
Primary Changes:
* Added `storeCoherent` and `loadCoherent` for coherent load/store via
pointers. This is backed by `IRMemoryScopeAttr` which is an `IRAttr`
attached to `IRLoad` and `IRStore`
* Logic in `source\slang\slang-emit-spirv.cpp` for load/store emitting
has been reworked to be less messy and more maintainable
* Add to `hlsl.meta.slang` coop vector and coop matrix coherent
load/store operations
Secondary Changes:
* Added a missing load/store test for coop matrix:
`tests\cooperative-matrix\load-store-pointer.slang`
---------
Co-authored-by: ArielG-NV <aglasroth@nvidia.com>
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Nathan V. Morrical <natemorrical@gmail.com>
Diffstat (limited to 'source/slang/slang-emit-spirv-ops.h')
| -rw-r--r-- | source/slang/slang-emit-spirv-ops.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/source/slang/slang-emit-spirv-ops.h b/source/slang/slang-emit-spirv-ops.h index a5e4d730a..da9058b62 100644 --- a/source/slang/slang-emit-spirv-ops.h +++ b/source/slang/slang-emit-spirv-ops.h @@ -600,28 +600,6 @@ SpvInst* emitOpLoad( return emitInst(parent, inst, SpvOpLoad, idResultType, kResultID, pointer, memoryAccess); } -// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpLoad -template<typename T1, typename T2> -SpvInst* emitOpLoadAligned( - SpvInstParent* parent, - IRInst* inst, - const T1& idResultType, - const T2& pointer, - const SpvLiteralInteger& literalInteger) -{ - static_assert(isSingular<T1>); - static_assert(isSingular<T2>); - return emitInst( - parent, - inst, - SpvOpLoad, - idResultType, - kResultID, - pointer, - SpvMemoryAccessAlignedMask, - literalInteger); -} - // https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpStore template<typename T1, typename T2> SpvInst* emitOpStore( @@ -636,27 +614,6 @@ SpvInst* emitOpStore( return emitInst(parent, inst, SpvOpStore, pointer, object, memoryAccess); } -// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpStore -template<typename T1, typename T2> -SpvInst* emitOpStoreAligned( - SpvInstParent* parent, - IRInst* inst, - const T1& pointer, - const T2& object, - const SpvLiteralInteger& literalInteger) -{ - static_assert(isSingular<T1>); - static_assert(isSingular<T2>); - return emitInst( - parent, - inst, - SpvOpStore, - pointer, - object, - SpvMemoryAccessAlignedMask, - literalInteger); -} - // https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpAccessChain template<typename T1, typename T2, typename Ts> SpvInst* emitOpAccessChain( |
