2024-01-17 09:45:31 -08:00
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
shader model < 6.0
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Annotations on techniques
|
|
|
|
technique10 t1 < int a = 1; > {}
|
|
|
|
technique10 t2 < int a = 2; int t1 = 3; int t2 = 4; > {}
|
|
|
|
|
2024-07-09 06:11:47 -07:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Annotations on passes
|
|
|
|
technique10 t1 < int a = 1; >
|
|
|
|
{
|
|
|
|
pass < int t1 = 2; > {}
|
|
|
|
}
|
|
|
|
|
2024-07-09 06:11:47 -07:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Using names from the global scope
|
|
|
|
float a;
|
|
|
|
|
|
|
|
technique10 t1 < int a = 1; >
|
|
|
|
{
|
|
|
|
pass < int a = 2; > {}
|
|
|
|
}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Evaluated literal constant expression for initial values
|
|
|
|
technique10 < int a = 1+2; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Using constant variables in the initializer
|
|
|
|
static const int b = 123;
|
|
|
|
technique10 < int a = b; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Implicitly sized array
|
|
|
|
technique10 < float a[] = {1, 2}; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Nested braces
|
|
|
|
technique10 < float4 a = {1, {{{2, {3}}, 4}}}; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Flattening
|
|
|
|
technique10 < float4 a = {1, float2(2, 3), 4}; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Comma separated initializers
|
|
|
|
technique10 < int a = 1, b = 2; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Majority modifier
|
|
|
|
technique10 < row_major float3x2 m = {1, 2, 3, 4, 5, 6}; > {}
|
|
|
|
|
2024-07-09 05:58:50 -07:00
|
|
|
[effect]
|
|
|
|
float4 var : SEMANTIC < int a = 123; > = 123;
|
|
|
|
technique10 {}
|
|
|
|
|
|
|
|
[effect]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float var < > = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
technique10 {}
|
|
|
|
|
2024-08-17 13:23:46 -07:00
|
|
|
[effect]
|
|
|
|
technique10 < string a = "test"; > {}
|
|
|
|
|
2024-01-17 09:45:31 -08:00
|
|
|
[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; > {}
|
|
|
|
}
|
|
|
|
|
2024-06-15 14:44:08 -07:00
|
|
|
[effect fail]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Without initializer
|
|
|
|
technique10 < int a; > {}
|
|
|
|
|
2024-10-01 07:36:56 -07:00
|
|
|
[effect fail]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Only numeric types and strings are allowed
|
|
|
|
technique10 < DepthStencilState ds = { 0 }; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect fail todo]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Type declarations are not allowed
|
|
|
|
technique10 < struct s { int a; } var = { 2 }; > {}
|
|
|
|
|
2023-11-13 17:27:15 -08:00
|
|
|
[effect fail todo]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Static modifier is not allowed
|
|
|
|
technique10 < static int a = 5; > {}
|
|
|
|
|
2024-06-15 10:56:25 -07:00
|
|
|
[effect fail]
|
2024-01-17 09:45:31 -08:00
|
|
|
// Initializer should not depend on other annotations
|
|
|
|
technique10 < int a = 1, b = a; > {}
|
|
|
|
|
2024-06-15 10:56:25 -07:00
|
|
|
[effect fail]
|
2024-01-17 09:45:31 -08:00
|
|
|
technique10 < int a = 1; int b = a; > {}
|
2024-07-09 05:58:50 -07:00
|
|
|
|
|
|
|
[effect fail]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float var < int a = 1; > = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
technique10 {}
|