summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/compute/write-structured-buffer-field.slang19
-rw-r--r--tests/compute/write-structured-buffer-field.slang.expected.txt32
-rw-r--r--tests/ir/loop.slang.expected7
3 files changed, 55 insertions, 3 deletions
diff --git a/tests/compute/write-structured-buffer-field.slang b/tests/compute/write-structured-buffer-field.slang
new file mode 100644
index 000000000..b824644b2
--- /dev/null
+++ b/tests/compute/write-structured-buffer-field.slang
@@ -0,0 +1,19 @@
+//TEST(compute):COMPARE_COMPUTE:-xslang -use-ir
+
+//TEST_INPUT:ubuffer(data=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32], stride=32):dxbinding(0),glbinding(0),out
+
+struct S
+{
+ int4 a;
+ int4 b;
+};
+
+RWStructuredBuffer<S> outputBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ uint tid = dispatchThreadID.x;
+
+ outputBuffer[tid].b.y = outputBuffer[0].a.x;
+} \ No newline at end of file
diff --git a/tests/compute/write-structured-buffer-field.slang.expected.txt b/tests/compute/write-structured-buffer-field.slang.expected.txt
new file mode 100644
index 000000000..475b4f578
--- /dev/null
+++ b/tests/compute/write-structured-buffer-field.slang.expected.txt
@@ -0,0 +1,32 @@
+1
+2
+3
+4
+5
+1
+7
+8
+9
+A
+B
+C
+D
+1
+F
+10
+11
+12
+13
+14
+15
+1
+17
+18
+19
+1A
+1B
+1C
+1D
+1
+1F
+20
diff --git a/tests/ir/loop.slang.expected b/tests/ir/loop.slang.expected
index 720f80091..ab7ad687c 100644
--- a/tests/ir/loop.slang.expected
+++ b/tests/ir/loop.slang.expected
@@ -73,9 +73,10 @@ block %16:
call(@_S031GroupMemoryBarrierWithGroupSyncp0pV)
let %40 : RWStructuredBuffer<vector<float,4>> = load(@_SV06output)
let %41 : uint = load(%5)
- let %42 : Ptr<vector<float,4>> = getElementPtr(@_SV01s, 0)
- let %43 : vector<float,4> = load(%42)
- bufferStore(%40, %41, %43)
+ let %42 : Ptr<vector<float,4>> = bufferElementRef(%40, %41)
+ let %43 : Ptr<vector<float,4>> = getElementPtr(@_SV01s, 0)
+ let %44 : vector<float,4> = load(%43)
+ store(%42, %44)
return_void()
}