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