summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAnders Leino <aleino@nvidia.com>2024-11-26 13:53:23 +0200
committerGitHub <noreply@github.com>2024-11-26 03:53:23 -0800
commit9e21cd4a7552390aff9a1421f2c7f6666876d0bc (patch)
treebeafb8b898d9808ba3cd5ed1db588ebdecb436b1 /source
parentcf0e3a636d500267bce212c61549db1367aff8c1 (diff)
wgpu: Enable Metal-like legalization for byte addressible buffers (#5681)
* Enable hlsl-intrinsic/byte-address-buffer/byte-address-struct * Set byte address buffer legalization options for WGSL
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index 326fc702d..a9d5c5e50 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -1200,6 +1200,15 @@ Result linkAndOptimizeIR(
byteAddressBufferOptions.translateToStructuredBufferOps = false;
byteAddressBufferOptions.lowerBasicTypeOps = true;
break;
+ case CodeGenTarget::WGSL:
+ case CodeGenTarget::WGSLSPIRV:
+ case CodeGenTarget::WGSLSPIRVAssembly:
+ byteAddressBufferOptions.scalarizeVectorLoadStore = true;
+ byteAddressBufferOptions.treatGetEquivalentStructuredBufferAsGetThis = true;
+ byteAddressBufferOptions.translateToStructuredBufferOps = false;
+ byteAddressBufferOptions.lowerBasicTypeOps = true;
+ byteAddressBufferOptions.useBitCastFromUInt = true;
+ break;
}
// We also need to decide whether to translate