From 0f55649cc1aa8ad3218b7f8ba7b1eabdd2ec6526 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 8 Dec 2017 14:23:12 -0800 Subject: Cleanups to `ParameterBlock` behavior. (#304) * Cleanups to `ParameterBlock` behavior. These add some more realistic tests using the `ParameterBlock` 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 --- .../compute/rewriter-parameter-block-complex.slang | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/compute/rewriter-parameter-block-complex.slang (limited to 'tests/compute/rewriter-parameter-block-complex.slang') diff --git a/tests/compute/rewriter-parameter-block-complex.slang b/tests/compute/rewriter-parameter-block-complex.slang new file mode 100644 index 000000000..826dd5047 --- /dev/null +++ b/tests/compute/rewriter-parameter-block-complex.slang @@ -0,0 +1,21 @@ +// rewriter-parameter-block.slang +//TEST_IGNORE_FILE: + +// A type that mixes uniform and resource fields +struct Data +{ + int val; + RWStructuredBuffer buf; +}; + +// A function that uses that type +int test(Data data, int val) +{ + return data.val + data.buf[val]; +} + +cbuffer C +{ + ParameterBlock gA; + Data gB; +}; -- cgit v1.2.3