HLSL: implement [unroll] and [loop] attributes
This adds infrastructure suitable for any front end to create SPIR-V loop control flags. The only current front end doing so is HLSL. [unroll] turns into spv::LoopControlUnrollMask [loop] turns into spv::LoopControlDontUnrollMask no specification means spv::LoopControlMaskNone
This commit is contained in:
14
Test/hlsl.loopattr.frag
Normal file
14
Test/hlsl.loopattr.frag
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
float4 main() : SV_Target0
|
||||
{
|
||||
// Unroll hint
|
||||
[unroll(5) ] for (int x=0; x<5; ++x);
|
||||
|
||||
// Don't unroll hint
|
||||
[loop] for (int y=0; y<5; ++y);
|
||||
|
||||
// No hint
|
||||
for (int z=0; z<5; ++z);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user