mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
tests: Add some tests for HLSL attribute syntax.
This commit is contained in:
committed by
Alexandre Julliard
parent
4d17758657
commit
c0782a9029
Notes:
Alexandre Julliard
2022-11-08 23:05:16 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/43
192
tests/hlsl-numthreads.shader_test
Normal file
192
tests/hlsl-numthreads.shader_test
Normal file
@ -0,0 +1,192 @@
|
||||
% Test allowed syntax for the "numthreads" attribute.
|
||||
|
||||
[require]
|
||||
shader model >= 5.0
|
||||
|
||||
[compute shader todo]
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, 1, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(0, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, 0, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, 1, 0)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(-1, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, -1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(1, 1, -1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[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() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[numthreads(float(1), 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[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() {}
|
||||
|
||||
[compute shader todo]
|
||||
static int x = 1;
|
||||
|
||||
[numthreads(x, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail todo]
|
||||
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
[NumThreads(1, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader todo]
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main();
|
||||
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
void main() {}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main();
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
void main();
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
/* 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() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
static int x = 1;
|
||||
|
||||
[numthreads(++x, 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader fail]
|
||||
|
||||
static int x = 1;
|
||||
|
||||
[numthreads((x = 2), 1, 1)]
|
||||
void main() {}
|
||||
|
||||
[compute shader todo]
|
||||
|
||||
static int x = 1;
|
||||
|
||||
[numthreads(++x, 1, 1)]
|
||||
void func() {}
|
||||
|
||||
[bogus(++x)]
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() { func(); }
|
||||
|
||||
[uav 0]
|
||||
format r32 float
|
||||
size (2, 2)
|
||||
|
||||
1.0 1.0
|
||||
1.0 1.0
|
||||
|
||||
[compute shader todo]
|
||||
/* Attributes are taken from the first function, and dropped from the second. */
|
||||
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]
|
||||
todo dispatch 1 1 1
|
||||
probe uav 0 (0, 0) r (2.0)
|
||||
probe uav 0 (0, 1) r (1.0)
|
||||
probe uav 0 (1, 0) r (2.0)
|
||||
probe uav 0 (1, 1) r (1.0)
|
Reference in New Issue
Block a user