HLSL: Fix binary-expression associativity and termination issue.

This commit is contained in:
John Kessenich 2016-07-28 21:43:17 -06:00
parent fea226ba43
commit 64076ed7e9
8 changed files with 243 additions and 180 deletions

View file

@ -12,11 +12,36 @@ gl_FragCoord origin is upper left
0:8 Branch: Return with expression
0:8 add (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 component-wise multiply (temp 4-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 component-wise multiply (temp 4-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 'a3' (in 4-component vector of float)
0:8 'a4' (in 4-component vector of float)
0:? Construct vec4 (temp 4-component vector of float)
0:8 component-wise multiply (temp 3-component vector of float)
0:8 vector swizzle (temp 3-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 Sequence
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 vector swizzle (temp 3-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 Sequence
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 direct index (temp float)
0:8 'a3' (in 4-component vector of float)
0:8 'a4' (in 4-component vector of float)
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
@ -36,16 +61,41 @@ gl_FragCoord origin is upper left
0:8 Branch: Return with expression
0:8 add (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 component-wise multiply (temp 4-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 component-wise multiply (temp 4-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 'a3' (in 4-component vector of float)
0:8 'a4' (in 4-component vector of float)
0:? Construct vec4 (temp 4-component vector of float)
0:8 component-wise multiply (temp 3-component vector of float)
0:8 vector swizzle (temp 3-component vector of float)
0:8 'a1' (in 4-component vector of float)
0:8 Sequence
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 vector swizzle (temp 3-component vector of float)
0:8 'a2' (in 4-component vector of float)
0:8 Sequence
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 1 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 direct index (temp float)
0:8 'a3' (in 4-component vector of float)
0:8 'a4' (in 4-component vector of float)
0:8 Constant:
0:8 3 (const int)
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 21
// Id's are bound by 37
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -67,6 +117,10 @@ gl_FragCoord origin is upper left
11(a2): 8(ptr) Variable Input
13(a3): 8(ptr) Variable Input
17(a4): 8(ptr) Variable Input
20: TypeVector 6(float) 3
26: TypeInt 32 0
27: 26(int) Constant 3
28: TypePointer Input 6(float)
4(PixelShaderFunction): 2 Function None 3
5: Label
10: 7(fvec4) Load 9(a1)
@ -76,5 +130,17 @@ gl_FragCoord origin is upper left
16: 7(fvec4) FAdd 10 15
18: 7(fvec4) Load 17(a4)
19: 7(fvec4) FAdd 16 18
ReturnValue 19
21: 7(fvec4) Load 9(a1)
22: 20(fvec3) VectorShuffle 21 21 0 1 2
23: 7(fvec4) Load 11(a2)
24: 20(fvec3) VectorShuffle 23 23 0 1 2
25: 20(fvec3) FMul 22 24
29: 28(ptr) AccessChain 13(a3) 27
30: 6(float) Load 29
31: 6(float) CompositeExtract 25 0
32: 6(float) CompositeExtract 25 1
33: 6(float) CompositeExtract 25 2
34: 7(fvec4) CompositeConstruct 31 32 33 30
35: 7(fvec4) FAdd 19 34
ReturnValue 35
FunctionEnd