vkd3d/tests/hlsl/effect-annotations-fx_4.shader_test
Nikolay Sivov 300e4e0d12 vkd3d-shader/fx: Add support for writing annotations for fx_2_0.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-09-30 20:02:51 +02:00

116 lines
2.0 KiB
Plaintext

[require]
shader model >= 4.0
shader model < 6.0
[effect]
// Annotations on techniques
technique10 t1 < int a = 1; > {}
technique10 t2 < int a = 2; int t1 = 3; int t2 = 4; > {}
[effect]
// Annotations on passes
technique10 t1 < int a = 1; >
{
pass < int t1 = 2; > {}
}
[effect]
// Using names from the global scope
float a;
technique10 t1 < int a = 1; >
{
pass < int a = 2; > {}
}
[effect]
// Evaluated literal constant expression for initial values
technique10 < int a = 1+2; > {}
[effect]
// Using constant variables in the initializer
static const int b = 123;
technique10 < int a = b; > {}
[effect]
// Implicitly sized array
technique10 < float a[] = {1, 2}; > {}
[effect]
// Nested braces
technique10 < float4 a = {1, {{{2, {3}}, 4}}}; > {}
[effect]
// Flattening
technique10 < float4 a = {1, float2(2, 3), 4}; > {}
[effect]
// Comma separated initializers
technique10 < int a = 1, b = 2; > {}
[effect]
// Majority modifier
technique10 < row_major float3x2 m = {1, 2, 3, 4, 5, 6}; > {}
[effect]
float4 var : SEMANTIC < int a = 123; > = 123;
technique10 {}
[effect]
float4 main() : sv_target
{
float var < > = 0;
return 0;
}
technique10 {}
[effect]
technique10 < string a = "test"; > {}
[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 todo]
// Only numeric types and strings are allowed
technique10 < DepthStencilState ds = { 0 }; > {}
[effect fail todo]
// Type declarations are not allowed
technique10 < struct s { int a; } var = { 2 }; > {}
[effect fail todo]
// 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; > {}
[effect fail]
float4 main() : sv_target
{
float var < int a = 1; > = 0;
return 0;
}
technique10 {}