From 4d286aab2ec23c081f23846f5dfdb30b1c05728b Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:59:49 -0600 Subject: 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. --- tests/metal/test_buffer.slang | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/metal/test_buffer.slang (limited to 'tests/metal') 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 maps to texture_buffer in Metal + +//TEST:SIMPLE(filecheck=METAL): -stage compute -entry computeMain -target metal + + +// METAL: texture_buffer inputBuffer_{{.*}} +Buffer inputBuffer; + +RWStructuredBuffer 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); +} -- cgit v1.2.3