2021-08-16 10:25:41 -07:00
|
|
|
% Test allowed syntax for the "numthreads" attribute.
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(0, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 0, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1, 0)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(-1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, -1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1, -1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, -1, -1)]
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
|
|
|
|
[numthreads(uint(1), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
|
|
|
|
[numthreads(int(1), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(float(1), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(uint1(1), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
|
|
|
|
[numthreads(int(1), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
|
|
|
|
[numthreads(1 + 1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[compute shader fail]
|
|
|
|
|
|
|
|
[numthreads("1", 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[compute shader todo fail(sm>=6)]
|
2021-08-16 10:25:41 -07:00
|
|
|
static int x = 1;
|
|
|
|
|
|
|
|
[numthreads(x, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
void main() {}
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[compute shader fail(sm<6)]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[NumThreads(1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main();
|
|
|
|
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 15:49:09 -07:00
|
|
|
[compute shader fail]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
void main() {}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main();
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[compute shader fail(sm<6)]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
void main();
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
/* Expressions with side effects are forbidden in attributes (but not if the
|
|
|
|
* attribute is ignored). */
|
|
|
|
|
|
|
|
static int x = 1;
|
|
|
|
|
|
|
|
[numthreads(x++, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
static int x = 1;
|
|
|
|
|
|
|
|
[numthreads(++x, 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2021-08-16 12:52:10 -07:00
|
|
|
[compute shader fail todo]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
static int x = 1;
|
|
|
|
|
|
|
|
[numthreads((x = 2), 1, 1)]
|
|
|
|
void main() {}
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[compute shader fail(sm>=6)]
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
static int x = 1;
|
|
|
|
|
|
|
|
[numthreads(++x, 1, 1)]
|
|
|
|
void func() {}
|
|
|
|
|
|
|
|
[bogus(++x)]
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main() { func(); }
|
|
|
|
|
|
|
|
[uav 0]
|
|
|
|
format r32 float
|
2024-01-24 11:11:17 -08:00
|
|
|
size (2d, 2, 2)
|
2021-08-16 10:25:41 -07:00
|
|
|
|
|
|
|
1.0 1.0
|
|
|
|
1.0 1.0
|
|
|
|
|
2021-08-16 17:02:17 -07:00
|
|
|
[compute shader]
|
2023-06-14 19:18:46 -07:00
|
|
|
/* In SM < 6.0, attributes are taken from the first function, and dropped from the second. */
|
2021-08-16 10:25:41 -07:00
|
|
|
RWTexture2D<float> u;
|
|
|
|
|
|
|
|
[numthreads(2, 1, 1)]
|
|
|
|
void main(uint2 id);
|
|
|
|
|
|
|
|
[numthreads(1, 2, 1)]
|
|
|
|
void main(uint2 id : sv_dispatchthreadid)
|
|
|
|
{
|
|
|
|
u[id] = 2.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2023-06-14 19:18:46 -07:00
|
|
|
todo(glsl) dispatch 1 1 1
|
2021-08-16 10:25:41 -07:00
|
|
|
probe uav 0 (0, 0) r (2.0)
|
2023-06-14 19:18:46 -07:00
|
|
|
if(sm<6) probe uav 0 (0, 1) r (1.0)
|
|
|
|
if(sm<6) probe uav 0 (1, 0) r (2.0)
|
2021-08-16 10:25:41 -07:00
|
|
|
probe uav 0 (1, 1) r (1.0)
|
2023-06-14 19:18:46 -07:00
|
|
|
if(sm>=6) probe uav 0 (0, 1) r (2.0)
|
|
|
|
if(sm>=6) probe uav 0 (1, 0) r (1.0)
|