Initial implementation of direct-mapped subset of HLSL intrinsics with type subset.
This checkin implements about half of the HLSL intrinsics for a subset of their entire type support (but a useful subset). The uncommented lines in TBuiltInParseablesHlsl::identifyBuiltIns shows which are connected.
This commit is contained in:
		
							parent
							
								
									85b52f304d
								
							
						
					
					
						commit
						4b67732c13
					
				| @ -1,5 +1,5 @@ | |||||||
| hlsl.assoc.frag | hlsl.assoc.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) | 0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -35,7 +35,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) | 0:12  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -76,7 +76,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 9  "a1" |                               Name 9  "a1" | ||||||
|                               Name 10  "a2" |                               Name 10  "a2" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.float1.frag | hlsl.float1.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 1-component vector of float) | 0:1  move second child to first child (temp 1-component vector of float) | ||||||
| @ -31,7 +31,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 1-component vector of float) | 0:1  move second child to first child (temp 1-component vector of float) | ||||||
| @ -68,7 +68,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 11  "ShaderFunction(vf1;f1;" |                               Name 11  "ShaderFunction(vf1;f1;" | ||||||
|                               Name 9  "inFloat1" |                               Name 9  "inFloat1" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.float4.frag | hlsl.float4.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 4-component vector of float) | 0:1  move second child to first child (temp 4-component vector of float) | ||||||
| @ -24,7 +24,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 4-component vector of float) | 0:1  move second child to first child (temp 4-component vector of float) | ||||||
| @ -54,7 +54,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 11  "ShaderFunction(vf4;" |                               Name 11  "ShaderFunction(vf4;" | ||||||
|                               Name 10  "input" |                               Name 10  "input" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.frag | hlsl.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 4-component vector of float) | 0:1  move second child to first child (temp 4-component vector of float) | ||||||
| @ -64,7 +64,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 4-component vector of float) | 0:1  move second child to first child (temp 4-component vector of float) | ||||||
| @ -134,7 +134,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 9  "input" |                               Name 9  "input" | ||||||
|                               Name 12  "AmbientIntensity" |                               Name 12  "AmbientIntensity" | ||||||
|  | |||||||
							
								
								
									
										2178
									
								
								Test/baseResults/hlsl.intrinsics.frag.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2178
									
								
								Test/baseResults/hlsl.intrinsics.frag.out
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1994
									
								
								Test/baseResults/hlsl.intrinsics.vert.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1994
									
								
								Test/baseResults/hlsl.intrinsics.vert.out
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,5 +1,5 @@ | |||||||
| hlsl.matType.frag | hlsl.matType.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 1-component vector of float) | 0:1  move second child to first child (temp 1-component vector of float) | ||||||
| @ -22,7 +22,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:1  move second child to first child (temp 1-component vector of float) | 0:1  move second child to first child (temp 1-component vector of float) | ||||||
| @ -51,7 +51,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 11  "ShaderFunction(vf1;f1;" |                               Name 11  "ShaderFunction(vf1;f1;" | ||||||
|                               Name 9  "inFloat1" |                               Name 9  "inFloat1" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.max.frag | hlsl.max.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:5  Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) | 0:5  Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -17,7 +17,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:5  Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) | 0:5  Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -40,7 +40,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 9  "input1" |                               Name 9  "input1" | ||||||
|                               Name 11  "input2" |                               Name 11  "input2" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.precedence.frag | hlsl.precedence.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:10  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) | 0:10  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -23,7 +23,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:10  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) | 0:10  Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) | ||||||
| @ -52,7 +52,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 9  "a1" |                               Name 9  "a1" | ||||||
|                               Name 11  "a2" |                               Name 11  "a2" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.precedence2.frag | hlsl.precedence2.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:10  Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) | 0:10  Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) | ||||||
| @ -31,7 +31,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:10  Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) | 0:10  Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) | ||||||
| @ -68,7 +68,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 8  "a1" |                               Name 8  "a1" | ||||||
|                               Name 10  "a2" |                               Name 10  "a2" | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| hlsl.sin.frag | hlsl.sin.frag | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:5  Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) | 0:5  Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) | ||||||
| @ -15,7 +15,7 @@ gl_FragCoord origin is upper left | |||||||
| Linked fragment stage: | Linked fragment stage: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Shader version: 100 | Shader version: 450 | ||||||
| gl_FragCoord origin is upper left | gl_FragCoord origin is upper left | ||||||
| 0:? Sequence | 0:? Sequence | ||||||
| 0:5  Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) | 0:5  Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) | ||||||
| @ -36,7 +36,7 @@ gl_FragCoord origin is upper left | |||||||
|                               MemoryModel Logical GLSL450 |                               MemoryModel Logical GLSL450 | ||||||
|                               EntryPoint Fragment 4  "PixelShaderFunction" |                               EntryPoint Fragment 4  "PixelShaderFunction" | ||||||
|                               ExecutionMode 4 OriginUpperLeft |                               ExecutionMode 4 OriginUpperLeft | ||||||
|                               Source HLSL 100 |                               Source HLSL 450 | ||||||
|                               Name 4  "PixelShaderFunction" |                               Name 4  "PixelShaderFunction" | ||||||
|                               Name 9  "input" |                               Name 9  "input" | ||||||
|                2:             TypeVoid |                2:             TypeVoid | ||||||
|  | |||||||
							
								
								
									
										353
									
								
								Test/hlsl.intrinsics.frag
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										353
									
								
								Test/hlsl.intrinsics.frag
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,353 @@ | |||||||
|  | float PixelShaderFunction(float inF0, float inF1, float inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(7); | ||||||
|  |     ddx(inF0); | ||||||
|  |     ddx_coarse(inF0); | ||||||
|  |     ddx_fine(inF0); | ||||||
|  |     ddy(inF0); | ||||||
|  |     ddy_coarse(inF0); | ||||||
|  |     ddy_fine(inF0); | ||||||
|  |     degrees(inF0); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reversebits(2); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     return 0.0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float1 PixelShaderFunction(float1 inF0, float1 inF1, float1 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return 0.0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int2(7,3)); | ||||||
|  |     ddx(inF0); | ||||||
|  |     ddx_coarse(inF0); | ||||||
|  |     ddx_fine(inF0); | ||||||
|  |     ddy(inF0); | ||||||
|  |     ddy_coarse(inF0); | ||||||
|  |     ddy_fine(inF0); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int2(1,2)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float2(1,2); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int3(7,3,5)); | ||||||
|  |     cross(inF0, inF1); | ||||||
|  |     ddx(inF0); | ||||||
|  |     ddx_coarse(inF0); | ||||||
|  |     ddx_fine(inF0); | ||||||
|  |     ddy(inF0); | ||||||
|  |     ddy_coarse(inF0); | ||||||
|  |     ddy_fine(inF0); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int3(1,2,3)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float3(1,2,3); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int4(7,3,5,2)); | ||||||
|  |     ddx(inF0); | ||||||
|  |     ddx_coarse(inF0); | ||||||
|  |     ddx_fine(inF0); | ||||||
|  |     ddy(inF0); | ||||||
|  |     ddy_coarse(inF0); | ||||||
|  |     ddy_fine(inF0); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int4(1,2,3,4)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float4(1,2,3,4); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  | #define MATFNS() \ | ||||||
|  |     all(inF0); \ | ||||||
|  |     abs(inF0); \ | ||||||
|  |     acos(inF0); \ | ||||||
|  |     any(inF0); \ | ||||||
|  |     asin(inF0); \ | ||||||
|  |     atan(inF0); \ | ||||||
|  |     atan2(inF0, inF1); \ | ||||||
|  |     ceil(inF0); \ | ||||||
|  |     clamp(inF0, inF1, inF2); \ | ||||||
|  |     cos(inF0); \ | ||||||
|  |     cosh(inF0); \ | ||||||
|  |     ddx(inF0); \ | ||||||
|  |     ddx_coarse(inF0); \ | ||||||
|  |     ddx_fine(inF0); \ | ||||||
|  |     ddy(inF0); \ | ||||||
|  |     ddy_coarse(inF0); \ | ||||||
|  |     ddy_fine(inF0); \ | ||||||
|  |     degrees(inF0); \ | ||||||
|  |     determinant(inF0); \ | ||||||
|  |     exp(inF0); \ | ||||||
|  |     exp2(inF0); \ | ||||||
|  |     firstbithigh(7); \ | ||||||
|  |     firstbitlow(7); \ | ||||||
|  |     floor(inF0); \ | ||||||
|  |     fmod(inF0, inF1); \ | ||||||
|  |     frac(inF0); \ | ||||||
|  |     frexp(inF0, inF1); \ | ||||||
|  |     fwidth(inF0); \ | ||||||
|  |     ldexp(inF0, inF1); \ | ||||||
|  |     log(inF0); \ | ||||||
|  |     log2(inF0); \ | ||||||
|  |     max(inF0, inF1); \ | ||||||
|  |     min(inF0, inF1); \ | ||||||
|  |     pow(inF0, inF1); \ | ||||||
|  |     radians(inF0); \ | ||||||
|  |     round(inF0); \ | ||||||
|  |     rsqrt(inF0); \ | ||||||
|  |     sign(inF0); \ | ||||||
|  |     sin(inF0); \ | ||||||
|  |     sinh(inF0); \ | ||||||
|  |     smoothstep(inF0, inF1, inF2); \ | ||||||
|  |     sqrt(inF0); \ | ||||||
|  |     step(inF0, inF1); \ | ||||||
|  |     tan(inF0); \ | ||||||
|  |     tanh(inF0); \ | ||||||
|  |     transpose(inF0); \ | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  | // TODO: turn on non-square matrix tests when protos are available. | ||||||
|  | 
 | ||||||
|  | float2x2 PixelShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float2x2(2,2,2,2); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float3x3(3,3,3,3,3,3,3,3,3); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float4x4 PixelShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); | ||||||
|  | } | ||||||
							
								
								
									
										323
									
								
								Test/hlsl.intrinsics.vert
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										323
									
								
								Test/hlsl.intrinsics.vert
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,323 @@ | |||||||
|  | float VertexShaderFunction(float inF0, float inF1, float inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(7); | ||||||
|  |     degrees(inF0); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reversebits(2); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     return 0.0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return 0.0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int2(7,3)); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int2(1,2)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float2(1,2); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int3(7,3,5)); | ||||||
|  |     cross(inF0, inF1); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int3(1,2,3)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float3(1,2,3); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2) | ||||||
|  | { | ||||||
|  |     all(inF0); | ||||||
|  |     abs(inF0); | ||||||
|  |     acos(inF0); | ||||||
|  |     any(inF0); | ||||||
|  |     asin(inF0); | ||||||
|  |     atan(inF0); | ||||||
|  |     atan2(inF0, inF1); | ||||||
|  |     ceil(inF0); | ||||||
|  |     clamp(inF0, inF1, inF2); | ||||||
|  |     cos(inF0); | ||||||
|  |     cosh(inF0); | ||||||
|  |     countbits(int4(7,3,5,2)); | ||||||
|  |     degrees(inF0); | ||||||
|  |     distance(inF0, inF1); | ||||||
|  |     dot(inF0, inF1); | ||||||
|  |     // EvaluateAttributeAtCentroid(inF0); | ||||||
|  |     // EvaluateAttributeAtSample(inF0, 0); | ||||||
|  |     // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); | ||||||
|  |     exp(inF0); | ||||||
|  |     exp2(inF0); | ||||||
|  |     faceforward(inF0, inF1, inF2); | ||||||
|  |     firstbithigh(7); | ||||||
|  |     firstbitlow(7); | ||||||
|  |     floor(inF0); | ||||||
|  |     // TODO: fma(inD0, inD1, inD2); | ||||||
|  |     fmod(inF0, inF1); | ||||||
|  |     frac(inF0); | ||||||
|  |     frexp(inF0, inF1); | ||||||
|  |     fwidth(inF0); | ||||||
|  |     isinf(inF0); | ||||||
|  |     isnan(inF0); | ||||||
|  |     ldexp(inF0, inF1); | ||||||
|  |     length(inF0); | ||||||
|  |     log(inF0); | ||||||
|  |     log2(inF0); | ||||||
|  |     max(inF0, inF1); | ||||||
|  |     min(inF0, inF1); | ||||||
|  |     // TODO: mul(inF0, inF1); | ||||||
|  |     normalize(inF0); | ||||||
|  |     pow(inF0, inF1); | ||||||
|  |     radians(inF0); | ||||||
|  |     reflect(inF0, inF1); | ||||||
|  |     refract(inF0, inF1, 2.0); | ||||||
|  |     reversebits(int4(1,2,3,4)); | ||||||
|  |     round(inF0); | ||||||
|  |     rsqrt(inF0); | ||||||
|  |     sign(inF0); | ||||||
|  |     sin(inF0); | ||||||
|  |     sinh(inF0); | ||||||
|  |     smoothstep(inF0, inF1, inF2); | ||||||
|  |     sqrt(inF0); | ||||||
|  |     step(inF0, inF1); | ||||||
|  |     tan(inF0); | ||||||
|  |     tanh(inF0); | ||||||
|  |     // TODO: sampler intrinsics, when we can declare the types. | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float4(1,2,3,4); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  | #define MATFNS() \ | ||||||
|  |     all(inF0); \ | ||||||
|  |     abs(inF0); \ | ||||||
|  |     acos(inF0); \ | ||||||
|  |     any(inF0); \ | ||||||
|  |     asin(inF0); \ | ||||||
|  |     atan(inF0); \ | ||||||
|  |     atan2(inF0, inF1); \ | ||||||
|  |     ceil(inF0); \ | ||||||
|  |     clamp(inF0, inF1, inF2); \ | ||||||
|  |     cos(inF0); \ | ||||||
|  |     cosh(inF0); \ | ||||||
|  |     degrees(inF0); \ | ||||||
|  |     determinant(inF0); \ | ||||||
|  |     exp(inF0); \ | ||||||
|  |     exp2(inF0); \ | ||||||
|  |     firstbithigh(7); \ | ||||||
|  |     firstbitlow(7); \ | ||||||
|  |     floor(inF0); \ | ||||||
|  |     fmod(inF0, inF1); \ | ||||||
|  |     frac(inF0); \ | ||||||
|  |     frexp(inF0, inF1); \ | ||||||
|  |     fwidth(inF0); \ | ||||||
|  |     ldexp(inF0, inF1); \ | ||||||
|  |     log(inF0); \ | ||||||
|  |     log2(inF0); \ | ||||||
|  |     max(inF0, inF1); \ | ||||||
|  |     min(inF0, inF1); \ | ||||||
|  |     pow(inF0, inF1); \ | ||||||
|  |     radians(inF0); \ | ||||||
|  |     round(inF0); \ | ||||||
|  |     rsqrt(inF0); \ | ||||||
|  |     sign(inF0); \ | ||||||
|  |     sin(inF0); \ | ||||||
|  |     sinh(inF0); \ | ||||||
|  |     smoothstep(inF0, inF1, inF2); \ | ||||||
|  |     sqrt(inF0); \ | ||||||
|  |     step(inF0, inF1); \ | ||||||
|  |     tan(inF0); \ | ||||||
|  |     tanh(inF0); \ | ||||||
|  |     transpose(inF0); \ | ||||||
|  |     trunc(inF0); | ||||||
|  | 
 | ||||||
|  | // TODO: turn on non-square matrix tests when protos are available. | ||||||
|  | 
 | ||||||
|  | float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float2x2(2,2,2,2); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float3x3(3,3,3,3,3,3,3,3,3); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) | ||||||
|  | { | ||||||
|  |     // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. | ||||||
|  |     MATFNS() | ||||||
|  | 
 | ||||||
|  |     // TODO: ... add when float1 prototypes are generated | ||||||
|  |     return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); | ||||||
|  | } | ||||||
| @ -69,9 +69,6 @@ using namespace glslang; | |||||||
| // Create a language specific version of parseables.
 | // Create a language specific version of parseables.
 | ||||||
| TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource source) | TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource source) | ||||||
| { | { | ||||||
|     // TODO: hardcode to the GLSL path, until HLSL intrinsics are available.
 |  | ||||||
|     source = EShSourceGlsl; // REMOVE
 |  | ||||||
| 
 |  | ||||||
|     switch (source) { |     switch (source) { | ||||||
|     case EShSourceGlsl: return new TBuiltIns();              // GLSL builtIns
 |     case EShSourceGlsl: return new TBuiltIns();              // GLSL builtIns
 | ||||||
|     case EShSourceHlsl: return new TBuiltInParseablesHlsl(); // HLSL intrinsics
 |     case EShSourceHlsl: return new TBuiltInParseablesHlsl(); // HLSL intrinsics
 | ||||||
| @ -169,6 +166,9 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil | |||||||
|     builtInShaders[0] = builtIns.c_str(); |     builtInShaders[0] = builtIns.c_str(); | ||||||
|     builtInLengths[0] = builtIns.size(); |     builtInLengths[0] = builtIns.size(); | ||||||
| 
 | 
 | ||||||
|  |     if (builtInLengths[0] == 0) | ||||||
|  |         return true; | ||||||
|  |      | ||||||
|     TInputScanner input(1, builtInShaders, builtInLengths); |     TInputScanner input(1, builtInShaders, builtInLengths); | ||||||
|     if (! parseContext.parseShaderStrings(ppContext, input) != 0) { |     if (! parseContext.parseShaderStrings(ppContext, input) != 0) { | ||||||
|         infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); |         infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); | ||||||
| @ -338,7 +338,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo | |||||||
|     bool correct = true; |     bool correct = true; | ||||||
| 
 | 
 | ||||||
|     if (source == EShSourceHlsl) { |     if (source == EShSourceHlsl) { | ||||||
|         version = defaultVersion; |         version = 450;         // TODO: GLSL parser is still used for builtins.
 | ||||||
|         profile = ENoProfile; |         profile = ENoProfile; | ||||||
|         return correct; |         return correct; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| //
 | //
 | ||||||
| // Copyright (C) 2016 Google, Inc.
 | // Copyright (C) 2016 Google, Inc.
 | ||||||
|  | // Copyright (C) 2016 LunarG, Inc.
 | ||||||
| //
 | //
 | ||||||
| // All rights reserved.
 | // All rights reserved.
 | ||||||
| //
 | //
 | ||||||
| @ -79,6 +80,8 @@ INSTANTIATE_TEST_CASE_P( | |||||||
|         {"hlsl.precedence.frag", "PixelShaderFunction"}, |         {"hlsl.precedence.frag", "PixelShaderFunction"}, | ||||||
|         {"hlsl.precedence2.frag", "PixelShaderFunction"}, |         {"hlsl.precedence2.frag", "PixelShaderFunction"}, | ||||||
|         {"hlsl.sin.frag", "PixelShaderFunction"}, |         {"hlsl.sin.frag", "PixelShaderFunction"}, | ||||||
|  |         {"hlsl.intrinsics.frag", "PixelShaderFunction"}, | ||||||
|  |         {"hlsl.intrinsics.vert", "VertexShaderFunction"}, | ||||||
|     }), |     }), | ||||||
|     FileNameAsCustomTestSuffix |     FileNameAsCustomTestSuffix | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -49,12 +49,165 @@ | |||||||
| //
 | //
 | ||||||
| 
 | 
 | ||||||
| #include "hlslParseables.h" | #include "hlslParseables.h" | ||||||
|  | #include <cctype> | ||||||
|  | #include <utility> | ||||||
|  | 
 | ||||||
|  | namespace {  // anonymous namespace functions
 | ||||||
|  | 
 | ||||||
|  | const char* BaseTypeName(const char* argOrder, const char* scalarName, const char* vecName, const char* matName) | ||||||
|  | { | ||||||
|  |     switch (*argOrder) { | ||||||
|  |     case 'S': return scalarName; | ||||||
|  |     case 'V': return vecName; | ||||||
|  |     case 'M': return matName; | ||||||
|  |     default:  return "UNKNOWN_TYPE"; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |      | ||||||
|  | // Create and return a type name.  This is done in GLSL, not HLSL conventions, until such
 | ||||||
|  | // time as builtins are parsed using the HLSL parser.
 | ||||||
|  | //
 | ||||||
|  | //    order:   S = scalar, V = vector, M = matrix
 | ||||||
|  | //    argType: F = float, D = double, I = int, U = uint, B = bool, S = sampler
 | ||||||
|  | //    dim0 = vector dimension, or matrix 1st dimension
 | ||||||
|  | //    dim1 = matrix 2nd dimension
 | ||||||
|  | glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, const char* argType, int dim0, int dim1) | ||||||
|  | { | ||||||
|  |     const bool transpose = (argOrder[0] == '^'); | ||||||
|  | 
 | ||||||
|  |     // Take transpose of matrix dimensions
 | ||||||
|  |     if (transpose) { | ||||||
|  |         std::swap(dim0, dim1); | ||||||
|  |         ++argOrder; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     switch (*argType) { | ||||||
|  |     case '-': s += "void"; break; | ||||||
|  |     case 'F': s += BaseTypeName(argOrder, "float",   "vec",     "mat");  break; | ||||||
|  |     case 'D': s += BaseTypeName(argOrder, "double",  "dvec",    "dmat"); break; | ||||||
|  |     case 'I': s += BaseTypeName(argOrder, "int",     "ivec",    "imat"); break; | ||||||
|  |     case 'U': s += BaseTypeName(argOrder, "uint",    "uvec",    "umat"); break; | ||||||
|  |     case 'B': s += BaseTypeName(argOrder, "bool",    "bvec",    "bmat"); break; | ||||||
|  |     case 'S': s += BaseTypeName(argOrder, "sampler", "sampler", "sampler"); break; // TODO: 
 | ||||||
|  |     default:  s += "UNKNOWN_TYPE"; break; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // handle fixed vector sizes, such as float3, and only ever 3.
 | ||||||
|  |     const int fixedVecSize = isdigit(argOrder[1]) ? (argOrder[1] - '0') : 0; | ||||||
|  |     if (fixedVecSize != 0) | ||||||
|  |         dim0 = dim1 = fixedVecSize; | ||||||
|  | 
 | ||||||
|  |     // Add sampler dimensions
 | ||||||
|  |     if (*argType == 'S') { | ||||||
|  |         switch (dim0) { | ||||||
|  |         case 1: s += "1D";   break; | ||||||
|  |         case 2: s += "2D";   break; | ||||||
|  |         case 3: s += "3D";   break; | ||||||
|  |         case 4: s += "Cube"; break; | ||||||
|  |         default: s += "UNKNOWN_SAMPLER"; break; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // verify dimensions
 | ||||||
|  |     if ((*argOrder == 'V' || *argOrder == 'M') && (dim0 < 1 || dim0 > 4) || | ||||||
|  |         (*argOrder == 'M' && (dim1 < 1 || dim1 > 4))) { | ||||||
|  |         s += "UNKNOWN_DIMENSION"; | ||||||
|  |         return s; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     switch (*argOrder) { | ||||||
|  |     case '-': break;  // no dimensions for voids
 | ||||||
|  |     case 'S': break;  // no dimensions on scalars
 | ||||||
|  |     case 'V': s += ('0' + dim0); break; | ||||||
|  |     case 'M': s += ('0' + dim0); s += 'x'; s += ('0' + dim1); break; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return s; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // TODO: the GLSL parser is currently used to parse HLSL prototypes.  However, many valid HLSL prototypes
 | ||||||
|  | // are not valid GLSL prototypes.  This rejects the invalid ones.  Thus, there is a single switch below
 | ||||||
|  | // to enable creation of the entire HLSL space.
 | ||||||
|  | inline bool IsValidGlsl(const char* cname, char retOrder, char retType, char argOrder, char argType, | ||||||
|  |                         int dim0, int dim1, int dim0Max, int dim1Max) | ||||||
|  | { | ||||||
|  |     const bool isVec = dim0Max > 1 || argType == 'V'; | ||||||
|  |     const bool isMat = dim1Max > 1 || argType == 'M'; | ||||||
|  | 
 | ||||||
|  |     if (argType == 'D'                  ||  // avoid double args
 | ||||||
|  |         retType == 'D'                  ||  // avoid double return
 | ||||||
|  |         (isVec && dim0 == 1)            ||  // avoid vec1
 | ||||||
|  |         (isMat && dim0 == 1 && dim1 == 1))  // avoid mat1x1
 | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|  |     const std::string name(cname);  // for ease of comparison. slow, but temporary, until HLSL parser is online.
 | ||||||
|  |                                  | ||||||
|  |     if (isMat && dim0 != dim1)  // TODO: avoid mats until we find the right GLSL profile
 | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|  |     if (isMat && (argType == 'I' || argType == 'U' || argType == 'B') || | ||||||
|  |         retOrder == 'M' && (retType == 'I' || retType == 'U' || retType == 'B')) | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|  |     if (name == "GetRenderTargetSamplePosition" || | ||||||
|  |         name == "tex1D" || | ||||||
|  |         name == "tex1Dgrad") | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|  |     return true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // Return true for the end of a single argument key, which can be the end of the string, or
 | ||||||
|  | // the comma separator.
 | ||||||
|  | inline bool IsEndOfArg(const char* arg) | ||||||
|  | { | ||||||
|  |     return arg == nullptr || *arg == '\0' || *arg == ','; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // return position of end of argument specifier
 | ||||||
|  | inline const char* FindEndOfArg(const char* arg) | ||||||
|  | { | ||||||
|  |     while (!IsEndOfArg(arg)) | ||||||
|  |         ++arg; | ||||||
|  | 
 | ||||||
|  |     return *arg == '\0' ? nullptr : arg; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // Return pointer to beginning of Nth argument specifier in the string.
 | ||||||
|  | inline const char* NthArg(const char* arg, int n) | ||||||
|  | { | ||||||
|  |     for (int x=0; x<n && arg; ++x) | ||||||
|  |         if ((arg = FindEndOfArg(arg)) != nullptr) | ||||||
|  |             ++arg;  // skip arg separator
 | ||||||
|  | 
 | ||||||
|  |     return arg; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | inline void FindVectorMatrixBounds(const char* argOrder, int fixedVecSize, int& dim0Min, int& dim0Max, int& dim1Min, int& dim1Max) | ||||||
|  | { | ||||||
|  |     for (int arg = 0; ; ++arg) { | ||||||
|  |         const char* nthArgOrder(NthArg(argOrder, arg)); | ||||||
|  |         if (nthArgOrder == nullptr) | ||||||
|  |             break; | ||||||
|  |         else if (*nthArgOrder == 'V') | ||||||
|  |             dim0Max = 4; | ||||||
|  |         else if (*nthArgOrder == 'M') | ||||||
|  |             dim0Max = dim1Max = 4; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (fixedVecSize > 0) // handle fixed sized vectors
 | ||||||
|  |         dim0Min = dim0Max = fixedVecSize; | ||||||
|  | } | ||||||
|  |      | ||||||
|  | } // end anonymous namespace
 | ||||||
| 
 | 
 | ||||||
| namespace glslang { | namespace glslang { | ||||||
| 
 | 
 | ||||||
| TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() | TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() | ||||||
| { | { | ||||||
|     assert(0 && "Unimplemented TBuiltInParseablesHlsl::TBuiltInParseablesHlsl"); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //
 | //
 | ||||||
| @ -67,7 +220,268 @@ TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() | |||||||
| //
 | //
 | ||||||
| void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv, int vulkan) | void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv, int vulkan) | ||||||
| { | { | ||||||
|     assert(0 && "Unimplemented TBuiltInParseablesHlsl::initialize"); |     static const EShLanguageMask EShLangAll = EShLanguageMask(EShLangCount - 1); | ||||||
|  | 
 | ||||||
|  |     // This structure encodes the prototype information for each HLSL intrinsic.
 | ||||||
|  |     // Because explicit enumeration would be cumbersome, it's procedurally generated.
 | ||||||
|  |     // orderKey can be:
 | ||||||
|  |     //   S = scalar, V = vector, M = matrix, - = void
 | ||||||
|  |     // typekey can be:
 | ||||||
|  |     //   D = double, F = float, U = uint, I = int, B = bool, S = sampler, - = void
 | ||||||
|  |     // An empty order or type key repeats the first one.  E.g: SVM,, means 3 args each of SVM.
 | ||||||
|  |     // '>' as first letter of order creates an output paremeter
 | ||||||
|  |     // '<' as first letter of order creates an input paremeter
 | ||||||
|  |     // '^' as first letter of order takes transpose dimensions
 | ||||||
|  | 
 | ||||||
|  |     static const struct { | ||||||
|  |         const char*   name;      // intrinsic name
 | ||||||
|  |         const char*   retOrder;  // return type key: empty matches order of 1st argument
 | ||||||
|  |         const char*   retType;   // return type key: empty matches type of 1st argument
 | ||||||
|  |         const char*   argOrder;  // argument order key
 | ||||||
|  |         const char*   argType;   // argument type key
 | ||||||
|  |         unsigned int  stage;     // stage mask
 | ||||||
|  |     } hlslIntrinsics[] = { | ||||||
|  |         // name                               retOrd   retType    argOrder      argType   stage mask
 | ||||||
|  |         // -----------------------------------------------------------------------------------------------
 | ||||||
|  |         { "abort",                            nullptr, nullptr,   "-",          "-",      EShLangAll }, | ||||||
|  |         { "abs",                              nullptr, nullptr,   "SVM",        "DFUI",   EShLangAll }, | ||||||
|  |         { "acos",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "all",                              "S",    "B",        "SVM",        "BFI",    EShLangAll }, | ||||||
|  |         { "AllMemoryBarrier",                 nullptr, nullptr,   "-",          "-",      EShLangComputeMask }, | ||||||
|  |         { "AllMemoryBarrierWithGroupSync",    nullptr, nullptr,   "-",          "-",      EShLangComputeMask }, | ||||||
|  |         { "any",                              "S",     "B",       "SVM",        "BFI",    EShLangAll }, | ||||||
|  |         { "asdouble",                         "S",     "D",       "S,",         "U,",     EShLangAll }, | ||||||
|  |         { "asdouble",                         "V2",    "D",       "V2,",        "U,",     EShLangAll }, | ||||||
|  |         { "asfloat",                          nullptr, "F",       "SVM",        "BFIU",   EShLangAll }, | ||||||
|  |         { "asin",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "asint",                            nullptr, "I",       "SVM",        "FU",     EShLangAll }, | ||||||
|  |         { "asuint",                           nullptr, "U",       "SVM",        "FU",     EShLangAll }, | ||||||
|  |         { "atan",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "atan2",                            nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         { "ceil",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "CheckAccessFullyMapped",           "S",     "B" ,      "S",          "U",      EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "clamp",                            nullptr, nullptr,   "SVM,,",      "FUI,,",  EShLangAll }, | ||||||
|  |         { "clip",                             "-",     "-",       "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "cos",                              nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "cosh",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "countbits",                        nullptr, nullptr,   "SV",         "U",      EShLangAll }, | ||||||
|  |         { "cross",                            nullptr, nullptr,   "V3,",        "F,",     EShLangAll }, | ||||||
|  |         { "D3DCOLORtoUBYTE4",                 "V4",    "I",       "V4",         "F",      EShLangAll }, | ||||||
|  |         { "ddx",                              nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "ddx_coarse",                       nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "ddx_fine",                         nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "ddy",                              nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "ddy_coarse",                       nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "ddy_fine",                         nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "degrees",                          nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "determinant",                      "S",     "F",       "M",          "F",      EShLangAll }, | ||||||
|  |         { "DeviceMemoryBarrier",              nullptr, nullptr,   "-",          "-",      EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr,   "-",          "-",      EShLangComputeMask }, | ||||||
|  |         { "distance",                         "S",     "F",       "V,",         "F,",     EShLangAll }, | ||||||
|  |         { "dot",                              "S",     nullptr,   "V,",         "FI,",    EShLangAll }, | ||||||
|  |         { "dst",                              nullptr, nullptr,   "V,",         "F,",     EShLangAll }, | ||||||
|  |         // { "errorf",                           "-",     "-",       "",         "",     EShLangAll }, TODO: varargs
 | ||||||
|  |         { "EvaluateAttributeAtCentroid",      nullptr, nullptr,   "SVM",        "F",      EShLangFragmentMask }, | ||||||
|  |         { "EvaluateAttributeAtSample",        nullptr, nullptr,   "SVM,S",      "F,U",    EShLangFragmentMask }, | ||||||
|  |         { "EvaluateAttributeSnapped",         nullptr, nullptr,   "SVM,V2",     "F,F",    EShLangFragmentMask }, | ||||||
|  |         { "exp",                              nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "exp2",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "f16tof32",                         nullptr, "F",       "SV",         "U",      EShLangAll }, | ||||||
|  |         { "f32tof16",                         nullptr, "U",       "SV",         "F",      EShLangAll }, | ||||||
|  |         { "faceforward",                      nullptr, nullptr,   "V,,",        "F,,",    EShLangAll }, | ||||||
|  |         { "firstbithigh",                     nullptr, nullptr,   "SV",         "UI",     EShLangAll }, | ||||||
|  |         { "firstbitlow",                      nullptr, nullptr,   "SV",         "UI",     EShLangAll }, | ||||||
|  |         { "floor",                            nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "fma",                              nullptr, nullptr,   "SVM,,",      "D,,",    EShLangAll }, | ||||||
|  |         { "fmod",                             nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         { "frac",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "frexp",                            nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         { "fwidth",                           nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "GetRenderTargetSampleCount",       "S",     "U",       "-",          "-",      EShLangAll }, | ||||||
|  |         { "GetRenderTargetSamplePosition",    "V2",    "F",       "V1",         "I",      EShLangAll }, | ||||||
|  |         { "GroupMemoryBarrier",               nullptr, nullptr,   "-",          "-",      EShLangComputeMask }, | ||||||
|  |         { "GroupMemoryBarrierWithGroupSync",  nullptr, nullptr,   "-",          "-",      EShLangComputeMask }, | ||||||
|  |         { "InterlockedAdd",                   "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedAnd",                   "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedCompareExchange",       "-",     "-",       "SVM,,,>",    "UI,,,",  EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedCompareStore",          "-",     "-",       "SVM,,",      "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedExchange",              "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedMax",                   "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedMin",                   "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedOr",                    "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "InterlockedXor",                   "-",     "-",       "SVM,,>",     "UI,,",   EShLangFragmentMask | EShLangComputeMask }, | ||||||
|  |         { "isfinite",                         nullptr, "B" ,      "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "isinf",                            nullptr, "B" ,      "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "isnan",                            nullptr, "B" ,      "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "ldexp",                            nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         { "length",                           "S",     "F",       "V",          "F",      EShLangAll }, | ||||||
|  |         { "lit",                              "V4",    "F",       "S,,",        "F,,",    EShLangAll }, | ||||||
|  |         { "log",                              nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "log10",                            nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "log2",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "mad",                              nullptr, nullptr,   "SVM,,",      "DFUI,,", EShLangAll }, | ||||||
|  |         { "max",                              nullptr, nullptr,   "SVM,",       "FI,",    EShLangAll }, | ||||||
|  |         { "min",                              nullptr, nullptr,   "SVM,",       "FI,",    EShLangAll }, | ||||||
|  |         { "modf",                             nullptr, nullptr,   "SVM,>",      "FI,",    EShLangAll }, | ||||||
|  |         { "msad4",                            "V4",    "U",       "S,V2,V4",    "U,,",    EShLangAll }, | ||||||
|  |         { "mul",                              "S",     nullptr,   "S,S",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "V",     nullptr,   "S,V",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "M",     nullptr,   "S,M",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "V",     nullptr,   "V,S",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "S",     nullptr,   "V,V",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "V",     nullptr,   "V,M",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "M",     nullptr,   "M,S",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "V",     nullptr,   "M,V",        "FI,",    EShLangAll }, | ||||||
|  |         { "mul",                              "M",     nullptr,   "M,M",        "FI,",    EShLangAll }, | ||||||
|  |         { "noise",                            "S",     "F",       "V",          "F",      EShLangFragmentMask }, | ||||||
|  |         { "normalize",                        nullptr, nullptr,   "V",          "F",      EShLangAll }, | ||||||
|  |         { "pow",                              nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         // { "printf",                           "-",     "-",       "",        "",     EShLangAll }, TODO: varargs
 | ||||||
|  |         { "Process2DQuadTessFactorsAvg",      "-",     "-",       "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, | ||||||
|  |         { "Process2DQuadTessFactorsMax",      "-",     "-",       "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, | ||||||
|  |         { "Process2DQuadTessFactorsMin",      "-",     "-",       "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, | ||||||
|  |         { "ProcessIsolineTessFactors",        "-",     "-",       "S,,>,>",  "F,,,",   EShLangTessControlMask }, | ||||||
|  |         { "ProcessQuadTessFactorsAvg",        "-",     "-",       "V4,S,>V4,>V2,>V2", "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "ProcessQuadTessFactorsMax",        "-",     "-",       "V4,S,>V4,>V2,>V2", "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "ProcessQuadTessFactorsMin",        "-",     "-",       "V4,S,>V4,>V2,>V2", "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "ProcessTriTessFactorsAvg",         "-",     "-",       "V3,S,>V3,>S,>S",   "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "ProcessTriTessFactorsMax",         "-",     "-",       "V3,S,>V3,>S,>S",   "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "ProcessTriTessFactorsMin",         "-",     "-",       "V3,S,>V3,>S,>S",   "F,,,,",  EShLangTessControlMask }, | ||||||
|  |         { "radians",                          nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "rcp",                              nullptr, nullptr,   "SVM",        "FD",     EShLangAll }, | ||||||
|  |         { "reflect",                          nullptr, nullptr,   "V,",         "F,",     EShLangAll }, | ||||||
|  |         { "refract",                          nullptr, nullptr,   "V,V,S",      "F,,",    EShLangAll }, | ||||||
|  |         { "reversebits",                      nullptr, nullptr,   "SV",         "U",      EShLangAll }, | ||||||
|  |         { "round",                            nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "rsqrt",                            nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "saturate",                         nullptr, nullptr ,  "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "sign",                             nullptr, nullptr,   "SVM",        "FI",     EShLangAll }, | ||||||
|  |         { "sin",                              nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "sincos",                           "-",     "-",       "SVM,>,>",    "F,,",    EShLangAll }, | ||||||
|  |         { "sinh",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "smoothstep",                       nullptr, nullptr,   "SVM,,",      "F,,",    EShLangAll }, | ||||||
|  |         { "sqrt",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "step",                             nullptr, nullptr,   "SVM,",       "F,",     EShLangAll }, | ||||||
|  |         { "tan",                              nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "tanh",                             nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  |         { "tex1D",                            "V4",    "F",       "S1,S",       "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex1D",                            "V4",    "F",       "S1,S,V1,V1", "S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex1Dbias",                        "V4",    "F",       "S1,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex1Dgrad",                        "V4",    "F",       "S1,V1,V1,V1","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex1Dlod",                         "V4",    "F",       "S1,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex1Dproj",                        "V4",    "F",       "S1,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex2D",                            "V4",    "F",       "S2,V2",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex2D",                            "V4",    "F",       "S2,V2,V2,V2","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex2Dbias",                        "V4",    "F",       "S2,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex2Dgrad",                        "V4",    "F",       "S2,V2,V2,V2","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex2Dlod",                         "V4",    "F",       "S2,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex2Dproj",                        "V4",    "F",       "S2,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex3D",                            "V4",    "F",       "S3,V3",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex3D",                            "V4",    "F",       "S3,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex3Dbias",                        "V4",    "F",       "S3,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex3Dgrad",                        "V4",    "F",       "S3,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "tex3Dlod",                         "V4",    "F",       "S3,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "tex3Dproj",                        "V4",    "F",       "S3,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "texCUBE",                          "V4",    "F",       "S4,V3",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "texCUBE",                          "V4",    "F",       "S4,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "texCUBEbias",                      "V4",    "F",       "S4,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "texCUBEgrad",                      "V4",    "F",       "S4,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, | ||||||
|  |         { "texCUBElod",                       "V4",    "F",       "S4,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "texCUBEproj",                      "V4",    "F",       "S4,V4",      "S,F",    EShLangFragmentMask }, | ||||||
|  |         { "transpose",                        "^M",    nullptr,   "M",          "F",      EShLangAll }, | ||||||
|  |         { "trunc",                            nullptr, nullptr,   "SVM",        "F",      EShLangAll }, | ||||||
|  | 
 | ||||||
|  |         // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet.
 | ||||||
|  |         { nullptr,                            nullptr, nullptr,   nullptr,      nullptr,  0 }, | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     // Set this to true to avoid generating prototypes that will be invalid for the GLSL parser.
 | ||||||
|  |     // TODO: turn it off (and remove the code) when the HLSL parser can be used to parse builtins.
 | ||||||
|  |     static const bool skipInvalidGlsl = true; | ||||||
|  |      | ||||||
|  |     // Create prototypes for the intrinsics.  TODO: Avoid ranged based for until all compilers can handle it.
 | ||||||
|  |     for (int icount = 0; hlslIntrinsics[icount].name; ++icount) { | ||||||
|  |         const auto& intrinsic = hlslIntrinsics[icount]; | ||||||
|  | 
 | ||||||
|  |         for (int stage = 0; stage < EShLangCount; ++stage) {                                // for each stage...
 | ||||||
|  |             if ((intrinsic.stage & (1<<stage)) == 0) // skip inapplicable stages
 | ||||||
|  |                 continue; | ||||||
|  | 
 | ||||||
|  |             // reference to either the common builtins, or stage specific builtins.
 | ||||||
|  |             TString& s = (intrinsic.stage == EShLangAll) ? commonBuiltins : stageBuiltins[stage]; | ||||||
|  | 
 | ||||||
|  |             for (const char* argOrder = intrinsic.argOrder; !IsEndOfArg(argOrder); ++argOrder) { // for each order...
 | ||||||
|  |                 const int fixedVecSize = isdigit(argOrder[1]) ? (argOrder[1] - '0') : 0; | ||||||
|  | 
 | ||||||
|  |                 // calculate min and max vector and matrix dimensions
 | ||||||
|  |                 int dim0Min = 1; | ||||||
|  |                 int dim0Max = 1; | ||||||
|  |                 int dim1Min = 1; | ||||||
|  |                 int dim1Max = 1; | ||||||
|  | 
 | ||||||
|  |                 FindVectorMatrixBounds(argOrder, fixedVecSize, dim0Min, dim0Max, dim1Min, dim1Max); | ||||||
|  | 
 | ||||||
|  |                 for (const char* argType = intrinsic.argType; !IsEndOfArg(argType); ++argType) { // for each type...
 | ||||||
|  |                     for (int dim0 = dim0Min; dim0 <= dim0Max; ++dim0) {          // for each dim 0...
 | ||||||
|  |                         for (int dim1 = dim1Min; dim1 <= dim1Max; ++dim1) {      // for each dim 1...
 | ||||||
|  |                             const char* retOrder = intrinsic.retOrder ? intrinsic.retOrder : argOrder; | ||||||
|  |                             const char* retType  = intrinsic.retType  ? intrinsic.retType  : argType; | ||||||
|  | 
 | ||||||
|  |                             if (skipInvalidGlsl && !IsValidGlsl(intrinsic.name, *retOrder, *retType, *argOrder, *argType, | ||||||
|  |                                                                 dim0, dim1, dim0Max, dim1Max)) | ||||||
|  |                                 continue; | ||||||
|  | 
 | ||||||
|  |                             AppendTypeName(s, retOrder, retType, dim0, dim1);  // add return type
 | ||||||
|  |                             s.append(" ");                                     // space between type and name
 | ||||||
|  |                             s.append(intrinsic.name);                          // intrinsic name
 | ||||||
|  |                             s.append("(");                                     // open paren
 | ||||||
|  | 
 | ||||||
|  |                             // Append argument types, if any.
 | ||||||
|  |                             for (int arg = 0; ; ++arg) { | ||||||
|  |                                 const char* nthArgOrder(NthArg(argOrder, arg)); | ||||||
|  |                                 const char* nthArgType(NthArg(argType, arg)); | ||||||
|  | 
 | ||||||
|  |                                 if (nthArgOrder == nullptr || nthArgType == nullptr) | ||||||
|  |                                     break; | ||||||
|  | 
 | ||||||
|  |                                 s.append(arg > 0 ? ", ": "");  // comma separator if needed
 | ||||||
|  |                                  | ||||||
|  |                                 if (*nthArgOrder == '>') {           // output params
 | ||||||
|  |                                     ++nthArgOrder; | ||||||
|  |                                     s.append("out "); | ||||||
|  |                                 } else if (*nthArgOrder == '<') {    // input params
 | ||||||
|  |                                     ++nthArgOrder; | ||||||
|  |                                     s.append("in "); | ||||||
|  |                                 } | ||||||
|  | 
 | ||||||
|  |                                 // Comma means use the 1st argument order and type.
 | ||||||
|  |                                 if (*nthArgOrder == ',' || *nthArgOrder == '\0') nthArgOrder = argOrder; | ||||||
|  |                                 if (*nthArgType == ',' || *nthArgType == '\0') nthArgType = argType; | ||||||
|  | 
 | ||||||
|  |                                 AppendTypeName(s, nthArgOrder, nthArgType, dim0, dim1); // Add first argument
 | ||||||
|  |                             } | ||||||
|  |                              | ||||||
|  |                             s.append(");\n");            // close paren and trailing semicolon
 | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 if (fixedVecSize > 0)  // skip over number for fixed size vectors
 | ||||||
|  |                     ++argOrder; | ||||||
|  |             } | ||||||
|  |              | ||||||
|  |             if (intrinsic.stage == EShLangAll) // common builtins are only added once.
 | ||||||
|  |                 break; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // printf("Common:\n%s\n",   getCommonString().c_str());
 | ||||||
|  |     // printf("Frag:\n%s\n",     getStageString(EShLangFragment).c_str());
 | ||||||
|  |     // printf("Vertex:\n%s\n",   getStageString(EShLangVertex).c_str());
 | ||||||
|  |     // printf("Geo:\n%s\n",      getStageString(EShLangGeometry).c_str());
 | ||||||
|  |     // printf("TessCtrl:\n%s\n", getStageString(EShLangTessControl).c_str());
 | ||||||
|  |     // printf("TessEval:\n%s\n", getStageString(EShLangTessEvaluation).c_str());
 | ||||||
|  |     // printf("Compute:\n%s\n",  getStageString(EShLangCompute).c_str());
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //
 | //
 | ||||||
| @ -80,7 +494,6 @@ void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv, | |||||||
| void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, | void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, | ||||||
|                                         int vulkan, EShLanguage language) |                                         int vulkan, EShLanguage language) | ||||||
| { | { | ||||||
|     assert(0 && "Unimplemented TBuiltInParseablesHlsl::initialize"); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -95,7 +508,140 @@ void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int v | |||||||
| void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, | void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, | ||||||
|                                               TSymbolTable& symbolTable) |                                               TSymbolTable& symbolTable) | ||||||
| { | { | ||||||
|     assert(0 && "Unimplemented TBuiltInParseablesHlsl::identifyBuiltIns"); |     // symbolTable.relateToOperator("abort");
 | ||||||
|  |     symbolTable.relateToOperator("abs",                         EOpAbs); | ||||||
|  |     symbolTable.relateToOperator("acos",                        EOpAcos); | ||||||
|  |     symbolTable.relateToOperator("all",                         EOpAll); | ||||||
|  |     // symbolTable.relateToOperator("AllMemoryBarrier");
 | ||||||
|  |     // symbolTable.relateToOperator("AllMemoryBarrierWithGroupSync");
 | ||||||
|  |     symbolTable.relateToOperator("any",                         EOpAny); | ||||||
|  |     // symbolTable.relateToOperator("asdouble");
 | ||||||
|  |     // symbolTable.relateToOperator("asfloat");
 | ||||||
|  |     symbolTable.relateToOperator("asin",                        EOpAsin); | ||||||
|  |     // symbolTable.relateToOperator("asint");
 | ||||||
|  |     // symbolTable.relateToOperator("asuint");
 | ||||||
|  |     symbolTable.relateToOperator("atan",                        EOpAtan); | ||||||
|  |     symbolTable.relateToOperator("atan2",                       EOpAtan); | ||||||
|  |     symbolTable.relateToOperator("ceil",                        EOpCeil); | ||||||
|  |     // symbolTable.relateToOperator("CheckAccessFullyMapped");
 | ||||||
|  |     symbolTable.relateToOperator("clamp",                       EOpClamp); | ||||||
|  |     // symbolTable.relateToOperator("clip");
 | ||||||
|  |     symbolTable.relateToOperator("cos",                         EOpCos); | ||||||
|  |     symbolTable.relateToOperator("cosh",                        EOpCosh); | ||||||
|  |     symbolTable.relateToOperator("countbits",                   EOpBitCount); | ||||||
|  |     symbolTable.relateToOperator("cross",                       EOpCross); | ||||||
|  |     // symbolTable.relateToOperator("D3DCOLORtoUBYTE4");
 | ||||||
|  |     symbolTable.relateToOperator("ddx",                         EOpDPdx); | ||||||
|  |     symbolTable.relateToOperator("ddx_coarse",                  EOpDPdxCoarse); | ||||||
|  |     symbolTable.relateToOperator("ddx_fine",                    EOpDPdxFine); | ||||||
|  |     symbolTable.relateToOperator("ddy",                         EOpDPdy); | ||||||
|  |     symbolTable.relateToOperator("ddy_coarse",                  EOpDPdyCoarse); | ||||||
|  |     symbolTable.relateToOperator("ddy_fine",                    EOpDPdyFine); | ||||||
|  |     symbolTable.relateToOperator("degrees",                     EOpDegrees); | ||||||
|  |     symbolTable.relateToOperator("determinant",                 EOpDeterminant); | ||||||
|  |     // symbolTable.relateToOperator("DeviceMemoryBarrier");
 | ||||||
|  |     // symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync");
 | ||||||
|  |     symbolTable.relateToOperator("distance",                    EOpDistance); | ||||||
|  |     symbolTable.relateToOperator("dot",                         EOpDot); | ||||||
|  |     // symbolTable.relateToOperator("dst");
 | ||||||
|  |     // symbolTable.relateToOperator("errorf");
 | ||||||
|  |     symbolTable.relateToOperator("EvaluateAttributeAtCentroid", EOpInterpolateAtCentroid); | ||||||
|  |     symbolTable.relateToOperator("EvaluateAttributeAtSample",   EOpInterpolateAtSample); | ||||||
|  |     // symbolTable.relateToOperator("EvaluateAttributeSnapped");  // TODO: hsnflr positions.  new op?
 | ||||||
|  |     symbolTable.relateToOperator("exp",                         EOpExp); | ||||||
|  |     symbolTable.relateToOperator("exp2",                        EOpExp2); | ||||||
|  |     // symbolTable.relateToOperator("f16tof32");
 | ||||||
|  |     // symbolTable.relateToOperator("f32tof16");
 | ||||||
|  |     symbolTable.relateToOperator("faceforward",                 EOpFaceForward); | ||||||
|  |     symbolTable.relateToOperator("firstbithigh",                EOpFindMSB); | ||||||
|  |     symbolTable.relateToOperator("firstbitlow",                 EOpFindLSB); | ||||||
|  |     symbolTable.relateToOperator("floor",                       EOpFloor); | ||||||
|  |     symbolTable.relateToOperator("fma",                         EOpFma); | ||||||
|  |     // symbolTable.relateToOperator("fmod");
 | ||||||
|  |     symbolTable.relateToOperator("frac",                        EOpFract); | ||||||
|  |     symbolTable.relateToOperator("frexp",                       EOpFrexp); | ||||||
|  |     symbolTable.relateToOperator("fwidth",                      EOpFwidth); | ||||||
|  |     // symbolTable.relateToOperator("GetRenderTargetSampleCount");
 | ||||||
|  |     // symbolTable.relateToOperator("GetRenderTargetSamplePosition");
 | ||||||
|  |     // symbolTable.relateToOperator("GroupMemoryBarrier");
 | ||||||
|  |     // symbolTable.relateToOperator("GroupMemoryBarrierWithGroupSync");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedAdd");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedAnd");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedCompareExchange");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedCompareStore");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedExchange");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedMax");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedMin");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedOr");
 | ||||||
|  |     // symbolTable.relateToOperator("InterlockedXor");
 | ||||||
|  |     // symbolTable.relateToOperator("isfinite");
 | ||||||
|  |     symbolTable.relateToOperator("isinf",                       EOpIsInf); | ||||||
|  |     symbolTable.relateToOperator("isnan",                       EOpIsNan); | ||||||
|  |     symbolTable.relateToOperator("ldexp",                       EOpLdexp); | ||||||
|  |     symbolTable.relateToOperator("length",                      EOpLength); | ||||||
|  |     // symbolTable.relateToOperator("lit");
 | ||||||
|  |     symbolTable.relateToOperator("log",                         EOpLog); | ||||||
|  |     // symbolTable.relateToOperator("log10");
 | ||||||
|  |     symbolTable.relateToOperator("log2",                        EOpLog2); | ||||||
|  |     // symbolTable.relateToOperator("mad");
 | ||||||
|  |     symbolTable.relateToOperator("max",                         EOpMax); | ||||||
|  |     symbolTable.relateToOperator("min",                         EOpMin); | ||||||
|  |     symbolTable.relateToOperator("modf",                        EOpModf); | ||||||
|  |     // symbolTable.relateToOperator("msad4");
 | ||||||
|  |     // symbolTable.relateToOperator("mul");
 | ||||||
|  |     // symbolTable.relateToOperator("noise",                    EOpNoise); // TODO: check return type
 | ||||||
|  |     symbolTable.relateToOperator("normalize",                   EOpNormalize); | ||||||
|  |     symbolTable.relateToOperator("pow",                         EOpPow); | ||||||
|  |     // symbolTable.relateToOperator("printf");
 | ||||||
|  |     // symbolTable.relateToOperator("Process2DQuadTessFactorsAvg");
 | ||||||
|  |     // symbolTable.relateToOperator("Process2DQuadTessFactorsMax");
 | ||||||
|  |     // symbolTable.relateToOperator("Process2DQuadTessFactorsMin");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessIsolineTessFactors");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessQuadTessFactorsAvg");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessQuadTessFactorsMax");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessQuadTessFactorsMin");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessTriTessFactorsAvg");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessTriTessFactorsMax");
 | ||||||
|  |     // symbolTable.relateToOperator("ProcessTriTessFactorsMin");
 | ||||||
|  |     symbolTable.relateToOperator("radians",                     EOpRadians); | ||||||
|  |     // symbolTable.relateToOperator("rcp");
 | ||||||
|  |     symbolTable.relateToOperator("reflect",                     EOpReflect); | ||||||
|  |     symbolTable.relateToOperator("refract",                     EOpRefract); | ||||||
|  |     symbolTable.relateToOperator("reversebits",                 EOpBitFieldReverse); | ||||||
|  |     symbolTable.relateToOperator("round",                       EOpRoundEven); | ||||||
|  |     symbolTable.relateToOperator("rsqrt",                       EOpInverseSqrt); | ||||||
|  |     // symbolTable.relateToOperator("saturate"); 
 | ||||||
|  |     symbolTable.relateToOperator("sign",                        EOpSign); | ||||||
|  |     symbolTable.relateToOperator("sin",                         EOpSin); | ||||||
|  |     // symbolTable.relateToOperator("sincos");
 | ||||||
|  |     symbolTable.relateToOperator("sinh",                        EOpSinh); | ||||||
|  |     symbolTable.relateToOperator("smoothstep",                  EOpSmoothStep); | ||||||
|  |     symbolTable.relateToOperator("sqrt",                        EOpSqrt); | ||||||
|  |     symbolTable.relateToOperator("step",                        EOpStep); | ||||||
|  |     symbolTable.relateToOperator("tan",                         EOpTan); | ||||||
|  |     symbolTable.relateToOperator("tanh",                        EOpTanh); | ||||||
|  |     symbolTable.relateToOperator("tex1D",                       EOpTexture); | ||||||
|  |     // symbolTable.relateToOperator("tex1Dbias",                  // TODO:
 | ||||||
|  |     symbolTable.relateToOperator("tex1Dgrad",                   EOpTextureGrad); | ||||||
|  |     symbolTable.relateToOperator("tex1Dlod",                    EOpTextureLod); | ||||||
|  |     symbolTable.relateToOperator("tex1Dproj",                   EOpTextureProj); | ||||||
|  |     symbolTable.relateToOperator("tex2D",                       EOpTexture); | ||||||
|  |     // symbolTable.relateToOperator("tex2Dbias",                  // TODO:
 | ||||||
|  |     symbolTable.relateToOperator("tex2Dgrad",                   EOpTextureGrad); | ||||||
|  |     symbolTable.relateToOperator("tex2Dlod",                    EOpTextureLod); | ||||||
|  |     // symbolTable.relateToOperator("tex2Dproj",                   EOpTextureProj);
 | ||||||
|  |     symbolTable.relateToOperator("tex3D",                       EOpTexture); | ||||||
|  |     // symbolTable.relateToOperator("tex3Dbias");                // TODO
 | ||||||
|  |     symbolTable.relateToOperator("tex3Dgrad",                   EOpTextureGrad); | ||||||
|  |     symbolTable.relateToOperator("tex3Dlod",                    EOpTextureLod); | ||||||
|  |     // symbolTable.relateToOperator("tex3Dproj",                   EOpTextureProj);
 | ||||||
|  |     symbolTable.relateToOperator("texCUBE",                     EOpTexture); | ||||||
|  |     // symbolTable.relateToOperator("texCUBEbias",              // TODO
 | ||||||
|  |     symbolTable.relateToOperator("texCUBEgrad",                 EOpTextureGrad); | ||||||
|  |     symbolTable.relateToOperator("texCUBElod",                  EOpTextureLod); | ||||||
|  |     // symbolTable.relateToOperator("texCUBEproj",                 EOpTextureProj);
 | ||||||
|  |     symbolTable.relateToOperator("transpose",                   EOpTranspose); | ||||||
|  |     symbolTable.relateToOperator("trunc",                       EOpTrunc); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //
 | //
 | ||||||
| @ -110,7 +656,6 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int | |||||||
| void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, | void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, | ||||||
|                                               TSymbolTable& symbolTable, const TBuiltInResource &resources) |                                               TSymbolTable& symbolTable, const TBuiltInResource &resources) | ||||||
| { | { | ||||||
|     assert(0 && "Unimplemented TBuiltInParseablesHlsl::identifyBuiltIns"); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 LoopDawg
						LoopDawg