From d27557d9b770810402a0bf99bcd891c145a1a69d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 8 Apr 2021 14:45:11 -0400 Subject: Test for specialization problem with undefined resource (#1785) * #include an absolute path didn't work - because paths were taken to always be relative. * Test for bug around specialization. --- .../specialize-with-undefined-resource.slang | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/current-bugs/specialize-with-undefined-resource.slang diff --git a/tests/current-bugs/specialize-with-undefined-resource.slang b/tests/current-bugs/specialize-with-undefined-resource.slang new file mode 100644 index 000000000..50b006368 --- /dev/null +++ b/tests/current-bugs/specialize-with-undefined-resource.slang @@ -0,0 +1,36 @@ +//DISABLE_TEST:SIMPLE:-target dxil -entry computeMain -profile cs_6_2 + +struct ValueContainer +{ + Texture2D values; + + uint getValue(uint2 at) + { + return values[at]; + } +}; + +ParameterBlock gContainer; + +Texture2D gValues; + +RWStructuredBuffer outputBuffer; + +[numthreads(4, 4, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + ValueContainer container; + + // This will work + // container = gContainer; + // Or just setting directly + // container.values = gValues; + + // But if values in container is not .... then specialization fails + // and invalid HLSL is output. + + uint2 pos = dispatchThreadID.xy; + + outputBuffer[pos.x + pos.y] = container.getValue(pos); +} + -- cgit v1.2.3