vkd3d-shader/hlsl: Parse function attributes.

This commit is contained in:
Zebediah Figura
2021-08-16 14:52:10 -05:00
committed by Alexandre Julliard
parent da56f41ceb
commit d6799bd5d3
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
7 changed files with 164 additions and 35 deletions

View File

@@ -2,17 +2,17 @@
% we need to get the parsing syntax right. Most of the following tests which
% succeed print warnings.
[pixel shader todo]
[pixel shader]
[numthreads]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[ numthreads ]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[numthreads(1)]
float4 main() : sv_target { return 0; }
@@ -55,12 +55,12 @@ float4 main() : sv_target { return 0; }
[numthreads(float2(1))]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[not_a_real_attribute_name]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
uniform float4 f;
@@ -72,27 +72,27 @@ float4 main() : sv_target { return 0; }
[one, two]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[one][two]
float4 main() : sv_target { return 0; }
[pixel shader fail]
[pixel shader fail todo]
[one][one]
float4 main() : sv_target { return 0; }
[pixel shader fail]
[pixel shader fail todo]
[one][one(1)]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[one][One]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
[numthreads]
float4 main();
@@ -100,7 +100,7 @@ float4 main();
[numthreads]
float4 main() : sv_target { return 0; }
[pixel shader todo]
[pixel shader]
/* Expressions with side effects are forbidden in attributes—see
* hlsl-numthreads.shader_test for an example—but not if the attribute is

View File

@@ -8,52 +8,52 @@ shader model >= 5.0
[numthreads(1, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, 1, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(0, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, 0, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, 1, 0)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(-1, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, -1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, 1, -1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(1, -1, -1)]
void main() {}
@@ -68,12 +68,12 @@ void main() {}
[numthreads(int(1), 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(float(1), 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
[numthreads(uint1(1), 1, 1)]
void main() {}
@@ -103,7 +103,7 @@ void main() {}
void main() {}
[compute shader fail]
[compute shader fail todo]
[NumThreads(1, 1, 1)]
void main() {}
@@ -115,21 +115,21 @@ void main();
void main() {}
[compute shader fail]
[compute shader fail todo]
void main() {}
[numthreads(1, 1, 1)]
void main();
[compute shader fail]
[compute shader fail todo]
void main();
[numthreads(1, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
/* Expressions with side effects are forbidden in attributes (but not if the
* attribute is ignored). */
@@ -139,14 +139,14 @@ static int x = 1;
[numthreads(x++, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
static int x = 1;
[numthreads(++x, 1, 1)]
void main() {}
[compute shader fail]
[compute shader fail todo]
static int x = 1;