Fix #857: Convert uniform int to local bool for struct alias assignment.

This was done for one direction, but not both directions, so this commit
picks up the other direction.
This commit is contained in:
John Kessenich
2017-05-19 23:00:13 -06:00
parent 0d2b4713c5
commit 80f92a190a
4 changed files with 303 additions and 295 deletions

View File

@@ -189,12 +189,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 94
// Id's are bound by 96
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 87 90
EntryPoint Fragment 4 "main" 89 92
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@@ -212,15 +212,15 @@ gl_FragCoord origin is upper left
Name 21 "sbuf"
MemberName 21(sbuf) 0 "@data"
Name 23 "sbuf"
Name 40 "size"
Name 42 "stride"
Name 57 "sbuf2"
MemberName 57(sbuf2) 0 "@data"
Name 43 "size"
Name 45 "stride"
Name 59 "sbuf2"
Name 85 "pos"
MemberName 59(sbuf2) 0 "@data"
Name 61 "sbuf2"
Name 87 "pos"
Name 90 "@entryPointOutput"
Name 91 "param"
Name 89 "pos"
Name 92 "@entryPointOutput"
Name 93 "param"
MemberDecorate 19(sb_t) 0 NonWritable
MemberDecorate 19(sb_t) 0 Offset 0
MemberDecorate 19(sb_t) 1 NonWritable
@@ -233,13 +233,13 @@ gl_FragCoord origin is upper left
Decorate 21(sbuf) BufferBlock
Decorate 23(sbuf) DescriptorSet 0
Decorate 23(sbuf) Binding 10
Decorate 56 ArrayStride 4
MemberDecorate 57(sbuf2) 0 NonWritable
MemberDecorate 57(sbuf2) 0 Offset 0
Decorate 57(sbuf2) BufferBlock
Decorate 59(sbuf2) DescriptorSet 0
Decorate 87(pos) Location 0
Decorate 90(@entryPointOutput) Location 0
Decorate 58 ArrayStride 4
MemberDecorate 59(sbuf2) 0 NonWritable
MemberDecorate 59(sbuf2) 0 Offset 0
Decorate 59(sbuf2) BufferBlock
Decorate 61(sbuf2) DescriptorSet 0
Decorate 89(pos) Location 0
Decorate 92(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@@ -261,41 +261,41 @@ gl_FragCoord origin is upper left
27: TypePointer Uniform 19(sb_t)
31: TypePointer Function 14(fvec3)
34: 24(int) Constant 1
35: TypePointer Function 15(bool)
38: 24(int) Constant 2
43: 6(int) Constant 32
45: TypePointer Uniform 6(int)
48: 6(int) Constant 0
53: TypePointer Uniform 14(fvec3)
56: TypeRuntimeArray 8(float)
57(sbuf2): TypeStruct 56
58: TypePointer Uniform 57(sbuf2)
59(sbuf2): 58(ptr) Variable Uniform
61: TypePointer Uniform 8(float)
66: 8(float) Constant 0
73: TypePointer Function 8(float)
86: TypePointer Input 6(int)
87(pos): 86(ptr) Variable Input
89: TypePointer Output 9(fvec4)
90(@entryPointOutput): 89(ptr) Variable Output
35: 6(int) Constant 0
37: TypePointer Function 15(bool)
40: 24(int) Constant 2
46: 6(int) Constant 32
48: TypePointer Uniform 6(int)
55: TypePointer Uniform 14(fvec3)
58: TypeRuntimeArray 8(float)
59(sbuf2): TypeStruct 58
60: TypePointer Uniform 59(sbuf2)
61(sbuf2): 60(ptr) Variable Uniform
63: TypePointer Uniform 8(float)
68: 8(float) Constant 0
75: TypePointer Function 8(float)
88: TypePointer Input 6(int)
89(pos): 88(ptr) Variable Input
91: TypePointer Output 9(fvec4)
92(@entryPointOutput): 91(ptr) Variable Output
4(main): 2 Function None 3
5: Label
85(pos): 7(ptr) Variable Function
91(param): 7(ptr) Variable Function
88: 6(int) Load 87(pos)
Store 85(pos) 88
92: 6(int) Load 85(pos)
Store 91(param) 92
93: 9(fvec4) FunctionCall 12(@main(u1;) 91(param)
Store 90(@entryPointOutput) 93
87(pos): 7(ptr) Variable Function
93(param): 7(ptr) Variable Function
90: 6(int) Load 89(pos)
Store 87(pos) 90
94: 6(int) Load 87(pos)
Store 93(param) 94
95: 9(fvec4) FunctionCall 12(@main(u1;) 93(param)
Store 92(@entryPointOutput) 95
Return
FunctionEnd
12(@main(u1;): 9(fvec4) Function None 10
11(pos): 7(ptr) FunctionParameter
13: Label
18(mydata): 17(ptr) Variable Function
40(size): 7(ptr) Variable Function
42(stride): 7(ptr) Variable Function
43(size): 7(ptr) Variable Function
45(stride): 7(ptr) Variable Function
26: 6(int) Load 11(pos)
28: 27(ptr) AccessChain 23(sbuf) 25 26
29: 19(sb_t) Load 28
@@ -303,46 +303,48 @@ gl_FragCoord origin is upper left
32: 31(ptr) AccessChain 18(mydata) 25
Store 32 30
33: 6(int) CompositeExtract 29 1
36: 35(ptr) AccessChain 18(mydata) 34
Store 36 33
37: 6(int) CompositeExtract 29 2
39: 35(ptr) AccessChain 18(mydata) 38
Store 39 37
41: 24(int) ArrayLength 23(sbuf) 0
Store 40(size) 41
Store 42(stride) 43
44: 6(int) Load 11(pos)
46: 45(ptr) AccessChain 23(sbuf) 25 44 34
47: 6(int) Load 46
49: 15(bool) INotEqual 47 48
SelectionMerge 51 None
BranchConditional 49 50 72
50: Label
52: 6(int) Load 11(pos)
54: 53(ptr) AccessChain 23(sbuf) 25 52 25
55: 14(fvec3) Load 54
60: 6(int) Load 11(pos)
62: 61(ptr) AccessChain 59(sbuf2) 25 60
63: 8(float) Load 62
64: 14(fvec3) CompositeConstruct 63 63 63
65: 14(fvec3) FAdd 55 64
67: 8(float) CompositeExtract 65 0
68: 8(float) CompositeExtract 65 1
69: 8(float) CompositeExtract 65 2
70: 9(fvec4) CompositeConstruct 67 68 69 66
ReturnValue 70
72: Label
74: 73(ptr) AccessChain 18(mydata) 25 48
75: 8(float) Load 74
76: 6(int) Load 40(size)
77: 8(float) ConvertUToF 76
78: 8(float) FAdd 75 77
79: 6(int) Load 42(stride)
80: 8(float) ConvertUToF 79
81: 8(float) FAdd 78 80
82: 9(fvec4) CompositeConstruct 81 81 81 81
ReturnValue 82
51: Label
84: 9(fvec4) Undef
ReturnValue 84
36: 15(bool) INotEqual 33 35
38: 37(ptr) AccessChain 18(mydata) 34
Store 38 36
39: 6(int) CompositeExtract 29 2
41: 15(bool) INotEqual 39 35
42: 37(ptr) AccessChain 18(mydata) 40
Store 42 41
44: 24(int) ArrayLength 23(sbuf) 0
Store 43(size) 44
Store 45(stride) 46
47: 6(int) Load 11(pos)
49: 48(ptr) AccessChain 23(sbuf) 25 47 34
50: 6(int) Load 49
51: 15(bool) INotEqual 50 35
SelectionMerge 53 None
BranchConditional 51 52 74
52: Label
54: 6(int) Load 11(pos)
56: 55(ptr) AccessChain 23(sbuf) 25 54 25
57: 14(fvec3) Load 56
62: 6(int) Load 11(pos)
64: 63(ptr) AccessChain 61(sbuf2) 25 62
65: 8(float) Load 64
66: 14(fvec3) CompositeConstruct 65 65 65
67: 14(fvec3) FAdd 57 66
69: 8(float) CompositeExtract 67 0
70: 8(float) CompositeExtract 67 1
71: 8(float) CompositeExtract 67 2
72: 9(fvec4) CompositeConstruct 69 70 71 68
ReturnValue 72
74: Label
76: 75(ptr) AccessChain 18(mydata) 25 35
77: 8(float) Load 76
78: 6(int) Load 43(size)
79: 8(float) ConvertUToF 78
80: 8(float) FAdd 77 79
81: 6(int) Load 45(stride)
82: 8(float) ConvertUToF 81
83: 8(float) FAdd 80 82
84: 9(fvec4) CompositeConstruct 83 83 83 83
ReturnValue 84
53: Label
86: 9(fvec4) Undef
ReturnValue 86
FunctionEnd