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

@ -71,6 +71,16 @@ gl_FragCoord origin is upper left
0:49 Constant:
0:49 3 (const int)
0:49 'o2' (uniform 2-component vector of int)
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 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:51 Constant:
0:51 0 (const int)
0:51 Constant:
0:51 1.000000
0:51 1.000000
0:51 1.000000
0:51 1.000000
0:52 move second child to first child (temp float)
0:52 Depth: direct index for structure (temp float FragDepth)
0:52 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@ -173,6 +183,16 @@ gl_FragCoord origin is upper left
0:49 Constant:
0:49 3 (const int)
0:49 'o2' (uniform 2-component vector of int)
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 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:51 Constant:
0:51 0 (const int)
0:51 Constant:
0:51 1.000000
0:51 1.000000
0:51 1.000000
0:51 1.000000
0:52 move second child to first child (temp float)
0:52 Depth: direct index for structure (temp float FragDepth)
0:52 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
@ -201,7 +221,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 99
// Id's are bound by 103
Capability Shader
Capability ImageGatherExtended
@ -225,12 +245,12 @@ gl_FragCoord origin is upper left
MemberName 80(PS_OUTPUT) 0 "Color"
MemberName 80(PS_OUTPUT) 1 "Depth"
Name 82 "psout"
Name 91 "g_sSamp"
Name 93 "c1"
Name 95 "c4"
Name 96 "o1"
Name 97 "o3"
Name 98 "o4"
Name 95 "g_sSamp"
Name 97 "c1"
Name 99 "c4"
Name 100 "o1"
Name 101 "o3"
Name 102 "o4"
Decorate 9(g_tTex2dmsf4) DescriptorSet 0
Decorate 21(g_tTex2dmsi4) DescriptorSet 0
Decorate 29(g_tTex2dmsu4) DescriptorSet 0
@ -238,7 +258,7 @@ gl_FragCoord origin is upper left
Decorate 58(g_tTex2dmsi4a) DescriptorSet 0
Decorate 64(g_tTex2dmsu4a) DescriptorSet 0
MemberDecorate 80(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 91(g_sSamp) DescriptorSet 0
Decorate 95(g_sSamp) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -275,19 +295,22 @@ gl_FragCoord origin is upper left
64(g_tTex2dmsu4a): 63(ptr) Variable UniformConstant
80(PS_OUTPUT): TypeStruct 17(fvec4) 6(float)
81: TypePointer Function 80(PS_OUTPUT)
83: 11(int) Constant 1
83: 11(int) Constant 0
84: 6(float) Constant 1065353216
85: TypePointer Function 6(float)
89: TypeSampler
90: TypePointer UniformConstant 89
91(g_sSamp): 90(ptr) Variable UniformConstant
92: TypePointer UniformConstant 11(int)
93(c1): 92(ptr) Variable UniformConstant
94: TypePointer UniformConstant 24(ivec4)
95(c4): 94(ptr) Variable UniformConstant
96(o1): 92(ptr) Variable UniformConstant
97(o3): 52(ptr) Variable UniformConstant
98(o4): 94(ptr) Variable UniformConstant
85: 17(fvec4) ConstantComposite 84 84 84 84
86: TypePointer Function 17(fvec4)
88: 11(int) Constant 1
89: TypePointer Function 6(float)
93: TypeSampler
94: TypePointer UniformConstant 93
95(g_sSamp): 94(ptr) Variable UniformConstant
96: TypePointer UniformConstant 11(int)
97(c1): 96(ptr) Variable UniformConstant
98: TypePointer UniformConstant 24(ivec4)
99(c4): 98(ptr) Variable UniformConstant
100(o1): 96(ptr) Variable UniformConstant
101(o3): 52(ptr) Variable UniformConstant
102(o4): 98(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
82(psout): 81(ptr) Variable Function
@ -333,8 +356,10 @@ gl_FragCoord origin is upper left
77: 51(ivec3) Load 53(c3)
78: 12(ivec2) Load 36(o2)
79: 32(ivec4) ImageFetch 76 77 Offset Sample 78 16
86: 85(ptr) AccessChain 82(psout) 83
Store 86 84
87:80(PS_OUTPUT) Load 82(psout)
ReturnValue 87
87: 86(ptr) AccessChain 82(psout) 83
Store 87 85
90: 89(ptr) AccessChain 82(psout) 88
Store 90 84
91:80(PS_OUTPUT) Load 82(psout)
ReturnValue 91
FunctionEnd