mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests/hlsl: Add some tests for annotations.
This commit is contained in:
parent
232b2ad360
commit
341963bbec
Notes:
Alexandre Julliard
2024-01-23 23:03:23 +01:00
Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/565
@ -47,6 +47,7 @@ vkd3d_shader_tests = \
|
|||||||
tests/hlsl/abs.shader_test \
|
tests/hlsl/abs.shader_test \
|
||||||
tests/hlsl/all.shader_test \
|
tests/hlsl/all.shader_test \
|
||||||
tests/hlsl/angle-unit.shader_test \
|
tests/hlsl/angle-unit.shader_test \
|
||||||
|
tests/hlsl/annotations.shader_test \
|
||||||
tests/hlsl/any.shader_test \
|
tests/hlsl/any.shader_test \
|
||||||
tests/hlsl/arithmetic-float-uniform.shader_test \
|
tests/hlsl/arithmetic-float-uniform.shader_test \
|
||||||
tests/hlsl/arithmetic-float.shader_test \
|
tests/hlsl/arithmetic-float.shader_test \
|
||||||
|
90
tests/hlsl/annotations.shader_test
Normal file
90
tests/hlsl/annotations.shader_test
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
[require]
|
||||||
|
shader model >= 4.0
|
||||||
|
shader model < 6.0
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Annotations on techniques
|
||||||
|
technique10 t1 < int a = 1; > {}
|
||||||
|
technique10 t2 < int a = 2; int t1 = 3; int t2 = 4; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Annotations on passes
|
||||||
|
technique10 t1 < int a = 1; >
|
||||||
|
{
|
||||||
|
pass < int t1 = 2; > {}
|
||||||
|
}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Using names from the global scope
|
||||||
|
float a;
|
||||||
|
|
||||||
|
technique10 t1 < int a = 1; >
|
||||||
|
{
|
||||||
|
pass < int a = 2; > {}
|
||||||
|
}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Evaluated literal constant expression for initial values
|
||||||
|
technique10 < int a = 1+2; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Using constant variables in the initializer
|
||||||
|
static const int b = 123;
|
||||||
|
technique10 < int a = b; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Implicitly sized array
|
||||||
|
technique10 < float a[] = {1, 2}; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Nested braces
|
||||||
|
technique10 < float4 a = {1, {{{2, {3}}, 4}}}; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Flattening
|
||||||
|
technique10 < float4 a = {1, float2(2, 3), 4}; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Comma separated initializers
|
||||||
|
technique10 < int a = 1, b = 2; > {}
|
||||||
|
|
||||||
|
[effect todo]
|
||||||
|
// Majority modifier
|
||||||
|
technique10 < row_major float3x2 m = {1, 2, 3, 4, 5, 6}; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Without closing semicolon
|
||||||
|
technique10 t1 < int a = 1 > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Redefinition
|
||||||
|
technique10 < int a = 0; float a = 1.0; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
technique10
|
||||||
|
{
|
||||||
|
pass < int a = 0; float a = 1.0; > {}
|
||||||
|
}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Without initializer
|
||||||
|
technique10 < int a; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Only numeric types and strings are allowed
|
||||||
|
technique10 < DepthStencilState ds = { 0 }; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Type declarations are not allowed
|
||||||
|
technique10 < struct s { int a; } var = { 2 }; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Static modifier is not allowed
|
||||||
|
technique10 < static int a = 5; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
// Initializer should not depend on other annotations
|
||||||
|
technique10 < int a = 1, b = a; > {}
|
||||||
|
|
||||||
|
[effect fail]
|
||||||
|
technique10 < int a = 1; int b = a; > {}
|
Loading…
Reference in New Issue
Block a user