HLSL: Fix #1815: Don't constant fold spec-constant array indexing.
This commit is contained in:
parent
22683b409e
commit
4b4b41a634
4 changed files with 248 additions and 1 deletions
15
Test/hlsl.specConstant.frag
Executable file
15
Test/hlsl.specConstant.frag
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
[[vk::constant_id(0)]] const uint index = 2;
|
||||
|
||||
static const uint array[] = { 10, 20, 30, 40 };
|
||||
|
||||
float4 main( ) : SV_TARGET
|
||||
{
|
||||
float4 r;
|
||||
for(uint i = 0; i < array[index]; i++)
|
||||
r = i;
|
||||
|
||||
r += index + index;
|
||||
r += 2 * index;
|
||||
|
||||
return r;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue