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

@ -11,38 +11,38 @@ gl_FragCoord origin is upper left
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 direct index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 direct index (temp 4-component vector of float)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 indirect index (temp 4-component vector of float)
0:10 m: direct index for structure (temp 7-element array of 4-component vector of float)
0:10 indirect index (temp structure{temp 7-element array of 4-component vector of float m})
0:10 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
0:10 'i' (in int)
0:10 Constant:
0:10 0 (const int)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 indirect index (temp 4-component vector of float)
0:10 m: direct index for structure (temp 7-element array of 4-component vector of float)
0:10 indirect index (temp structure{temp 7-element array of 4-component vector of float m})
0:10 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
0:10 'i' (in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' (in int)
0:? Linker Objects
0:? 'a' (global 4-element array of 4-component vector of float)
0:? 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
@ -63,38 +63,38 @@ gl_FragCoord origin is upper left
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 direct index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'a' (global 4-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 direct index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'input' (in 3-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 direct index (temp 4-component vector of float)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index (temp 4-component vector of float)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 indirect index (temp 4-component vector of float)
0:10 m: direct index for structure (temp 7-element array of 4-component vector of float)
0:10 indirect index (temp structure{temp 7-element array of 4-component vector of float m})
0:10 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
0:10 'i' (in int)
0:10 Constant:
0:10 0 (const int)
0:10 'b' (temp 10-element array of 4-component vector of float)
0:10 'i' (in int)
0:10 indirect index (temp 4-component vector of float)
0:10 m: direct index for structure (temp 7-element array of 4-component vector of float)
0:10 indirect index (temp structure{temp 7-element array of 4-component vector of float m})
0:10 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
0:10 'i' (in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' (in int)
0:? Linker Objects
0:? 'a' (global 4-element array of 4-component vector of float)
0:? 's' (global 11-element array of structure{temp 7-element array of 4-component vector of float m})
@ -114,9 +114,9 @@ gl_FragCoord origin is upper left
Name 19 "i"
Name 27 "input"
Name 40 "b"
Name 51 ""
MemberName 51 0 "m"
Name 55 "s"
Name 52 ""
MemberName 52 0 "m"
Name 56 "s"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -142,14 +142,14 @@ gl_FragCoord origin is upper left
39: TypePointer Function 38
41: 13(int) Constant 5
42: TypePointer Function 7(fvec4)
49: 8(int) Constant 7
50: TypeArray 7(fvec4) 49
51: TypeStruct 50
52: 8(int) Constant 11
53: TypeArray 51(struct) 52
54: TypePointer Private 53
55(s): 54(ptr) Variable Private
57: 13(int) Constant 0
50: 8(int) Constant 7
51: TypeArray 7(fvec4) 50
52: TypeStruct 51
53: 8(int) Constant 11
54: TypeArray 52(struct) 53
55: TypePointer Private 54
56(s): 55(ptr) Variable Private
58: 13(int) Constant 0
4(PixelShaderFunction): 2 Function None 3
5: Label
40(b): 39(ptr) Variable Function
@ -161,22 +161,22 @@ gl_FragCoord origin is upper left
23: 7(fvec4) FAdd 17 22
30: 29(ptr) AccessChain 27(input) 28
31: 7(fvec4) Load 30
32: 13(int) Load 19(i)
33: 29(ptr) AccessChain 27(input) 32
34: 7(fvec4) Load 33
35: 7(fvec4) FAdd 31 34
36: 7(fvec4) FAdd 23 35
32: 7(fvec4) FAdd 23 31
33: 13(int) Load 19(i)
34: 29(ptr) AccessChain 27(input) 33
35: 7(fvec4) Load 34
36: 7(fvec4) FAdd 32 35
43: 42(ptr) AccessChain 40(b) 41
44: 7(fvec4) Load 43
45: 13(int) Load 19(i)
46: 42(ptr) AccessChain 40(b) 45
47: 7(fvec4) Load 46
48: 7(fvec4) FAdd 44 47
56: 13(int) Load 19(i)
58: 13(int) Load 19(i)
59: 15(ptr) AccessChain 55(s) 56 57 58
60: 7(fvec4) Load 59
61: 7(fvec4) FAdd 48 60
62: 7(fvec4) FAdd 36 61
45: 7(fvec4) FAdd 36 44
46: 13(int) Load 19(i)
47: 42(ptr) AccessChain 40(b) 46
48: 7(fvec4) Load 47
49: 7(fvec4) FAdd 45 48
57: 13(int) Load 19(i)
59: 13(int) Load 19(i)
60: 15(ptr) AccessChain 56(s) 57 58 59
61: 7(fvec4) Load 60
62: 7(fvec4) FAdd 49 61
ReturnValue 62
FunctionEnd

View File

@ -23,11 +23,11 @@ gl_FragCoord origin is upper left
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 'a1' (in 4-component vector of float)
0:10 'a2' (in 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 'a1' (in 4-component vector of float)
0:10 'a2' (in 4-component vector of float)
0:10 'a3' (in 4-component vector of float)
0:10 'a4' (in 4-component vector of float)
0:10 'a4' (in 4-component vector of float)
0:10 'a5' (in 4-component vector of float)
0:? Linker Objects
@ -59,11 +59,11 @@ gl_FragCoord origin is upper left
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 'a1' (in 4-component vector of float)
0:10 'a2' (in 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 add (temp 4-component vector of float)
0:10 'a1' (in 4-component vector of float)
0:10 'a2' (in 4-component vector of float)
0:10 'a3' (in 4-component vector of float)
0:10 'a4' (in 4-component vector of float)
0:10 'a4' (in 4-component vector of float)
0:10 'a5' (in 4-component vector of float)
0:? Linker Objects
@ -104,9 +104,9 @@ gl_FragCoord origin is upper left
16: 7(fvec4) Load 10(a2)
17: 7(fvec4) FAdd 15 16
18: 7(fvec4) Load 11(a3)
19: 7(fvec4) Load 12(a4)
20: 7(fvec4) FAdd 18 19
21: 7(fvec4) FAdd 17 20
19: 7(fvec4) FAdd 17 18
20: 7(fvec4) Load 12(a4)
21: 7(fvec4) FAdd 19 20
22: 7(fvec4) Load 13(a5)
23: 7(fvec4) FAdd 21 22
ReturnValue 23

View File

@ -10,20 +10,20 @@ gl_FragCoord origin is upper left
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 'input' (in 4-component vector of float)
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
0:21 Constant:
0:21 0 (const uint)
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 'input' (in 4-component vector of float)
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
0:21 Constant:
0:21 0 (const uint)
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
0:21 Constant:
0:21 0 (const uint)
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
0:21 Constant:
0:21 0 (const uint)
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
0:21 Constant:
0:21 0 (const uint)
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
0:21 Constant:
@ -49,20 +49,20 @@ gl_FragCoord origin is upper left
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 'input' (in 4-component vector of float)
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
0:21 Constant:
0:21 0 (const uint)
0:21 add (temp 4-component vector of float)
0:21 add (temp 4-component vector of float)
0:21 'input' (in 4-component vector of float)
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
0:21 Constant:
0:21 0 (const uint)
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
0:21 Constant:
0:21 0 (const uint)
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
0:21 Constant:
0:21 0 (const uint)
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
0:21 Constant:
0:21 0 (const uint)
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
0:21 Constant:
@ -91,10 +91,10 @@ gl_FragCoord origin is upper left
Name 20 ""
MemberName 20 0 "v2"
Name 22 ""
Name 25 ""
MemberName 25 0 "v3"
MemberName 25 1 "i3"
Name 27 ""
Name 26 ""
MemberName 26 0 "v3"
MemberName 26 1 "i3"
Name 28 ""
Name 32 ""
MemberName 32 0 "v4"
MemberName 32 1 "i4"
@ -105,10 +105,10 @@ gl_FragCoord origin is upper left
MemberDecorate 20 0 Offset 0
Decorate 20 BufferBlock
Decorate 22 DescriptorSet 0
MemberDecorate 25 0 Offset 0
MemberDecorate 25 1 Offset 16
Decorate 25 Block
Decorate 27 DescriptorSet 0
MemberDecorate 26 0 Offset 0
MemberDecorate 26 1 Offset 16
Decorate 26 Block
Decorate 28 DescriptorSet 0
MemberDecorate 32 0 Offset 0
MemberDecorate 32 1 Offset 16
Decorate 32 BufferBlock
@ -128,9 +128,9 @@ gl_FragCoord origin is upper left
20: TypeStruct 7(fvec4)
21: TypePointer Uniform 20(struct)
22: 21(ptr) Variable Uniform
25: TypeStruct 7(fvec4) 14(int)
26: TypePointer Uniform 25(struct)
27: 26(ptr) Variable Uniform
26: TypeStruct 7(fvec4) 14(int)
27: TypePointer Uniform 26(struct)
28: 27(ptr) Variable Uniform
32: TypeStruct 7(fvec4) 14(int)
33: TypePointer Uniform 32(struct)
34: 33(ptr) Variable Uniform
@ -142,10 +142,10 @@ gl_FragCoord origin is upper left
19: 7(fvec4) FAdd 10 18
23: 16(ptr) AccessChain 22 15
24: 7(fvec4) Load 23
28: 16(ptr) AccessChain 27 15
29: 7(fvec4) Load 28
30: 7(fvec4) FAdd 24 29
31: 7(fvec4) FAdd 19 30
25: 7(fvec4) FAdd 19 24
29: 16(ptr) AccessChain 28 15
30: 7(fvec4) Load 29
31: 7(fvec4) FAdd 25 30
35: 16(ptr) AccessChain 34 15
36: 7(fvec4) Load 35
37: 7(fvec4) FAdd 31 36

View File

@ -29,25 +29,25 @@ gl_FragCoord origin is upper left
0:7 Sequence
0:7 move second child to first child (temp 4-component vector of float)
0:7 'ret' (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:7 add (temp 4-component vector of float)
0:7 vector-scale (temp 4-component vector of float)
0:7 Convert int to float (temp float)
0:7 'a' (temp int)
0:7 'input' (in 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Convert int to float (temp float)
0:8 'b' (temp int)
0:8 'input' (in 4-component vector of float)
0:9 add (temp 4-component vector of float)
0:9 add (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:7 add (temp 4-component vector of float)
0:7 vector-scale (temp 4-component vector of float)
0:7 Convert int to float (temp float)
0:7 'a' (temp int)
0:7 'input' (in 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Convert int to float (temp float)
0:8 'b' (temp int)
0:8 'input' (in 4-component vector of float)
0:9 vector-scale (temp 4-component vector of float)
0:9 Convert int to float (temp float)
0:9 'c' (temp int)
0:9 'input' (in 4-component vector of float)
0:10 vector-scale (temp 4-component vector of float)
0:10 Convert int to float (temp float)
0:10 'd' (temp int)
0:10 'input' (in 4-component vector of float)
0:10 vector-scale (temp 4-component vector of float)
0:10 Convert int to float (temp float)
0:10 'd' (temp int)
0:10 'input' (in 4-component vector of float)
0:12 Comma (temp int)
0:12 move second child to first child (temp int)
0:12 'e' (temp int)
@ -141,25 +141,25 @@ gl_FragCoord origin is upper left
0:7 Sequence
0:7 move second child to first child (temp 4-component vector of float)
0:7 'ret' (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:7 add (temp 4-component vector of float)
0:7 vector-scale (temp 4-component vector of float)
0:7 Convert int to float (temp float)
0:7 'a' (temp int)
0:7 'input' (in 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Convert int to float (temp float)
0:8 'b' (temp int)
0:8 'input' (in 4-component vector of float)
0:9 add (temp 4-component vector of float)
0:9 add (temp 4-component vector of float)
0:8 add (temp 4-component vector of float)
0:7 add (temp 4-component vector of float)
0:7 vector-scale (temp 4-component vector of float)
0:7 Convert int to float (temp float)
0:7 'a' (temp int)
0:7 'input' (in 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Convert int to float (temp float)
0:8 'b' (temp int)
0:8 'input' (in 4-component vector of float)
0:9 vector-scale (temp 4-component vector of float)
0:9 Convert int to float (temp float)
0:9 'c' (temp int)
0:9 'input' (in 4-component vector of float)
0:10 vector-scale (temp 4-component vector of float)
0:10 Convert int to float (temp float)
0:10 'd' (temp int)
0:10 'input' (in 4-component vector of float)
0:10 vector-scale (temp 4-component vector of float)
0:10 Convert int to float (temp float)
0:10 'd' (temp int)
0:10 'input' (in 4-component vector of float)
0:12 Comma (temp int)
0:12 move second child to first child (temp int)
0:12 'e' (temp int)
@ -287,12 +287,12 @@ gl_FragCoord origin is upper left
31: 15(float) ConvertSToF 30
32: 16(fvec4) Load 22(input)
33: 16(fvec4) VectorTimesScalar 32 31
34: 6(int) Load 14(d)
35: 15(float) ConvertSToF 34
36: 16(fvec4) Load 22(input)
37: 16(fvec4) VectorTimesScalar 36 35
38: 16(fvec4) FAdd 33 37
39: 16(fvec4) FAdd 29 38
34: 16(fvec4) FAdd 29 33
35: 6(int) Load 14(d)
36: 15(float) ConvertSToF 35
37: 16(fvec4) Load 22(input)
38: 16(fvec4) VectorTimesScalar 37 36
39: 16(fvec4) FAdd 34 38
Store 18(ret) 39
42: 6(int) Load 10(b)
SelectionMerge 44 None

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

View File

@ -5,5 +5,5 @@ float4 PixelShaderFunction(
float4 a4
) : COLOR0
{
return a1 + a2 * a3 + a4;
return a1 + a2 * a3 + a4 + float4(a1.rgb * a2.rgb, a3.a);
}

View File

@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "SPIRV99.1361"
#define GLSLANG_REVISION "SPIRV99.1362"
#define GLSLANG_DATE "28-Jul-2016"

View File

@ -1675,12 +1675,12 @@ bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel pr
if (! acceptBinaryExpression(node, (PrecedenceLevel)(precedenceLevel + 1)))
return false;
TOperator op = HlslOpMap::binary(peek());
PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op);
if (tokenLevel < precedenceLevel)
return true;
do {
TOperator op = HlslOpMap::binary(peek());
PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op);
if (tokenLevel < precedenceLevel)
return true;
// ... op
TSourceLoc loc = token.loc;
advanceToken();
@ -1697,9 +1697,6 @@ bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel pr
parseContext.error(loc, "Could not perform requested binary operation", "", "");
return false;
}
if (! peekTokenClass(EHTokComma))
return true;
} while (true);
}