From c6756d76fd70424f5b3bd1d910a5afc46dc7c83e Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 28 Feb 2024 23:26:51 -0800 Subject: Allow non-static const to be considered compile-time constant. (#3645) --- tests/bugs/gh-3643.slang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/bugs/gh-3643.slang (limited to 'tests/bugs') diff --git a/tests/bugs/gh-3643.slang b/tests/bugs/gh-3643.slang new file mode 100644 index 000000000..5d8d8191c --- /dev/null +++ b/tests/bugs/gh-3643.slang @@ -0,0 +1,14 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry PSMain -stage fragment +struct PSInput +{ + float4 color : COLOR; +}; + +// CHECK: OpEntryPoint + +float4 PSMain(PSInput input) : SV_TARGET +{ + const int nTaps = 2; + const float flOffsets[ nTaps ] = { 0.0, 0.1 }; + return input.color.rgba + flOffsets[0].xxxx; +} \ No newline at end of file -- cgit v1.2.3