summaryrefslogtreecommitdiff
path: root/tests/front-end
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front-end')
-rw-r--r--tests/front-end/uav-write.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/front-end/uav-write.slang b/tests/front-end/uav-write.slang
new file mode 100644
index 000000000..c70af26a3
--- /dev/null
+++ b/tests/front-end/uav-write.slang
@@ -0,0 +1,20 @@
+// uav-write.slang
+//TEST:SIMPLE:
+
+// Just confirming that code that writes to a UAV will type-check.
+
+RWTexture2D<float4> gOutput;
+
+float4 test(uint2 coord, float4 value)
+{
+ // read
+ value = value + gOutput[coord];
+
+ // write
+ gOutput[coord] = value;
+
+ // read-modify-write
+ gOutput[coord] += value;
+
+ return value;
+} \ No newline at end of file