summaryrefslogtreecommitdiff
path: root/tests/compute/rewriter-parameter-block.slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-12-08 14:23:12 -0800
committerGitHub <noreply@github.com>2017-12-08 14:23:12 -0800
commit0f55649cc1aa8ad3218b7f8ba7b1eabdd2ec6526 (patch)
tree0dc7fd5e88fbc530dc121946f4a20085aa5518d8 /tests/compute/rewriter-parameter-block.slang
parent301cdf5ef42797b1073d9e6c741ef0ba98a38792 (diff)
Cleanups to `ParameterBlock<T>` behavior. (#304)
* Cleanups to `ParameterBlock<T>` behavior. These add some more realistic tests using the `ParameterBlock<T>` support, and show that it can work with the "rewriter" mode. Unfortunately, this code does *not* currently work with the rewriter + the IR at once. That will need to be fixed in a follow-on change, because I now see that the root problem is pretty ugly. * cleanup
Diffstat (limited to 'tests/compute/rewriter-parameter-block.slang')
-rw-r--r--tests/compute/rewriter-parameter-block.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/compute/rewriter-parameter-block.slang b/tests/compute/rewriter-parameter-block.slang
new file mode 100644
index 000000000..830f22f4e
--- /dev/null
+++ b/tests/compute/rewriter-parameter-block.slang
@@ -0,0 +1,25 @@
+// rewriter-parameter-block.slang
+//TEST_IGNORE_FILE:
+
+// A type that mixes uniform and resource fields
+struct Data
+{
+ int val;
+ RWStructuredBuffer<int> buf;
+};
+
+// A function that uses that type
+int test(Data data, int val)
+{
+ return data.val + data.buf[val];
+}
+
+// A global-scope parameter block of the mixed type
+ParameterBlock<Data> gA;
+
+// A constant buffer declaration containing the mixed type
+cbuffer C
+{
+ int extra;
+ ParameterBlock<Data> gB;
+};