summaryrefslogtreecommitdiffstats
path: root/tests/bugs/rwstructuredbuffer-existential-in-struct.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-01-22 09:22:45 -0800
committerGitHub <noreply@github.com>2021-01-22 09:22:45 -0800
commit76db3366cb6cfb5432e5d26acb67e5a96224900e (patch)
tree32b9b969b99a47c3d5de7bcdf61cf1fbfc724439 /tests/bugs/rwstructuredbuffer-existential-in-struct.slang
parentdc063e58ec0d937465566edeea70b112e4d3e72c (diff)
Fix existential specialization of mutable buffer loads. (#1671)
* Fix existential specialization of mutable buffer loads. * fix Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/bugs/rwstructuredbuffer-existential-in-struct.slang')
-rw-r--r--tests/bugs/rwstructuredbuffer-existential-in-struct.slang32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs/rwstructuredbuffer-existential-in-struct.slang b/tests/bugs/rwstructuredbuffer-existential-in-struct.slang
new file mode 100644
index 000000000..c763dd3c1
--- /dev/null
+++ b/tests/bugs/rwstructuredbuffer-existential-in-struct.slang
@@ -0,0 +1,32 @@
+//TEST(compute):COMPARE_COMPUTE:-dx11 -shaderobj
+
+[anyValueSize(8)]
+interface IMaterial
+{
+ float eval();
+}
+
+struct MaterialImpl : IMaterial
+{
+ float eval() { return 0.0f; }
+};
+
+struct Parameters
+{
+ uint ordinary;
+
+//TEST_INPUT: entryPointExistentialType MaterialImpl
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0], stride=4):name=params.materials
+ RWStructuredBuffer<IMaterial> materials;
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=params.result
+ RWStructuredBuffer<float> result;
+};
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID, uniform Parameters params, uniform int id)
+{
+ uint tid = dispatchThreadID.x;
+ float rs = params.materials[0].eval();
+ params.result[tid] = rs;
+}