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

@@ -50,6 +50,14 @@ gl_FragCoord origin is upper left
0:15 'r08' (temp uint)
0:15 Constant:
0:15 58 (const uint)
0:18 move second child to first child (temp 4-component vector of float)
0:18 color: direct index for structure (temp 4-component vector of float)
0:18 'ps_output' (temp structure{temp 4-component vector of float color})
0:18 Constant:
0:18 0 (const int)
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Branch: Return with expression
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:? Linker Objects
@@ -109,13 +117,21 @@ gl_FragCoord origin is upper left
0:15 'r08' (temp uint)
0:15 Constant:
0:15 58 (const uint)
0:18 move second child to first child (temp 4-component vector of float)
0:18 color: direct index for structure (temp 4-component vector of float)
0:18 'ps_output' (temp structure{temp 4-component vector of float color})
0:18 Constant:
0:18 0 (const int)
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Branch: Return with expression
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 35
// Id's are bound by 41
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -155,6 +171,8 @@ gl_FragCoord origin is upper left
29: TypeVector 6(float) 4
30(PS_OUTPUT): TypeStruct 29(fvec4)
31: TypePointer Function 30(PS_OUTPUT)
33: 19(int) Constant 0
37: TypePointer Function 29(fvec4)
4(main): 2 Function None 3
5: Label
8(r00): 7(ptr) Variable Function
@@ -176,6 +194,11 @@ gl_FragCoord origin is upper left
Store 23(r06) 24
Store 25(r07) 26
Store 27(r08) 28
33:30(PS_OUTPUT) Load 32(ps_output)
ReturnValue 33
34: 19(int) Load 25(r07)
35: 6(float) ConvertSToF 34
36: 29(fvec4) CompositeConstruct 35 35 35 35
38: 37(ptr) AccessChain 32(ps_output) 33
Store 38 36
39:30(PS_OUTPUT) Load 32(ps_output)
ReturnValue 39
FunctionEnd