From 7f36c34daf633dcade3a3bab9cdcf14a34fed3cd Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 5 Apr 2022 13:32:24 -0400 Subject: Handling static const variables in generics (#2171) * #include an absolute path didn't work - because paths were taken to always be relative. * Meta-2 test works. * Add new generic test for static const variable in a function in a generic. * Generic function with static const variable doesn't work. --- tests/bugs/meta-2.slang | 18 ++++++++++++++++++ tests/bugs/meta-2.slang.expected.txt | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 tests/bugs/meta-2.slang create mode 100644 tests/bugs/meta-2.slang.expected.txt (limited to 'tests/bugs') diff --git a/tests/bugs/meta-2.slang b/tests/bugs/meta-2.slang new file mode 100644 index 000000000..6dd5541c4 --- /dev/null +++ b/tests/bugs/meta-2.slang @@ -0,0 +1,18 @@ +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer outputBuffer; + +struct GetValue +{ + static const int Value = N; +}; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int index = dispatchThreadID.x; + + outputBuffer[index] = GetValue<10>::Value; +} + diff --git a/tests/bugs/meta-2.slang.expected.txt b/tests/bugs/meta-2.slang.expected.txt new file mode 100644 index 000000000..f7bacac93 --- /dev/null +++ b/tests/bugs/meta-2.slang.expected.txt @@ -0,0 +1,4 @@ +A +A +A +A -- cgit v1.2.3