HLSL: Allow expressions in attributes
For example: [numthreads(2+2, 2*3, (1+FOO)*BAR)] This will result in a thread count (4, 6, 8).
This commit is contained in:
parent
d3f1122a44
commit
a22f7dbb71
4 changed files with 167 additions and 11 deletions
15
Test/hlsl.attribute.expression.comp
Normal file
15
Test/hlsl.attribute.expression.comp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
uniform int bound;
|
||||
|
||||
#define FOO 3
|
||||
#define BAR 2
|
||||
|
||||
[numthreads(2+2, 2*3, (1+FOO)*BAR)]
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
[unroll(5*2 + 1) ]
|
||||
for (int x=0; x<bound; ++x)
|
||||
;
|
||||
|
||||
return float4(0,0,0,0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue