HLSL: Add shape conversions for scalar -> vector assigments.

Also, this allows turning on the error check for a failed assigment
when parsing.

This makes 39 HLSL tests have a working assignment that was previously
silently dropped, due to lack of this functionality.
This commit is contained in:
John Kessenich
2016-07-28 17:53:56 -06:00
parent a26a5170a3
commit fea226ba43
46 changed files with 2571 additions and 1413 deletions

View File

@@ -122,6 +122,16 @@ gl_FragCoord origin is upper left
0:64 'c4' (uniform 4-component vector of int)
0:64 Constant:
0:64 3 (const int)
0:72 move second child to first child (temp 4-component vector of float)
0:72 Color: direct index for structure (temp 4-component vector of float)
0:72 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:72 Constant:
0:72 0 (const int)
0:72 Constant:
0:72 1.000000
0:72 1.000000
0:72 1.000000
0:72 1.000000
0:73 move second child to first child (temp float)
0:73 Depth: direct index for structure (temp float FragDepth)
0:73 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@@ -290,6 +300,16 @@ gl_FragCoord origin is upper left
0:64 'c4' (uniform 4-component vector of int)
0:64 Constant:
0:64 3 (const int)
0:72 move second child to first child (temp 4-component vector of float)
0:72 Color: direct index for structure (temp 4-component vector of float)
0:72 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:72 Constant:
0:72 0 (const int)
0:72 Constant:
0:72 1.000000
0:72 1.000000
0:72 1.000000
0:72 1.000000
0:73 move second child to first child (temp float)
0:73 Depth: direct index for structure (temp float FragDepth)
0:73 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@@ -333,7 +353,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 159
// Id's are bound by 163
Capability Shader
Capability Sampled1D
@@ -360,24 +380,24 @@ gl_FragCoord origin is upper left
MemberName 106(PS_OUTPUT) 0 "Color"
MemberName 106(PS_OUTPUT) 1 "Depth"
Name 108 "psout"
Name 117 "g_sSamp"
Name 120 "g_tTexcdf4"
Name 123 "g_tTexcdi4"
Name 126 "g_tTexcdu4"
Name 129 "g_tTex1df4a"
Name 132 "g_tTex1di4a"
Name 135 "g_tTex1du4a"
Name 138 "g_tTex2df4a"
Name 141 "g_tTex2di4a"
Name 144 "g_tTex2du4a"
Name 147 "g_tTexcdf4a"
Name 150 "g_tTexcdi4a"
Name 153 "g_tTexcdu4a"
Name 154 "c1"
Name 155 "o1"
Name 156 "o2"
Name 157 "o3"
Name 158 "o4"
Name 121 "g_sSamp"
Name 124 "g_tTexcdf4"
Name 127 "g_tTexcdi4"
Name 130 "g_tTexcdu4"
Name 133 "g_tTex1df4a"
Name 136 "g_tTex1di4a"
Name 139 "g_tTex1du4a"
Name 142 "g_tTex2df4a"
Name 145 "g_tTex2di4a"
Name 148 "g_tTex2du4a"
Name 151 "g_tTexcdf4a"
Name 154 "g_tTexcdi4a"
Name 157 "g_tTexcdu4a"
Name 158 "c1"
Name 159 "o1"
Name 160 "o2"
Name 161 "o3"
Name 162 "o4"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 27(g_tTex1di4) DescriptorSet 0
Decorate 37(g_tTex1du4) DescriptorSet 0
@@ -388,19 +408,19 @@ gl_FragCoord origin is upper left
Decorate 90(g_tTex3di4) DescriptorSet 0
Decorate 99(g_tTex3du4) DescriptorSet 0
MemberDecorate 106(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 117(g_sSamp) DescriptorSet 0
Decorate 120(g_tTexcdf4) DescriptorSet 0
Decorate 123(g_tTexcdi4) DescriptorSet 0
Decorate 126(g_tTexcdu4) DescriptorSet 0
Decorate 129(g_tTex1df4a) DescriptorSet 0
Decorate 132(g_tTex1di4a) DescriptorSet 0
Decorate 135(g_tTex1du4a) DescriptorSet 0
Decorate 138(g_tTex2df4a) DescriptorSet 0
Decorate 141(g_tTex2di4a) DescriptorSet 0
Decorate 144(g_tTex2du4a) DescriptorSet 0
Decorate 147(g_tTexcdf4a) DescriptorSet 0
Decorate 150(g_tTexcdi4a) DescriptorSet 0
Decorate 153(g_tTexcdu4a) DescriptorSet 0
Decorate 121(g_sSamp) DescriptorSet 0
Decorate 124(g_tTexcdf4) DescriptorSet 0
Decorate 127(g_tTexcdi4) DescriptorSet 0
Decorate 130(g_tTexcdu4) DescriptorSet 0
Decorate 133(g_tTex1df4a) DescriptorSet 0
Decorate 136(g_tTex1di4a) DescriptorSet 0
Decorate 139(g_tTex1du4a) DescriptorSet 0
Decorate 142(g_tTex2df4a) DescriptorSet 0
Decorate 145(g_tTex2di4a) DescriptorSet 0
Decorate 148(g_tTex2du4a) DescriptorSet 0
Decorate 151(g_tTexcdf4a) DescriptorSet 0
Decorate 154(g_tTexcdi4a) DescriptorSet 0
Decorate 157(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -451,53 +471,56 @@ gl_FragCoord origin is upper left
99(g_tTex3du4): 98(ptr) Variable UniformConstant
106(PS_OUTPUT): TypeStruct 23(fvec4) 6(float)
107: TypePointer Function 106(PS_OUTPUT)
109: 11(int) Constant 1
109: 11(int) Constant 0
110: 6(float) Constant 1065353216
111: TypePointer Function 6(float)
115: TypeSampler
116: TypePointer UniformConstant 115
117(g_sSamp): 116(ptr) Variable UniformConstant
118: TypeImage 6(float) Cube sampled format:Unknown
119: TypePointer UniformConstant 118
120(g_tTexcdf4): 119(ptr) Variable UniformConstant
121: TypeImage 11(int) Cube sampled format:Unknown
122: TypePointer UniformConstant 121
123(g_tTexcdi4): 122(ptr) Variable UniformConstant
124: TypeImage 15(int) Cube sampled format:Unknown
125: TypePointer UniformConstant 124
126(g_tTexcdu4): 125(ptr) Variable UniformConstant
127: TypeImage 6(float) 1D array sampled format:Unknown
128: TypePointer UniformConstant 127
129(g_tTex1df4a): 128(ptr) Variable UniformConstant
130: TypeImage 11(int) 1D array sampled format:Unknown
131: TypePointer UniformConstant 130
132(g_tTex1di4a): 131(ptr) Variable UniformConstant
133: TypeImage 15(int) 1D array sampled format:Unknown
134: TypePointer UniformConstant 133
135(g_tTex1du4a): 134(ptr) Variable UniformConstant
136: TypeImage 6(float) 2D array sampled format:Unknown
137: TypePointer UniformConstant 136
138(g_tTex2df4a): 137(ptr) Variable UniformConstant
139: TypeImage 11(int) 2D array sampled format:Unknown
140: TypePointer UniformConstant 139
141(g_tTex2di4a): 140(ptr) Variable UniformConstant
142: TypeImage 15(int) 2D array sampled format:Unknown
143: TypePointer UniformConstant 142
144(g_tTex2du4a): 143(ptr) Variable UniformConstant
145: TypeImage 6(float) Cube array sampled format:Unknown
146: TypePointer UniformConstant 145
147(g_tTexcdf4a): 146(ptr) Variable UniformConstant
148: TypeImage 11(int) Cube array sampled format:Unknown
149: TypePointer UniformConstant 148
150(g_tTexcdi4a): 149(ptr) Variable UniformConstant
151: TypeImage 15(int) Cube array sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTexcdu4a): 152(ptr) Variable UniformConstant
154(c1): 17(ptr) Variable UniformConstant
155(o1): 17(ptr) Variable UniformConstant
156(o2): 13(ptr) Variable UniformConstant
157(o3): 50(ptr) Variable UniformConstant
158(o4): 80(ptr) Variable UniformConstant
111: 23(fvec4) ConstantComposite 110 110 110 110
112: TypePointer Function 23(fvec4)
114: 11(int) Constant 1
115: TypePointer Function 6(float)
119: TypeSampler
120: TypePointer UniformConstant 119
121(g_sSamp): 120(ptr) Variable UniformConstant
122: TypeImage 6(float) Cube sampled format:Unknown
123: TypePointer UniformConstant 122
124(g_tTexcdf4): 123(ptr) Variable UniformConstant
125: TypeImage 11(int) Cube sampled format:Unknown
126: TypePointer UniformConstant 125
127(g_tTexcdi4): 126(ptr) Variable UniformConstant
128: TypeImage 15(int) Cube sampled format:Unknown
129: TypePointer UniformConstant 128
130(g_tTexcdu4): 129(ptr) Variable UniformConstant
131: TypeImage 6(float) 1D array sampled format:Unknown
132: TypePointer UniformConstant 131
133(g_tTex1df4a): 132(ptr) Variable UniformConstant
134: TypeImage 11(int) 1D array sampled format:Unknown
135: TypePointer UniformConstant 134
136(g_tTex1di4a): 135(ptr) Variable UniformConstant
137: TypeImage 15(int) 1D array sampled format:Unknown
138: TypePointer UniformConstant 137
139(g_tTex1du4a): 138(ptr) Variable UniformConstant
140: TypeImage 6(float) 2D array sampled format:Unknown
141: TypePointer UniformConstant 140
142(g_tTex2df4a): 141(ptr) Variable UniformConstant
143: TypeImage 11(int) 2D array sampled format:Unknown
144: TypePointer UniformConstant 143
145(g_tTex2di4a): 144(ptr) Variable UniformConstant
146: TypeImage 15(int) 2D array sampled format:Unknown
147: TypePointer UniformConstant 146
148(g_tTex2du4a): 147(ptr) Variable UniformConstant
149: TypeImage 6(float) Cube array sampled format:Unknown
150: TypePointer UniformConstant 149
151(g_tTexcdf4a): 150(ptr) Variable UniformConstant
152: TypeImage 11(int) Cube array sampled format:Unknown
153: TypePointer UniformConstant 152
154(g_tTexcdi4a): 153(ptr) Variable UniformConstant
155: TypeImage 15(int) Cube array sampled format:Unknown
156: TypePointer UniformConstant 155
157(g_tTexcdu4a): 156(ptr) Variable UniformConstant
158(c1): 17(ptr) Variable UniformConstant
159(o1): 17(ptr) Variable UniformConstant
160(o2): 13(ptr) Variable UniformConstant
161(o3): 50(ptr) Variable UniformConstant
162(o4): 80(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
108(psout): 107(ptr) Variable Function
@@ -555,8 +578,10 @@ gl_FragCoord origin is upper left
103: 17(ptr) AccessChain 81(c4) 84
104: 11(int) Load 103
105: 43(ivec4) ImageFetch 100 102 Lod 104
112: 111(ptr) AccessChain 108(psout) 109
Store 112 110
113:106(PS_OUTPUT) Load 108(psout)
ReturnValue 113
113: 112(ptr) AccessChain 108(psout) 109
Store 113 111
116: 115(ptr) AccessChain 108(psout) 114
Store 116 110
117:106(PS_OUTPUT) Load 108(psout)
ReturnValue 117
FunctionEnd