HLSL: use HLSL parser to parse HLSL intrinsic prototypes, enable int/bool mats
This PR adds a CreateParseContext() fn analogous to CreateBuiltInParseables(), to create a language specific built in parser. (This code was present before but not encapsualted in a fn). This can now be used to create a source language specific parser for builtins. Along with this, the code creating HLSL intrinsic prototypes can now produce them in HLSL syntax, rather than GLSL syntax. This relaxes certain prior restrictions at the parser level. Lower layers (e.g, SPIR-V) may still have such restrictions, such as around Nx1 matrices: this code does not impact that. This PR also fleshes out matrix types for bools and ints, both of which were partially in place before. This was easier than maintaining the restrictions in the HLSL prototype generator to avoid creating protoypes with those types. Many tests change because the result type from intrinsics moves from "global" to "temp". Several new tests are added for the new types.
This commit is contained in:
parent
fabe7d6a61
commit
0842dbb39a
43 changed files with 3729 additions and 2033 deletions
|
|
@ -78,36 +78,36 @@ ERROR: node is still EOpNull!
|
|||
0:5 'inF0' (in float)
|
||||
0:5 Convert float to uint (temp uint)
|
||||
0:5 'inF1' (in float)
|
||||
0:6 Function Call: CheckAccessFullyMapped(u1; (global bool)
|
||||
0:6 Function Call: CheckAccessFullyMapped(u1; (temp bool)
|
||||
0:6 Constant:
|
||||
0:6 3 (const uint)
|
||||
0:7 bitCount (global uint)
|
||||
0:7 bitCount (temp uint)
|
||||
0:7 Convert float to uint (temp uint)
|
||||
0:7 'inF0' (in float)
|
||||
0:8 cross-product (global 3-component vector of float)
|
||||
0:8 cross-product (temp 3-component vector of float)
|
||||
0:8 Construct vec3 (in 3-component vector of float)
|
||||
0:8 'inF0' (in float)
|
||||
0:8 Construct vec3 (in 3-component vector of float)
|
||||
0:8 'inF1' (in float)
|
||||
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (global 4-component vector of int)
|
||||
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (temp 4-component vector of int)
|
||||
0:9 Construct vec4 (in 4-component vector of float)
|
||||
0:9 'inF0' (in float)
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:12 ERROR: Bad unary op
|
||||
(global float)
|
||||
(temp float)
|
||||
0:12 Convert float to uint (temp uint)
|
||||
0:12 'inF0' (in float)
|
||||
0:13 findMSB (global uint)
|
||||
0:13 findMSB (temp uint)
|
||||
0:13 Convert float to uint (temp uint)
|
||||
0:13 'inF0' (in float)
|
||||
0:14 findLSB (global uint)
|
||||
0:14 findLSB (temp uint)
|
||||
0:14 Convert float to uint (temp uint)
|
||||
0:14 'inF0' (in float)
|
||||
0:23 length (global float)
|
||||
0:23 length (temp float)
|
||||
0:23 Construct vec2 (in 2-component vector of float)
|
||||
0:23 'inF0' (in float)
|
||||
0:24 Function Call: msad4(u1;vu2;vu4; (global 4-component vector of uint)
|
||||
0:24 Function Call: msad4(u1;vu2;vu4; (temp 4-component vector of uint)
|
||||
0:24 Convert float to uint (temp uint)
|
||||
0:24 'inF0' (in float)
|
||||
0:24 Constant:
|
||||
|
|
@ -118,15 +118,15 @@ ERROR: node is still EOpNull!
|
|||
0:24 0 (const uint)
|
||||
0:24 0 (const uint)
|
||||
0:24 0 (const uint)
|
||||
0:25 normalize (global 2-component vector of float)
|
||||
0:25 normalize (temp 2-component vector of float)
|
||||
0:25 Construct vec2 (in 2-component vector of float)
|
||||
0:25 'inF0' (in float)
|
||||
0:26 reflect (global 2-component vector of float)
|
||||
0:26 reflect (temp 2-component vector of float)
|
||||
0:26 Construct vec2 (in 2-component vector of float)
|
||||
0:26 'inF0' (in float)
|
||||
0:26 Construct vec2 (in 2-component vector of float)
|
||||
0:26 'inF1' (in float)
|
||||
0:27 refract (global 2-component vector of float)
|
||||
0:27 refract (temp 2-component vector of float)
|
||||
0:27 Construct vec2 (in 2-component vector of float)
|
||||
0:27 'inF0' (in float)
|
||||
0:27 Construct vec2 (in 2-component vector of float)
|
||||
|
|
@ -134,7 +134,7 @@ ERROR: node is still EOpNull!
|
|||
0:27 'inF2' (in float)
|
||||
0:28 Constant:
|
||||
0:28 0.000000
|
||||
0:29 bitFieldReverse (global uint)
|
||||
0:29 bitFieldReverse (temp uint)
|
||||
0:29 Convert float to uint (temp uint)
|
||||
0:29 'inF0' (in float)
|
||||
0:30 Constant:
|
||||
|
|
@ -162,14 +162,14 @@ ERROR: node is still EOpNull!
|
|||
0:45 'inI0' (in 2-component vector of int)
|
||||
0:? Sequence
|
||||
0:46 ERROR: Bad aggregation op
|
||||
(global 2-component vector of double)
|
||||
(temp 2-component vector of double)
|
||||
0:46 Convert float to uint (temp 2-component vector of uint)
|
||||
0:46 'inF0' (in 2-component vector of float)
|
||||
0:46 Convert float to uint (temp 2-component vector of uint)
|
||||
0:46 'inF1' (in 2-component vector of float)
|
||||
0:47 Constant:
|
||||
0:47 0.000000
|
||||
0:48 bitCount (global 2-component vector of uint)
|
||||
0:48 bitCount (temp 2-component vector of uint)
|
||||
0:48 Convert float to uint (temp 2-component vector of uint)
|
||||
0:48 'inF0' (in 2-component vector of float)
|
||||
0:49 Constant:
|
||||
|
|
@ -179,16 +179,16 @@ ERROR: node is still EOpNull!
|
|||
0:51 Constant:
|
||||
0:51 0.000000
|
||||
0:52 ERROR: Bad unary op
|
||||
(global 2-component vector of float)
|
||||
(temp 2-component vector of float)
|
||||
0:52 Convert float to uint (temp 2-component vector of uint)
|
||||
0:52 'inF0' (in 2-component vector of float)
|
||||
0:53 findMSB (global 2-component vector of uint)
|
||||
0:53 findMSB (temp 2-component vector of uint)
|
||||
0:53 Convert float to uint (temp 2-component vector of uint)
|
||||
0:53 'inF0' (in 2-component vector of float)
|
||||
0:54 findLSB (global 2-component vector of uint)
|
||||
0:54 findLSB (temp 2-component vector of uint)
|
||||
0:54 Convert float to uint (temp 2-component vector of uint)
|
||||
0:54 'inF0' (in 2-component vector of float)
|
||||
0:56 bitFieldReverse (global 2-component vector of uint)
|
||||
0:56 bitFieldReverse (temp 2-component vector of uint)
|
||||
0:56 Convert float to uint (temp 2-component vector of uint)
|
||||
0:56 'inF0' (in 2-component vector of float)
|
||||
0:57 Constant:
|
||||
|
|
@ -206,7 +206,7 @@ ERROR: node is still EOpNull!
|
|||
0:? Sequence
|
||||
0:64 Constant:
|
||||
0:64 0.000000
|
||||
0:65 bitCount (global 3-component vector of uint)
|
||||
0:65 bitCount (temp 3-component vector of uint)
|
||||
0:65 Convert float to uint (temp 3-component vector of uint)
|
||||
0:65 'inF0' (in 3-component vector of float)
|
||||
0:66 Constant:
|
||||
|
|
@ -214,16 +214,16 @@ ERROR: node is still EOpNull!
|
|||
0:67 Constant:
|
||||
0:67 0.000000
|
||||
0:68 ERROR: Bad unary op
|
||||
(global 3-component vector of float)
|
||||
(temp 3-component vector of float)
|
||||
0:68 Convert float to uint (temp 3-component vector of uint)
|
||||
0:68 'inF0' (in 3-component vector of float)
|
||||
0:69 findMSB (global 3-component vector of uint)
|
||||
0:69 findMSB (temp 3-component vector of uint)
|
||||
0:69 Convert float to uint (temp 3-component vector of uint)
|
||||
0:69 'inF0' (in 3-component vector of float)
|
||||
0:70 findLSB (global 3-component vector of uint)
|
||||
0:70 findLSB (temp 3-component vector of uint)
|
||||
0:70 Convert float to uint (temp 3-component vector of uint)
|
||||
0:70 'inF0' (in 3-component vector of float)
|
||||
0:72 bitFieldReverse (global 3-component vector of uint)
|
||||
0:72 bitFieldReverse (temp 3-component vector of uint)
|
||||
0:72 Convert float to uint (temp 3-component vector of uint)
|
||||
0:72 'inF0' (in 3-component vector of float)
|
||||
0:73 Constant:
|
||||
|
|
@ -242,10 +242,10 @@ ERROR: node is still EOpNull!
|
|||
0:? Sequence
|
||||
0:81 Constant:
|
||||
0:81 0.000000
|
||||
0:82 bitCount (global 4-component vector of uint)
|
||||
0:82 bitCount (temp 4-component vector of uint)
|
||||
0:82 Convert float to uint (temp 4-component vector of uint)
|
||||
0:82 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:83 cross-product (global 3-component vector of float)
|
||||
0:83 cross-product (temp 3-component vector of float)
|
||||
0:83 Construct vec3 (in 3-component vector of float)
|
||||
0:83 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:83 Construct vec3 (in 3-component vector of float)
|
||||
|
|
@ -253,16 +253,16 @@ ERROR: node is still EOpNull!
|
|||
0:84 Constant:
|
||||
0:84 0.000000
|
||||
0:85 ERROR: Bad unary op
|
||||
(global 4-component vector of float)
|
||||
(temp 4-component vector of float)
|
||||
0:85 Convert float to uint (temp 4-component vector of uint)
|
||||
0:85 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:86 findMSB (global 4-component vector of uint)
|
||||
0:86 findMSB (temp 4-component vector of uint)
|
||||
0:86 Convert float to uint (temp 4-component vector of uint)
|
||||
0:86 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:87 findLSB (global 4-component vector of uint)
|
||||
0:87 findLSB (temp 4-component vector of uint)
|
||||
0:87 Convert float to uint (temp 4-component vector of uint)
|
||||
0:87 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:89 bitFieldReverse (global 4-component vector of uint)
|
||||
0:89 bitFieldReverse (temp 4-component vector of uint)
|
||||
0:89 Convert float to uint (temp 4-component vector of uint)
|
||||
0:89 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:90 Constant:
|
||||
|
|
@ -434,36 +434,36 @@ ERROR: node is still EOpNull!
|
|||
0:5 'inF0' (in float)
|
||||
0:5 Convert float to uint (temp uint)
|
||||
0:5 'inF1' (in float)
|
||||
0:6 Function Call: CheckAccessFullyMapped(u1; (global bool)
|
||||
0:6 Function Call: CheckAccessFullyMapped(u1; (temp bool)
|
||||
0:6 Constant:
|
||||
0:6 3 (const uint)
|
||||
0:7 bitCount (global uint)
|
||||
0:7 bitCount (temp uint)
|
||||
0:7 Convert float to uint (temp uint)
|
||||
0:7 'inF0' (in float)
|
||||
0:8 cross-product (global 3-component vector of float)
|
||||
0:8 cross-product (temp 3-component vector of float)
|
||||
0:8 Construct vec3 (in 3-component vector of float)
|
||||
0:8 'inF0' (in float)
|
||||
0:8 Construct vec3 (in 3-component vector of float)
|
||||
0:8 'inF1' (in float)
|
||||
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (global 4-component vector of int)
|
||||
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (temp 4-component vector of int)
|
||||
0:9 Construct vec4 (in 4-component vector of float)
|
||||
0:9 'inF0' (in float)
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:12 ERROR: Bad unary op
|
||||
(global float)
|
||||
(temp float)
|
||||
0:12 Convert float to uint (temp uint)
|
||||
0:12 'inF0' (in float)
|
||||
0:13 findMSB (global uint)
|
||||
0:13 findMSB (temp uint)
|
||||
0:13 Convert float to uint (temp uint)
|
||||
0:13 'inF0' (in float)
|
||||
0:14 findLSB (global uint)
|
||||
0:14 findLSB (temp uint)
|
||||
0:14 Convert float to uint (temp uint)
|
||||
0:14 'inF0' (in float)
|
||||
0:23 length (global float)
|
||||
0:23 length (temp float)
|
||||
0:23 Construct vec2 (in 2-component vector of float)
|
||||
0:23 'inF0' (in float)
|
||||
0:24 Function Call: msad4(u1;vu2;vu4; (global 4-component vector of uint)
|
||||
0:24 Function Call: msad4(u1;vu2;vu4; (temp 4-component vector of uint)
|
||||
0:24 Convert float to uint (temp uint)
|
||||
0:24 'inF0' (in float)
|
||||
0:24 Constant:
|
||||
|
|
@ -474,15 +474,15 @@ ERROR: node is still EOpNull!
|
|||
0:24 0 (const uint)
|
||||
0:24 0 (const uint)
|
||||
0:24 0 (const uint)
|
||||
0:25 normalize (global 2-component vector of float)
|
||||
0:25 normalize (temp 2-component vector of float)
|
||||
0:25 Construct vec2 (in 2-component vector of float)
|
||||
0:25 'inF0' (in float)
|
||||
0:26 reflect (global 2-component vector of float)
|
||||
0:26 reflect (temp 2-component vector of float)
|
||||
0:26 Construct vec2 (in 2-component vector of float)
|
||||
0:26 'inF0' (in float)
|
||||
0:26 Construct vec2 (in 2-component vector of float)
|
||||
0:26 'inF1' (in float)
|
||||
0:27 refract (global 2-component vector of float)
|
||||
0:27 refract (temp 2-component vector of float)
|
||||
0:27 Construct vec2 (in 2-component vector of float)
|
||||
0:27 'inF0' (in float)
|
||||
0:27 Construct vec2 (in 2-component vector of float)
|
||||
|
|
@ -490,7 +490,7 @@ ERROR: node is still EOpNull!
|
|||
0:27 'inF2' (in float)
|
||||
0:28 Constant:
|
||||
0:28 0.000000
|
||||
0:29 bitFieldReverse (global uint)
|
||||
0:29 bitFieldReverse (temp uint)
|
||||
0:29 Convert float to uint (temp uint)
|
||||
0:29 'inF0' (in float)
|
||||
0:30 Constant:
|
||||
|
|
@ -518,14 +518,14 @@ ERROR: node is still EOpNull!
|
|||
0:45 'inI0' (in 2-component vector of int)
|
||||
0:? Sequence
|
||||
0:46 ERROR: Bad aggregation op
|
||||
(global 2-component vector of double)
|
||||
(temp 2-component vector of double)
|
||||
0:46 Convert float to uint (temp 2-component vector of uint)
|
||||
0:46 'inF0' (in 2-component vector of float)
|
||||
0:46 Convert float to uint (temp 2-component vector of uint)
|
||||
0:46 'inF1' (in 2-component vector of float)
|
||||
0:47 Constant:
|
||||
0:47 0.000000
|
||||
0:48 bitCount (global 2-component vector of uint)
|
||||
0:48 bitCount (temp 2-component vector of uint)
|
||||
0:48 Convert float to uint (temp 2-component vector of uint)
|
||||
0:48 'inF0' (in 2-component vector of float)
|
||||
0:49 Constant:
|
||||
|
|
@ -535,16 +535,16 @@ ERROR: node is still EOpNull!
|
|||
0:51 Constant:
|
||||
0:51 0.000000
|
||||
0:52 ERROR: Bad unary op
|
||||
(global 2-component vector of float)
|
||||
(temp 2-component vector of float)
|
||||
0:52 Convert float to uint (temp 2-component vector of uint)
|
||||
0:52 'inF0' (in 2-component vector of float)
|
||||
0:53 findMSB (global 2-component vector of uint)
|
||||
0:53 findMSB (temp 2-component vector of uint)
|
||||
0:53 Convert float to uint (temp 2-component vector of uint)
|
||||
0:53 'inF0' (in 2-component vector of float)
|
||||
0:54 findLSB (global 2-component vector of uint)
|
||||
0:54 findLSB (temp 2-component vector of uint)
|
||||
0:54 Convert float to uint (temp 2-component vector of uint)
|
||||
0:54 'inF0' (in 2-component vector of float)
|
||||
0:56 bitFieldReverse (global 2-component vector of uint)
|
||||
0:56 bitFieldReverse (temp 2-component vector of uint)
|
||||
0:56 Convert float to uint (temp 2-component vector of uint)
|
||||
0:56 'inF0' (in 2-component vector of float)
|
||||
0:57 Constant:
|
||||
|
|
@ -562,7 +562,7 @@ ERROR: node is still EOpNull!
|
|||
0:? Sequence
|
||||
0:64 Constant:
|
||||
0:64 0.000000
|
||||
0:65 bitCount (global 3-component vector of uint)
|
||||
0:65 bitCount (temp 3-component vector of uint)
|
||||
0:65 Convert float to uint (temp 3-component vector of uint)
|
||||
0:65 'inF0' (in 3-component vector of float)
|
||||
0:66 Constant:
|
||||
|
|
@ -570,16 +570,16 @@ ERROR: node is still EOpNull!
|
|||
0:67 Constant:
|
||||
0:67 0.000000
|
||||
0:68 ERROR: Bad unary op
|
||||
(global 3-component vector of float)
|
||||
(temp 3-component vector of float)
|
||||
0:68 Convert float to uint (temp 3-component vector of uint)
|
||||
0:68 'inF0' (in 3-component vector of float)
|
||||
0:69 findMSB (global 3-component vector of uint)
|
||||
0:69 findMSB (temp 3-component vector of uint)
|
||||
0:69 Convert float to uint (temp 3-component vector of uint)
|
||||
0:69 'inF0' (in 3-component vector of float)
|
||||
0:70 findLSB (global 3-component vector of uint)
|
||||
0:70 findLSB (temp 3-component vector of uint)
|
||||
0:70 Convert float to uint (temp 3-component vector of uint)
|
||||
0:70 'inF0' (in 3-component vector of float)
|
||||
0:72 bitFieldReverse (global 3-component vector of uint)
|
||||
0:72 bitFieldReverse (temp 3-component vector of uint)
|
||||
0:72 Convert float to uint (temp 3-component vector of uint)
|
||||
0:72 'inF0' (in 3-component vector of float)
|
||||
0:73 Constant:
|
||||
|
|
@ -598,10 +598,10 @@ ERROR: node is still EOpNull!
|
|||
0:? Sequence
|
||||
0:81 Constant:
|
||||
0:81 0.000000
|
||||
0:82 bitCount (global 4-component vector of uint)
|
||||
0:82 bitCount (temp 4-component vector of uint)
|
||||
0:82 Convert float to uint (temp 4-component vector of uint)
|
||||
0:82 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:83 cross-product (global 3-component vector of float)
|
||||
0:83 cross-product (temp 3-component vector of float)
|
||||
0:83 Construct vec3 (in 3-component vector of float)
|
||||
0:83 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:83 Construct vec3 (in 3-component vector of float)
|
||||
|
|
@ -609,16 +609,16 @@ ERROR: node is still EOpNull!
|
|||
0:84 Constant:
|
||||
0:84 0.000000
|
||||
0:85 ERROR: Bad unary op
|
||||
(global 4-component vector of float)
|
||||
(temp 4-component vector of float)
|
||||
0:85 Convert float to uint (temp 4-component vector of uint)
|
||||
0:85 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:86 findMSB (global 4-component vector of uint)
|
||||
0:86 findMSB (temp 4-component vector of uint)
|
||||
0:86 Convert float to uint (temp 4-component vector of uint)
|
||||
0:86 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:87 findLSB (global 4-component vector of uint)
|
||||
0:87 findLSB (temp 4-component vector of uint)
|
||||
0:87 Convert float to uint (temp 4-component vector of uint)
|
||||
0:87 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:89 bitFieldReverse (global 4-component vector of uint)
|
||||
0:89 bitFieldReverse (temp 4-component vector of uint)
|
||||
0:89 Convert float to uint (temp 4-component vector of uint)
|
||||
0:89 'inF0' (layout(location=0 ) in 4-component vector of float)
|
||||
0:90 Constant:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue