diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-02-20 18:59:49 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-20 16:59:49 -0800 |
| commit | 4d286aab2ec23c081f23846f5dfdb30b1c05728b (patch) | |
| tree | 98be13f2d72d90d69901d463a94c292d562cee67 /tests/metal/test_buffer.slang | |
| parent | 19867ffca6dca7995c799354081219c9e76f13d1 (diff) | |
Metal fix (#6413)
Partially fix #6378
* Fix invalid access mode for texture_buffer
* Fix texture view create issue in metal
In newTextureView, levelRange should represent the mipmap level range,
while sliceRange should represent the texture layer range for texture
array. But the implement inverse those two wrongly.
Diffstat (limited to 'tests/metal/test_buffer.slang')
| -rw-r--r-- | tests/metal/test_buffer.slang | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/metal/test_buffer.slang b/tests/metal/test_buffer.slang new file mode 100644 index 000000000..122af3b9a --- /dev/null +++ b/tests/metal/test_buffer.slang @@ -0,0 +1,17 @@ +// Test that Buffer<T> maps to texture_buffer<uint, access::read> in Metal + +//TEST:SIMPLE(filecheck=METAL): -stage compute -entry computeMain -target metal + + +// METAL: texture_buffer<uint, access::read> inputBuffer_{{.*}} +Buffer<uint> inputBuffer; + +RWStructuredBuffer<uint> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dtid : SV_DispatchThreadID) +{ + uint idx = dtid.x; + // Load values from the buffer to verify correct access + outputBuffer[idx] = inputBuffer.Load(idx); +} |
