
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.
420 lines
19 KiB
Plaintext
420 lines
19 KiB
Plaintext
hlsl.matType.bool.frag
|
|
Shader version: 450
|
|
gl_FragCoord origin is upper left
|
|
0:? Sequence
|
|
0:3 Function Definition: TestBoolMatTypes( (temp void)
|
|
0:3 Function Parameters:
|
|
0:? Sequence
|
|
0:25 Sequence
|
|
0:25 move second child to first child (temp 1X1 matrix of bool)
|
|
0:25 'r00' (temp 1X1 matrix of bool)
|
|
0:25 transpose (temp 1X1 matrix of bool)
|
|
0:25 'b1x1' (temp 1X1 matrix of bool)
|
|
0:26 Sequence
|
|
0:26 move second child to first child (temp 1X2 matrix of bool)
|
|
0:26 'r01' (temp 1X2 matrix of bool)
|
|
0:26 transpose (temp 1X2 matrix of bool)
|
|
0:26 'b2x1' (temp 2X1 matrix of bool)
|
|
0:27 Sequence
|
|
0:27 move second child to first child (temp 1X3 matrix of bool)
|
|
0:27 'r02' (temp 1X3 matrix of bool)
|
|
0:27 transpose (temp 1X3 matrix of bool)
|
|
0:27 'b3x1' (temp 3X1 matrix of bool)
|
|
0:28 Sequence
|
|
0:28 move second child to first child (temp 1X4 matrix of bool)
|
|
0:28 'r03' (temp 1X4 matrix of bool)
|
|
0:28 transpose (temp 1X4 matrix of bool)
|
|
0:28 'b4x1' (temp 4X1 matrix of bool)
|
|
0:30 Sequence
|
|
0:30 move second child to first child (temp 2X1 matrix of bool)
|
|
0:30 'r10' (temp 2X1 matrix of bool)
|
|
0:30 transpose (temp 2X1 matrix of bool)
|
|
0:30 'b1x2' (temp 1X2 matrix of bool)
|
|
0:31 Sequence
|
|
0:31 move second child to first child (temp 2X2 matrix of bool)
|
|
0:31 'r11' (temp 2X2 matrix of bool)
|
|
0:31 transpose (temp 2X2 matrix of bool)
|
|
0:31 'b2x2' (temp 2X2 matrix of bool)
|
|
0:32 Sequence
|
|
0:32 move second child to first child (temp 2X3 matrix of bool)
|
|
0:32 'r12' (temp 2X3 matrix of bool)
|
|
0:32 transpose (temp 2X3 matrix of bool)
|
|
0:32 'b3x2' (temp 3X2 matrix of bool)
|
|
0:33 Sequence
|
|
0:33 move second child to first child (temp 2X4 matrix of bool)
|
|
0:33 'r13' (temp 2X4 matrix of bool)
|
|
0:33 transpose (temp 2X4 matrix of bool)
|
|
0:33 'b4x2' (temp 4X2 matrix of bool)
|
|
0:35 Sequence
|
|
0:35 move second child to first child (temp 3X1 matrix of bool)
|
|
0:35 'r20' (temp 3X1 matrix of bool)
|
|
0:35 transpose (temp 3X1 matrix of bool)
|
|
0:35 'b1x3' (temp 1X3 matrix of bool)
|
|
0:36 Sequence
|
|
0:36 move second child to first child (temp 3X2 matrix of bool)
|
|
0:36 'r21' (temp 3X2 matrix of bool)
|
|
0:36 transpose (temp 3X2 matrix of bool)
|
|
0:36 'b2x3' (temp 2X3 matrix of bool)
|
|
0:37 Sequence
|
|
0:37 move second child to first child (temp 3X3 matrix of bool)
|
|
0:37 'r22' (temp 3X3 matrix of bool)
|
|
0:37 transpose (temp 3X3 matrix of bool)
|
|
0:37 'b3x3' (temp 3X3 matrix of bool)
|
|
0:38 Sequence
|
|
0:38 move second child to first child (temp 3X4 matrix of bool)
|
|
0:38 'r23' (temp 3X4 matrix of bool)
|
|
0:38 transpose (temp 3X4 matrix of bool)
|
|
0:38 'b4x3' (temp 4X3 matrix of bool)
|
|
0:40 Sequence
|
|
0:40 move second child to first child (temp 4X1 matrix of bool)
|
|
0:40 'r30' (temp 4X1 matrix of bool)
|
|
0:40 transpose (temp 4X1 matrix of bool)
|
|
0:40 'b1x4' (temp 1X4 matrix of bool)
|
|
0:41 Sequence
|
|
0:41 move second child to first child (temp 4X2 matrix of bool)
|
|
0:41 'r31' (temp 4X2 matrix of bool)
|
|
0:41 transpose (temp 4X2 matrix of bool)
|
|
0:41 'b2x4' (temp 2X4 matrix of bool)
|
|
0:42 Sequence
|
|
0:42 move second child to first child (temp 4X3 matrix of bool)
|
|
0:42 'r32' (temp 4X3 matrix of bool)
|
|
0:42 transpose (temp 4X3 matrix of bool)
|
|
0:42 'b3x4' (temp 3X4 matrix of bool)
|
|
0:43 Sequence
|
|
0:43 move second child to first child (temp 4X4 matrix of bool)
|
|
0:43 'r33' (temp 4X4 matrix of bool)
|
|
0:43 transpose (temp 4X4 matrix of bool)
|
|
0:43 'b4x4' (temp 4X4 matrix of bool)
|
|
0:49 Function Definition: main( (temp structure{temp 4-component vector of float color})
|
|
0:49 Function Parameters:
|
|
0:? Sequence
|
|
0:51 move second child to first child (temp 4-component vector of float)
|
|
0:51 color: direct index for structure (temp 4-component vector of float)
|
|
0:51 'ps_output' (temp structure{temp 4-component vector of float color})
|
|
0:51 Constant:
|
|
0:51 0 (const int)
|
|
0:? Constant:
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:52 Sequence
|
|
0:52 Sequence
|
|
0:52 move second child to first child (temp 4-component vector of float)
|
|
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
|
0:52 color: direct index for structure (temp 4-component vector of float)
|
|
0:52 'ps_output' (temp structure{temp 4-component vector of float color})
|
|
0:52 Constant:
|
|
0:52 0 (const int)
|
|
0:52 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
|
|
|
|
|
Linked fragment stage:
|
|
|
|
|
|
Shader version: 450
|
|
gl_FragCoord origin is upper left
|
|
0:? Sequence
|
|
0:3 Function Definition: TestBoolMatTypes( (temp void)
|
|
0:3 Function Parameters:
|
|
0:? Sequence
|
|
0:25 Sequence
|
|
0:25 move second child to first child (temp 1X1 matrix of bool)
|
|
0:25 'r00' (temp 1X1 matrix of bool)
|
|
0:25 transpose (temp 1X1 matrix of bool)
|
|
0:25 'b1x1' (temp 1X1 matrix of bool)
|
|
0:26 Sequence
|
|
0:26 move second child to first child (temp 1X2 matrix of bool)
|
|
0:26 'r01' (temp 1X2 matrix of bool)
|
|
0:26 transpose (temp 1X2 matrix of bool)
|
|
0:26 'b2x1' (temp 2X1 matrix of bool)
|
|
0:27 Sequence
|
|
0:27 move second child to first child (temp 1X3 matrix of bool)
|
|
0:27 'r02' (temp 1X3 matrix of bool)
|
|
0:27 transpose (temp 1X3 matrix of bool)
|
|
0:27 'b3x1' (temp 3X1 matrix of bool)
|
|
0:28 Sequence
|
|
0:28 move second child to first child (temp 1X4 matrix of bool)
|
|
0:28 'r03' (temp 1X4 matrix of bool)
|
|
0:28 transpose (temp 1X4 matrix of bool)
|
|
0:28 'b4x1' (temp 4X1 matrix of bool)
|
|
0:30 Sequence
|
|
0:30 move second child to first child (temp 2X1 matrix of bool)
|
|
0:30 'r10' (temp 2X1 matrix of bool)
|
|
0:30 transpose (temp 2X1 matrix of bool)
|
|
0:30 'b1x2' (temp 1X2 matrix of bool)
|
|
0:31 Sequence
|
|
0:31 move second child to first child (temp 2X2 matrix of bool)
|
|
0:31 'r11' (temp 2X2 matrix of bool)
|
|
0:31 transpose (temp 2X2 matrix of bool)
|
|
0:31 'b2x2' (temp 2X2 matrix of bool)
|
|
0:32 Sequence
|
|
0:32 move second child to first child (temp 2X3 matrix of bool)
|
|
0:32 'r12' (temp 2X3 matrix of bool)
|
|
0:32 transpose (temp 2X3 matrix of bool)
|
|
0:32 'b3x2' (temp 3X2 matrix of bool)
|
|
0:33 Sequence
|
|
0:33 move second child to first child (temp 2X4 matrix of bool)
|
|
0:33 'r13' (temp 2X4 matrix of bool)
|
|
0:33 transpose (temp 2X4 matrix of bool)
|
|
0:33 'b4x2' (temp 4X2 matrix of bool)
|
|
0:35 Sequence
|
|
0:35 move second child to first child (temp 3X1 matrix of bool)
|
|
0:35 'r20' (temp 3X1 matrix of bool)
|
|
0:35 transpose (temp 3X1 matrix of bool)
|
|
0:35 'b1x3' (temp 1X3 matrix of bool)
|
|
0:36 Sequence
|
|
0:36 move second child to first child (temp 3X2 matrix of bool)
|
|
0:36 'r21' (temp 3X2 matrix of bool)
|
|
0:36 transpose (temp 3X2 matrix of bool)
|
|
0:36 'b2x3' (temp 2X3 matrix of bool)
|
|
0:37 Sequence
|
|
0:37 move second child to first child (temp 3X3 matrix of bool)
|
|
0:37 'r22' (temp 3X3 matrix of bool)
|
|
0:37 transpose (temp 3X3 matrix of bool)
|
|
0:37 'b3x3' (temp 3X3 matrix of bool)
|
|
0:38 Sequence
|
|
0:38 move second child to first child (temp 3X4 matrix of bool)
|
|
0:38 'r23' (temp 3X4 matrix of bool)
|
|
0:38 transpose (temp 3X4 matrix of bool)
|
|
0:38 'b4x3' (temp 4X3 matrix of bool)
|
|
0:40 Sequence
|
|
0:40 move second child to first child (temp 4X1 matrix of bool)
|
|
0:40 'r30' (temp 4X1 matrix of bool)
|
|
0:40 transpose (temp 4X1 matrix of bool)
|
|
0:40 'b1x4' (temp 1X4 matrix of bool)
|
|
0:41 Sequence
|
|
0:41 move second child to first child (temp 4X2 matrix of bool)
|
|
0:41 'r31' (temp 4X2 matrix of bool)
|
|
0:41 transpose (temp 4X2 matrix of bool)
|
|
0:41 'b2x4' (temp 2X4 matrix of bool)
|
|
0:42 Sequence
|
|
0:42 move second child to first child (temp 4X3 matrix of bool)
|
|
0:42 'r32' (temp 4X3 matrix of bool)
|
|
0:42 transpose (temp 4X3 matrix of bool)
|
|
0:42 'b3x4' (temp 3X4 matrix of bool)
|
|
0:43 Sequence
|
|
0:43 move second child to first child (temp 4X4 matrix of bool)
|
|
0:43 'r33' (temp 4X4 matrix of bool)
|
|
0:43 transpose (temp 4X4 matrix of bool)
|
|
0:43 'b4x4' (temp 4X4 matrix of bool)
|
|
0:49 Function Definition: main( (temp structure{temp 4-component vector of float color})
|
|
0:49 Function Parameters:
|
|
0:? Sequence
|
|
0:51 move second child to first child (temp 4-component vector of float)
|
|
0:51 color: direct index for structure (temp 4-component vector of float)
|
|
0:51 'ps_output' (temp structure{temp 4-component vector of float color})
|
|
0:51 Constant:
|
|
0:51 0 (const int)
|
|
0:? Constant:
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:? 0.000000
|
|
0:52 Sequence
|
|
0:52 Sequence
|
|
0:52 move second child to first child (temp 4-component vector of float)
|
|
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
|
0:52 color: direct index for structure (temp 4-component vector of float)
|
|
0:52 'ps_output' (temp structure{temp 4-component vector of float color})
|
|
0:52 Constant:
|
|
0:52 0 (const int)
|
|
0:52 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'color' (layout(location=0 ) out 4-component vector of float)
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 125
|
|
|
|
Capability Shader
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Fragment 4 "main" 121
|
|
ExecutionMode 4 OriginUpperLeft
|
|
Name 4 "main"
|
|
Name 6 "TestBoolMatTypes("
|
|
Name 12 "r00"
|
|
Name 13 "b1x1"
|
|
Name 19 "r01"
|
|
Name 22 "b2x1"
|
|
Name 28 "r02"
|
|
Name 31 "b3x1"
|
|
Name 37 "r03"
|
|
Name 40 "b4x1"
|
|
Name 43 "r10"
|
|
Name 44 "b1x2"
|
|
Name 49 "r11"
|
|
Name 50 "b2x2"
|
|
Name 55 "r12"
|
|
Name 58 "b3x2"
|
|
Name 63 "r13"
|
|
Name 66 "b4x2"
|
|
Name 69 "r20"
|
|
Name 70 "b1x3"
|
|
Name 73 "r21"
|
|
Name 74 "b2x3"
|
|
Name 79 "r22"
|
|
Name 80 "b3x3"
|
|
Name 85 "r23"
|
|
Name 88 "b4x3"
|
|
Name 91 "r30"
|
|
Name 92 "b1x4"
|
|
Name 95 "r31"
|
|
Name 96 "b2x4"
|
|
Name 99 "r32"
|
|
Name 100 "b3x4"
|
|
Name 105 "r33"
|
|
Name 106 "b4x4"
|
|
Name 111 "PS_OUTPUT"
|
|
MemberName 111(PS_OUTPUT) 0 "color"
|
|
Name 113 "ps_output"
|
|
Name 121 "color"
|
|
Decorate 121(color) Location 0
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
8: TypeBool
|
|
9: TypeVector 8(bool) 1
|
|
10: TypeMatrix 9(bvec) 1
|
|
11: TypePointer Function 10
|
|
16: TypeVector 8(bool) 2
|
|
17: TypeMatrix 16(bvec2) 1
|
|
18: TypePointer Function 17
|
|
20: TypeMatrix 9(bvec) 2
|
|
21: TypePointer Function 20
|
|
25: TypeVector 8(bool) 3
|
|
26: TypeMatrix 25(bvec3) 1
|
|
27: TypePointer Function 26
|
|
29: TypeMatrix 9(bvec) 3
|
|
30: TypePointer Function 29
|
|
34: TypeVector 8(bool) 4
|
|
35: TypeMatrix 34(bvec4) 1
|
|
36: TypePointer Function 35
|
|
38: TypeMatrix 9(bvec) 4
|
|
39: TypePointer Function 38
|
|
47: TypeMatrix 16(bvec2) 2
|
|
48: TypePointer Function 47
|
|
53: TypeMatrix 25(bvec3) 2
|
|
54: TypePointer Function 53
|
|
56: TypeMatrix 16(bvec2) 3
|
|
57: TypePointer Function 56
|
|
61: TypeMatrix 34(bvec4) 2
|
|
62: TypePointer Function 61
|
|
64: TypeMatrix 16(bvec2) 4
|
|
65: TypePointer Function 64
|
|
77: TypeMatrix 25(bvec3) 3
|
|
78: TypePointer Function 77
|
|
83: TypeMatrix 34(bvec4) 3
|
|
84: TypePointer Function 83
|
|
86: TypeMatrix 25(bvec3) 4
|
|
87: TypePointer Function 86
|
|
103: TypeMatrix 34(bvec4) 4
|
|
104: TypePointer Function 103
|
|
109: TypeFloat 32
|
|
110: TypeVector 109(float) 4
|
|
111(PS_OUTPUT): TypeStruct 110(fvec4)
|
|
112: TypePointer Function 111(PS_OUTPUT)
|
|
114: TypeInt 32 1
|
|
115: 114(int) Constant 0
|
|
116: 109(float) Constant 0
|
|
117: 110(fvec4) ConstantComposite 116 116 116 116
|
|
118: TypePointer Function 110(fvec4)
|
|
120: TypePointer Output 110(fvec4)
|
|
121(color): 120(ptr) Variable Output
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
113(ps_output): 112(ptr) Variable Function
|
|
119: 118(ptr) AccessChain 113(ps_output) 115
|
|
Store 119 117
|
|
122: 118(ptr) AccessChain 113(ps_output) 115
|
|
123: 110(fvec4) Load 122
|
|
Store 121(color) 123
|
|
Return
|
|
FunctionEnd
|
|
6(TestBoolMatTypes(): 2 Function None 3
|
|
7: Label
|
|
12(r00): 11(ptr) Variable Function
|
|
13(b1x1): 11(ptr) Variable Function
|
|
19(r01): 18(ptr) Variable Function
|
|
22(b2x1): 21(ptr) Variable Function
|
|
28(r02): 27(ptr) Variable Function
|
|
31(b3x1): 30(ptr) Variable Function
|
|
37(r03): 36(ptr) Variable Function
|
|
40(b4x1): 39(ptr) Variable Function
|
|
43(r10): 21(ptr) Variable Function
|
|
44(b1x2): 18(ptr) Variable Function
|
|
49(r11): 48(ptr) Variable Function
|
|
50(b2x2): 48(ptr) Variable Function
|
|
55(r12): 54(ptr) Variable Function
|
|
58(b3x2): 57(ptr) Variable Function
|
|
63(r13): 62(ptr) Variable Function
|
|
66(b4x2): 65(ptr) Variable Function
|
|
69(r20): 30(ptr) Variable Function
|
|
70(b1x3): 27(ptr) Variable Function
|
|
73(r21): 57(ptr) Variable Function
|
|
74(b2x3): 54(ptr) Variable Function
|
|
79(r22): 78(ptr) Variable Function
|
|
80(b3x3): 78(ptr) Variable Function
|
|
85(r23): 84(ptr) Variable Function
|
|
88(b4x3): 87(ptr) Variable Function
|
|
91(r30): 39(ptr) Variable Function
|
|
92(b1x4): 36(ptr) Variable Function
|
|
95(r31): 65(ptr) Variable Function
|
|
96(b2x4): 62(ptr) Variable Function
|
|
99(r32): 87(ptr) Variable Function
|
|
100(b3x4): 84(ptr) Variable Function
|
|
105(r33): 104(ptr) Variable Function
|
|
106(b4x4): 104(ptr) Variable Function
|
|
14: 10 Load 13(b1x1)
|
|
15: 10 Transpose 14
|
|
Store 12(r00) 15
|
|
23: 20 Load 22(b2x1)
|
|
24: 17 Transpose 23
|
|
Store 19(r01) 24
|
|
32: 29 Load 31(b3x1)
|
|
33: 26 Transpose 32
|
|
Store 28(r02) 33
|
|
41: 38 Load 40(b4x1)
|
|
42: 35 Transpose 41
|
|
Store 37(r03) 42
|
|
45: 17 Load 44(b1x2)
|
|
46: 20 Transpose 45
|
|
Store 43(r10) 46
|
|
51: 47 Load 50(b2x2)
|
|
52: 47 Transpose 51
|
|
Store 49(r11) 52
|
|
59: 56 Load 58(b3x2)
|
|
60: 53 Transpose 59
|
|
Store 55(r12) 60
|
|
67: 64 Load 66(b4x2)
|
|
68: 61 Transpose 67
|
|
Store 63(r13) 68
|
|
71: 26 Load 70(b1x3)
|
|
72: 29 Transpose 71
|
|
Store 69(r20) 72
|
|
75: 53 Load 74(b2x3)
|
|
76: 56 Transpose 75
|
|
Store 73(r21) 76
|
|
81: 77 Load 80(b3x3)
|
|
82: 77 Transpose 81
|
|
Store 79(r22) 82
|
|
89: 86 Load 88(b4x3)
|
|
90: 83 Transpose 89
|
|
Store 85(r23) 90
|
|
93: 35 Load 92(b1x4)
|
|
94: 38 Transpose 93
|
|
Store 91(r30) 94
|
|
97: 61 Load 96(b2x4)
|
|
98: 64 Transpose 97
|
|
Store 95(r31) 98
|
|
101: 83 Load 100(b3x4)
|
|
102: 86 Transpose 101
|
|
Store 99(r32) 102
|
|
107: 103 Load 106(b4x4)
|
|
108: 103 Transpose 107
|
|
Store 105(r33) 108
|
|
Return
|
|
FunctionEnd
|