yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeAllow non-static const to be considered compile-time constant. (#3645)c6756d76f

master
313 B14 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry PSMain -stage fragment
2struct PSInput
3{
4	float4 color : COLOR;
5};
6
7// CHECK: OpEntryPoint
8
9float4 PSMain(PSInput input) : SV_TARGET
10{
11    const int nTaps = 2;
12    const float flOffsets[ nTaps ] = { 0.0, 0.1 };
13    return input.color.rgba + flOffsets[0].xxxx;
14}