summaryrefslogtreecommitdiffstats
path: root/tests/compute/empty-struct.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-05-25 10:01:34 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2018-05-25 07:01:34 -0700
commitace9a8dc7e4353b1cf8e846abe2b8dc53ecdbc59 (patch)
tree172670d128c557ede1bccd18c3d1ea5611ff0e94 /tests/compute/empty-struct.slang
parent18709fbaa03fe0ef0727a802d864fae6c5163fc0 (diff)
Fixes 574. Eliminate empty structs during type legalization (#577)
Diffstat (limited to 'tests/compute/empty-struct.slang')
-rw-r--r--tests/compute/empty-struct.slang19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/compute/empty-struct.slang b/tests/compute/empty-struct.slang
new file mode 100644
index 000000000..51094fad5
--- /dev/null
+++ b/tests/compute/empty-struct.slang
@@ -0,0 +1,19 @@
+//TEST(smoke,compute):COMPARE_COMPUTE:
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+// Confirm that generics syntax can be used in user
+// code and generates valid output.
+
+RWStructuredBuffer<float> outputBuffer;
+
+struct Simple
+{
+ float getVal() {return 1.0;}
+};
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ Simple s;
+ float outVal = s.getVal();
+ outputBuffer[dispatchThreadID.x] = outVal;
+} \ No newline at end of file