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

@@ -107,6 +107,16 @@ gl_FragCoord origin is upper left
0:? Constant:
0:? 2 (const int)
0:? 3 (const int)
0:62 move second child to first child (temp 4-component vector of float)
0:62 Color: direct index for structure (temp 4-component vector of float)
0:62 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:62 Constant:
0:62 0 (const int)
0:62 Constant:
0:62 1.000000
0:62 1.000000
0:62 1.000000
0:62 1.000000
0:63 move second child to first child (temp float)
0:63 Depth: direct index for structure (temp float FragDepth)
0:63 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@@ -252,6 +262,16 @@ gl_FragCoord origin is upper left
0:? Constant:
0:? 2 (const int)
0:? 3 (const int)
0:62 move second child to first child (temp 4-component vector of float)
0:62 Color: direct index for structure (temp 4-component vector of float)
0:62 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:62 Constant:
0:62 0 (const int)
0:62 Constant:
0:62 1.000000
0:62 1.000000
0:62 1.000000
0:62 1.000000
0:63 move second child to first child (temp float)
0:63 Depth: direct index for structure (temp float FragDepth)
0:63 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@@ -287,7 +307,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 146
// Id's are bound by 150
Capability Shader
Capability Sampled1D
@@ -315,21 +335,21 @@ gl_FragCoord origin is upper left
MemberName 93(PS_OUTPUT) 0 "Color"
MemberName 93(PS_OUTPUT) 1 "Depth"
Name 95 "psout"
Name 103 "g_tTex3df4"
Name 106 "g_tTex3di4"
Name 109 "g_tTex3du4"
Name 112 "g_tTexcdf4"
Name 115 "g_tTexcdi4"
Name 118 "g_tTexcdu4"
Name 121 "g_tTex1df4a"
Name 124 "g_tTex1di4a"
Name 127 "g_tTex1du4a"
Name 130 "g_tTex2df4a"
Name 133 "g_tTex2di4a"
Name 136 "g_tTex2du4a"
Name 139 "g_tTexcdf4a"
Name 142 "g_tTexcdi4a"
Name 145 "g_tTexcdu4a"
Name 107 "g_tTex3df4"
Name 110 "g_tTex3di4"
Name 113 "g_tTex3du4"
Name 116 "g_tTexcdf4"
Name 119 "g_tTexcdi4"
Name 122 "g_tTexcdu4"
Name 125 "g_tTex1df4a"
Name 128 "g_tTex1di4a"
Name 131 "g_tTex1du4a"
Name 134 "g_tTex2df4a"
Name 137 "g_tTex2di4a"
Name 140 "g_tTex2du4a"
Name 143 "g_tTexcdf4a"
Name 146 "g_tTexcdi4a"
Name 149 "g_tTexcdu4a"
Decorate 11(g_tTex1df4) DescriptorSet 0
Decorate 15(g_sSamp) DescriptorSet 0
Decorate 30(g_tTex1di4) DescriptorSet 0
@@ -338,21 +358,21 @@ gl_FragCoord origin is upper left
Decorate 71(g_tTex2di4) DescriptorSet 0
Decorate 83(g_tTex2du4) DescriptorSet 0
MemberDecorate 93(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 103(g_tTex3df4) DescriptorSet 0
Decorate 106(g_tTex3di4) DescriptorSet 0
Decorate 109(g_tTex3du4) DescriptorSet 0
Decorate 112(g_tTexcdf4) DescriptorSet 0
Decorate 115(g_tTexcdi4) DescriptorSet 0
Decorate 118(g_tTexcdu4) DescriptorSet 0
Decorate 121(g_tTex1df4a) DescriptorSet 0
Decorate 124(g_tTex1di4a) DescriptorSet 0
Decorate 127(g_tTex1du4a) DescriptorSet 0
Decorate 130(g_tTex2df4a) DescriptorSet 0
Decorate 133(g_tTex2di4a) DescriptorSet 0
Decorate 136(g_tTex2du4a) DescriptorSet 0
Decorate 139(g_tTexcdf4a) DescriptorSet 0
Decorate 142(g_tTexcdi4a) DescriptorSet 0
Decorate 145(g_tTexcdu4a) DescriptorSet 0
Decorate 107(g_tTex3df4) DescriptorSet 0
Decorate 110(g_tTex3di4) DescriptorSet 0
Decorate 113(g_tTex3du4) DescriptorSet 0
Decorate 116(g_tTexcdf4) DescriptorSet 0
Decorate 119(g_tTexcdi4) DescriptorSet 0
Decorate 122(g_tTexcdu4) DescriptorSet 0
Decorate 125(g_tTex1df4a) DescriptorSet 0
Decorate 128(g_tTex1di4a) DescriptorSet 0
Decorate 131(g_tTex1du4a) DescriptorSet 0
Decorate 134(g_tTex2df4a) DescriptorSet 0
Decorate 137(g_tTex2di4a) DescriptorSet 0
Decorate 140(g_tTex2du4a) DescriptorSet 0
Decorate 143(g_tTexcdf4a) DescriptorSet 0
Decorate 146(g_tTexcdi4a) DescriptorSet 0
Decorate 149(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -405,53 +425,56 @@ gl_FragCoord origin is upper left
92: TypeVector 6(float) 4
93(PS_OUTPUT): TypeStruct 92(fvec4) 6(float)
94: TypePointer Function 93(PS_OUTPUT)
96: 23(int) Constant 1
96: 23(int) Constant 0
97: 6(float) Constant 1065353216
101: TypeImage 6(float) 3D sampled format:Unknown
102: TypePointer UniformConstant 101
103(g_tTex3df4): 102(ptr) Variable UniformConstant
104: TypeImage 23(int) 3D sampled format:Unknown
105: TypePointer UniformConstant 104
106(g_tTex3di4): 105(ptr) Variable UniformConstant
107: TypeImage 39(int) 3D sampled format:Unknown
108: TypePointer UniformConstant 107
109(g_tTex3du4): 108(ptr) Variable UniformConstant
110: TypeImage 6(float) Cube sampled format:Unknown
111: TypePointer UniformConstant 110
112(g_tTexcdf4): 111(ptr) Variable UniformConstant
113: TypeImage 23(int) Cube sampled format:Unknown
114: TypePointer UniformConstant 113
115(g_tTexcdi4): 114(ptr) Variable UniformConstant
116: TypeImage 39(int) Cube sampled format:Unknown
117: TypePointer UniformConstant 116
118(g_tTexcdu4): 117(ptr) Variable UniformConstant
119: TypeImage 6(float) 1D array sampled format:Unknown
120: TypePointer UniformConstant 119
121(g_tTex1df4a): 120(ptr) Variable UniformConstant
122: TypeImage 23(int) 1D array sampled format:Unknown
123: TypePointer UniformConstant 122
124(g_tTex1di4a): 123(ptr) Variable UniformConstant
125: TypeImage 39(int) 1D array sampled format:Unknown
126: TypePointer UniformConstant 125
127(g_tTex1du4a): 126(ptr) Variable UniformConstant
128: TypeImage 6(float) 2D array sampled format:Unknown
129: TypePointer UniformConstant 128
130(g_tTex2df4a): 129(ptr) Variable UniformConstant
131: TypeImage 23(int) 2D array sampled format:Unknown
132: TypePointer UniformConstant 131
133(g_tTex2di4a): 132(ptr) Variable UniformConstant
134: TypeImage 39(int) 2D array sampled format:Unknown
135: TypePointer UniformConstant 134
136(g_tTex2du4a): 135(ptr) Variable UniformConstant
137: TypeImage 6(float) Cube array sampled format:Unknown
138: TypePointer UniformConstant 137
139(g_tTexcdf4a): 138(ptr) Variable UniformConstant
140: TypeImage 23(int) Cube array sampled format:Unknown
141: TypePointer UniformConstant 140
142(g_tTexcdi4a): 141(ptr) Variable UniformConstant
143: TypeImage 39(int) Cube array sampled format:Unknown
144: TypePointer UniformConstant 143
145(g_tTexcdu4a): 144(ptr) Variable UniformConstant
98: 92(fvec4) ConstantComposite 97 97 97 97
99: TypePointer Function 92(fvec4)
101: 23(int) Constant 1
105: TypeImage 6(float) 3D sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTex3df4): 106(ptr) Variable UniformConstant
108: TypeImage 23(int) 3D sampled format:Unknown
109: TypePointer UniformConstant 108
110(g_tTex3di4): 109(ptr) Variable UniformConstant
111: TypeImage 39(int) 3D sampled format:Unknown
112: TypePointer UniformConstant 111
113(g_tTex3du4): 112(ptr) Variable UniformConstant
114: TypeImage 6(float) Cube sampled format:Unknown
115: TypePointer UniformConstant 114
116(g_tTexcdf4): 115(ptr) Variable UniformConstant
117: TypeImage 23(int) Cube sampled format:Unknown
118: TypePointer UniformConstant 117
119(g_tTexcdi4): 118(ptr) Variable UniformConstant
120: TypeImage 39(int) Cube sampled format:Unknown
121: TypePointer UniformConstant 120
122(g_tTexcdu4): 121(ptr) Variable UniformConstant
123: TypeImage 6(float) 1D array sampled format:Unknown
124: TypePointer UniformConstant 123
125(g_tTex1df4a): 124(ptr) Variable UniformConstant
126: TypeImage 23(int) 1D array sampled format:Unknown
127: TypePointer UniformConstant 126
128(g_tTex1di4a): 127(ptr) Variable UniformConstant
129: TypeImage 39(int) 1D array sampled format:Unknown
130: TypePointer UniformConstant 129
131(g_tTex1du4a): 130(ptr) Variable UniformConstant
132: TypeImage 6(float) 2D array sampled format:Unknown
133: TypePointer UniformConstant 132
134(g_tTex2df4a): 133(ptr) Variable UniformConstant
135: TypeImage 23(int) 2D array sampled format:Unknown
136: TypePointer UniformConstant 135
137(g_tTex2di4a): 136(ptr) Variable UniformConstant
138: TypeImage 39(int) 2D array sampled format:Unknown
139: TypePointer UniformConstant 138
140(g_tTex2du4a): 139(ptr) Variable UniformConstant
141: TypeImage 6(float) Cube array sampled format:Unknown
142: TypePointer UniformConstant 141
143(g_tTexcdf4a): 142(ptr) Variable UniformConstant
144: TypeImage 23(int) Cube array sampled format:Unknown
145: TypePointer UniformConstant 144
146(g_tTexcdi4a): 145(ptr) Variable UniformConstant
147: TypeImage 39(int) Cube array sampled format:Unknown
148: TypePointer UniformConstant 147
149(g_tTexcdu4a): 148(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(r01): 7(ptr) Variable Function
@@ -500,8 +523,10 @@ gl_FragCoord origin is upper left
90: 6(float) CompositeExtract 89 0
91: 6(float) ImageSampleDrefExplicitLod 88 89 90 Lod ConstOffset 22 65
Store 80(r25) 91
98: 7(ptr) AccessChain 95(psout) 96
Store 98 97
99:93(PS_OUTPUT) Load 95(psout)
ReturnValue 99
100: 99(ptr) AccessChain 95(psout) 96
Store 100 98
102: 7(ptr) AccessChain 95(psout) 101
Store 102 97
103:93(PS_OUTPUT) Load 95(psout)
ReturnValue 103
FunctionEnd