mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/fx: Add support for writing annotations for fx_2_0.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Henri Verbeet
parent
c9c537faa0
commit
300e4e0d12
Notes:
Henri Verbeet
2024-09-30 21:05:32 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1120
110
tests/hlsl/effect-annotations-fx_2.shader_test
Normal file
110
tests/hlsl/effect-annotations-fx_2.shader_test
Normal file
@@ -0,0 +1,110 @@
|
||||
[require]
|
||||
shader model < 3.0
|
||||
|
||||
[effect]
|
||||
// Annotations on techniques
|
||||
technique t1 < int a = 1; > {}
|
||||
technique t2 < int a = 2; int t1 = 3; int t2 = 4; > {}
|
||||
|
||||
[effect]
|
||||
// Annotations on passes
|
||||
technique t1 < int a = 1; >
|
||||
{
|
||||
pass < int t1 = 2; > {}
|
||||
}
|
||||
|
||||
[effect]
|
||||
// Using names from the global scope
|
||||
float a;
|
||||
|
||||
technique t1 < int a = 1; >
|
||||
{
|
||||
pass < int a = 2; > {}
|
||||
}
|
||||
|
||||
[effect]
|
||||
// Evaluated literal constant expression for initial values
|
||||
technique < int a = 1+2; > {}
|
||||
|
||||
[effect]
|
||||
// Using constant variables in the initializer
|
||||
static const int b = 123;
|
||||
technique < int a = b; > {}
|
||||
|
||||
[effect]
|
||||
// Implicitly sized array
|
||||
technique < float a[] = {1, 2}; > {}
|
||||
|
||||
[effect]
|
||||
// Nested braces
|
||||
technique < float4 a = {1, {{{2, {3}}, 4}}}; > {}
|
||||
|
||||
[effect]
|
||||
// Flattening
|
||||
technique < float4 a = {1, float2(2, 3), 4}; > {}
|
||||
|
||||
[effect]
|
||||
// Comma separated initializers
|
||||
technique < int a = 1, b = 2; > {}
|
||||
|
||||
[effect]
|
||||
// Majority modifier
|
||||
technique < row_major float3x2 m = {1, 2, 3, 4, 5, 6}; > {}
|
||||
|
||||
[effect]
|
||||
float4 var : SEMANTIC < int a = 123; > = 123;
|
||||
technique {}
|
||||
|
||||
[effect]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float var < > = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
technique {}
|
||||
|
||||
[effect todo]
|
||||
technique < string a = "test"; > {}
|
||||
|
||||
[effect fail]
|
||||
// Without closing semicolon
|
||||
technique t1 < int a = 1 > {}
|
||||
|
||||
[effect fail]
|
||||
// Redefinition
|
||||
technique < int a = 0; float a = 1.0; > {}
|
||||
|
||||
[effect fail]
|
||||
technique
|
||||
{
|
||||
pass < int a = 0; float a = 1.0; > {}
|
||||
}
|
||||
|
||||
[effect fail]
|
||||
// Without initializer
|
||||
technique < int a; > {}
|
||||
|
||||
[effect fail todo]
|
||||
// Type declarations are not allowed
|
||||
technique < struct s { int a; } var = { 2 }; > {}
|
||||
|
||||
[effect fail todo]
|
||||
// Static modifier is not allowed
|
||||
technique < static int a = 5; > {}
|
||||
|
||||
[effect fail]
|
||||
// Initializer should not depend on other annotations
|
||||
technique < int a = 1, b = a; > {}
|
||||
|
||||
[effect fail]
|
||||
technique < int a = 1; int b = a; > {}
|
||||
|
||||
[effect fail]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float var < int a = 1; > = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
technique {}
|
Reference in New Issue
Block a user