SPV non-functional: minor readability improvements for texturing.

This commit is contained in:
John Kessenich 2016-06-16 12:43:23 -06:00
parent ac666e7368
commit 76d4dfcd51
7 changed files with 328 additions and 386 deletions

View File

@ -643,9 +643,9 @@ bool HasNonLayoutQualifiers(const glslang::TQualifier& qualifier)
{ {
// This should list qualifiers that simultaneous satisfy: // This should list qualifiers that simultaneous satisfy:
// - struct members can inherit from a struct declaration // - struct members can inherit from a struct declaration
// - effect decorations on the struct members (note smooth does not, and expecting something like volatile to effect the whole object) // - affect decorations on the struct members (note smooth does not, and expecting something like volatile to effect the whole object)
// - are not part of the offset/st430/etc or row/column-major layout // - are not part of the offset/st430/etc or row/column-major layout
return qualifier.invariant || qualifier.nopersp || qualifier.flat || qualifier.centroid || qualifier.patch || qualifier.sample || qualifier.hasLocation(); return qualifier.invariant || qualifier.hasLocation();
} }
// //
@ -1913,8 +1913,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangType)); addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangType));
// Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes // Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes
if (type.getQualifier().storage == glslang::EvqVaryingIn || type.getQualifier().storage == glslang::EvqVaryingOut) { if (type.getQualifier().storage == glslang::EvqVaryingIn || type.getQualifier().storage == glslang::EvqVaryingOut) {
addMemberDecoration(spvType, member, TranslateInterpolationDecoration(subQualifier)); if (type.getBasicType() == glslang::EbtBlock) {
addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(subQualifier)); addMemberDecoration(spvType, member, TranslateInterpolationDecoration(subQualifier));
addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(subQualifier));
}
} }
addMemberDecoration(spvType, member, TranslateInvariantDecoration(subQualifier)); addMemberDecoration(spvType, member, TranslateInvariantDecoration(subQualifier));
@ -2606,14 +2608,16 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
++extraArgs; ++extraArgs;
} else if (sampler.shadow) { } else if (sampler.shadow) {
std::vector<spv::Id> indexes; std::vector<spv::Id> indexes;
int comp; int dRefComp;
if (cracked.proj) if (cracked.proj)
comp = 2; // "The resulting 3rd component of P in the shadow forms is used as Dref" dRefComp = 2; // "The resulting 3rd component of P in the shadow forms is used as Dref"
else else
comp = builder.getNumComponents(params.coords) - 1; dRefComp = builder.getNumComponents(params.coords) - 1;
indexes.push_back(comp); indexes.push_back(dRefComp);
params.Dref = builder.createCompositeExtract(params.coords, builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes); params.Dref = builder.createCompositeExtract(params.coords, builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes);
} }
// lod
if (cracked.lod) { if (cracked.lod) {
params.lod = arguments[2]; params.lod = arguments[2];
++extraArgs; ++extraArgs;
@ -2621,15 +2625,21 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
// we need to invent the default lod for an explicit lod instruction for a non-fragment stage // we need to invent the default lod for an explicit lod instruction for a non-fragment stage
noImplicitLod = true; noImplicitLod = true;
} }
// multisample
if (sampler.ms) { if (sampler.ms) {
params.sample = arguments[2]; // For MS, "sample" should be specified params.sample = arguments[2]; // For MS, "sample" should be specified
++extraArgs; ++extraArgs;
} }
// gradient
if (cracked.grad) { if (cracked.grad) {
params.gradX = arguments[2 + extraArgs]; params.gradX = arguments[2 + extraArgs];
params.gradY = arguments[3 + extraArgs]; params.gradY = arguments[3 + extraArgs];
extraArgs += 2; extraArgs += 2;
} }
// offset and offsets
if (cracked.offset) { if (cracked.offset) {
params.offset = arguments[2 + extraArgs]; params.offset = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
@ -2637,25 +2647,33 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
params.offsets = arguments[2 + extraArgs]; params.offsets = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
} }
// lod clamp
if (cracked.lodClamp) { if (cracked.lodClamp) {
params.lodClamp = arguments[2 + extraArgs]; params.lodClamp = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
} }
// sparse
if (sparse) { if (sparse) {
params.texelOut = arguments[2 + extraArgs]; params.texelOut = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
} }
// bias
if (bias) { if (bias) {
params.bias = arguments[2 + extraArgs]; params.bias = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
} }
// gather component
if (cracked.gather && ! sampler.shadow) { if (cracked.gather && ! sampler.shadow) {
// default component is 0, if missing, otherwise an argument // default component is 0, if missing, otherwise an argument
if (2 + extraArgs < (int)arguments.size()) { if (2 + extraArgs < (int)arguments.size()) {
params.comp = arguments[2 + extraArgs]; params.component = arguments[2 + extraArgs];
++extraArgs; ++extraArgs;
} else { } else {
params.comp = builder.makeIntConstant(0); params.component = builder.makeIntConstant(0);
} }
} }

View File

@ -1430,10 +1430,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
bool explicitLod = false; bool explicitLod = false;
texArgs[numArgs++] = parameters.sampler; texArgs[numArgs++] = parameters.sampler;
texArgs[numArgs++] = parameters.coords; texArgs[numArgs++] = parameters.coords;
if (parameters.Dref) if (parameters.Dref != NoResult)
texArgs[numArgs++] = parameters.Dref; texArgs[numArgs++] = parameters.Dref;
if (parameters.comp) if (parameters.component != NoResult)
texArgs[numArgs++] = parameters.comp; texArgs[numArgs++] = parameters.component;
// //
// Set up the optional arguments // Set up the optional arguments

View File

@ -321,7 +321,7 @@ public:
Id gradX; Id gradX;
Id gradY; Id gradY;
Id sample; Id sample;
Id comp; Id component;
Id texelOut; Id texelOut;
Id lodClamp; Id lodClamp;
}; };

View File

@ -63,9 +63,6 @@ Linked vertex stage:
Decorate 55(sampb2) Binding 5 Decorate 55(sampb2) Binding 5
Decorate 56(sampb4) DescriptorSet 0 Decorate 56(sampb4) DescriptorSet 0
Decorate 56(sampb4) Binding 31 Decorate 56(sampb4) Binding 31
MemberDecorate 60(SS) 0 Flat
MemberDecorate 60(SS) 1 Flat
MemberDecorate 60(SS) 2 Flat
Decorate 62(var) Location 0 Decorate 62(var) Location 0
MemberDecorate 63(MS) 0 Location 17 MemberDecorate 63(MS) 0 Location 17
Decorate 63(MS) Block Decorate 63(MS) Block

View File

@ -7,12 +7,12 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 67 // Id's are bound by 66
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 63 66 EntryPoint Vertex 4 "main" 62 65
Source GLSL 450 Source GLSL 450
Name 4 "main" Name 4 "main"
Name 14 "S" Name 14 "S"
@ -82,16 +82,12 @@ Linked vertex stage:
MemberName 58(bBt3) 0 "ntcol" MemberName 58(bBt3) 0 "ntcol"
MemberName 58(bBt3) 1 "ntrow" MemberName 58(bBt3) 1 "ntrow"
Name 60 "bBtn3" Name 60 "bBtn3"
Name 61 "S" Name 62 "sout"
MemberName 61(S) 0 "a" Name 63 "S"
MemberName 61(S) 1 "b" MemberName 63(S) 0 "a"
MemberName 61(S) 2 "c" MemberName 63(S) 1 "b"
Name 63 "sout" MemberName 63(S) 2 "c"
Name 64 "S" Name 65 "soutinv"
MemberName 64(S) 0 "a"
MemberName 64(S) 1 "b"
MemberName 64(S) 2 "c"
Name 66 "soutinv"
Decorate 13 ArrayStride 32 Decorate 13 ArrayStride 32
MemberDecorate 14(S) 0 Offset 0 MemberDecorate 14(S) 0 Offset 0
MemberDecorate 14(S) 1 ColMajor MemberDecorate 14(S) 1 ColMajor
@ -166,13 +162,10 @@ Linked vertex stage:
Decorate 58(bBt3) BufferBlock Decorate 58(bBt3) BufferBlock
Decorate 60(bBtn3) DescriptorSet 1 Decorate 60(bBtn3) DescriptorSet 1
Decorate 60(bBtn3) Binding 0 Decorate 60(bBtn3) Binding 0
MemberDecorate 61(S) 0 Flat MemberDecorate 63(S) 0 Invariant
MemberDecorate 61(S) 1 Flat MemberDecorate 63(S) 1 Invariant
MemberDecorate 61(S) 2 Flat MemberDecorate 63(S) 2 Invariant
MemberDecorate 64(S) 0 Invariant Decorate 65(soutinv) Invariant
MemberDecorate 64(S) 1 Invariant
MemberDecorate 64(S) 2 Invariant
Decorate 66(soutinv) Invariant
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
@ -230,12 +223,11 @@ Linked vertex stage:
58(bBt3): TypeStruct 49(Nestor) 54(Nestor) 58(bBt3): TypeStruct 49(Nestor) 54(Nestor)
59: TypePointer Uniform 58(bBt3) 59: TypePointer Uniform 58(bBt3)
60(bBtn3): 59(ptr) Variable Uniform 60(bBtn3): 59(ptr) Variable Uniform
61(S): TypeStruct 8(ivec3) 13 7(int) 61: TypePointer Output 29(S)
62: TypePointer Output 61(S) 62(sout): 61(ptr) Variable Output
63(sout): 62(ptr) Variable Output 63(S): TypeStruct 8(ivec3) 13 7(int)
64(S): TypeStruct 8(ivec3) 13 7(int) 64: TypePointer Output 63(S)
65: TypePointer Output 64(S) 65(soutinv): 64(ptr) Variable Output
66(soutinv): 65(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
Return Return

View File

@ -7,12 +7,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 143 // Id's are bound by 136
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 18 43 93 101 111 138 142 EntryPoint Fragment 4 "main" 15 40 90 98 108 134 135
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source GLSL 400 Source GLSL 400
Name 4 "main" Name 4 "main"
@ -25,59 +25,27 @@ Linked fragment stage:
MemberName 10(s2) 2 "s1_1" MemberName 10(s2) 2 "s1_1"
MemberName 10(s2) 3 "bleh" MemberName 10(s2) 3 "bleh"
Name 12 "locals2" Name 12 "locals2"
Name 13 "s1" Name 13 "s3"
MemberName 13(s1) 0 "i" MemberName 13(s3) 0 "s2_1"
MemberName 13(s1) 1 "f" MemberName 13(s3) 1 "i"
Name 14 "s2" MemberName 13(s3) 2 "f"
MemberName 14(s2) 0 "i" MemberName 13(s3) 3 "s1_1"
MemberName 14(s2) 1 "f" Name 15 "foo3"
MemberName 14(s2) 2 "s1_1" Name 36 "localFArray"
MemberName 14(s2) 3 "bleh" Name 40 "coord"
Name 15 "s1" Name 49 "localIArray"
MemberName 15(s1) 0 "i" Name 68 "x"
MemberName 15(s1) 1 "f" Name 70 "localArray"
Name 16 "s3" Name 75 "i"
MemberName 16(s3) 0 "s2_1" Name 84 "a"
MemberName 16(s3) 1 "i" Name 90 "condition"
MemberName 16(s3) 2 "f" Name 98 "color"
MemberName 16(s3) 3 "s1_1" Name 108 "gl_FragColor"
Name 18 "foo3" Name 128 "samp2D"
Name 39 "localFArray" Name 134 "foo"
Name 43 "coord" Name 135 "foo2"
Name 52 "localIArray" Decorate 90(condition) Flat
Name 71 "x" Decorate 128(samp2D) DescriptorSet 0
Name 73 "localArray"
Name 78 "i"
Name 87 "a"
Name 93 "condition"
Name 101 "color"
Name 111 "gl_FragColor"
Name 131 "samp2D"
Name 136 "s1"
MemberName 136(s1) 0 "i"
MemberName 136(s1) 1 "f"
Name 138 "foo"
Name 139 "s1"
MemberName 139(s1) 0 "i"
MemberName 139(s1) 1 "f"
Name 140 "s2"
MemberName 140(s2) 0 "i"
MemberName 140(s2) 1 "f"
MemberName 140(s2) 2 "s1_1"
MemberName 140(s2) 3 "bleh"
Name 142 "foo2"
MemberDecorate 16(s3) 0 Flat
MemberDecorate 16(s3) 1 Flat
MemberDecorate 16(s3) 2 Flat
MemberDecorate 16(s3) 3 Flat
Decorate 93(condition) Flat
Decorate 131(samp2D) DescriptorSet 0
MemberDecorate 136(s1) 0 Flat
MemberDecorate 136(s1) 1 Flat
MemberDecorate 140(s2) 0 Flat
MemberDecorate 140(s2) 1 Flat
MemberDecorate 140(s2) 2 Flat
MemberDecorate 140(s2) 3 Flat
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
@ -86,171 +54,164 @@ Linked fragment stage:
9: TypeVector 7(float) 4 9: TypeVector 7(float) 4
10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4)
11: TypePointer Function 10(s2) 11: TypePointer Function 10(s2)
13(s1): TypeStruct 6(int) 7(float) 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1)
14(s2): TypeStruct 6(int) 7(float) 13(s1) 9(fvec4) 14: TypePointer Input 13(s3)
15(s1): TypeStruct 6(int) 7(float) 15(foo3): 14(ptr) Variable Input
16(s3): TypeStruct 14(s2) 6(int) 7(float) 15(s1) 16: 6(int) Constant 0
17: TypePointer Input 16(s3) 17: TypePointer Input 10(s2)
18(foo3): 17(ptr) Variable Input 20: TypePointer Input 6(int)
19: 6(int) Constant 0 23: TypeBool
20: TypePointer Input 14(s2) 27: 6(int) Constant 2
23: TypePointer Input 6(int) 28: 6(int) Constant 1
26: TypeBool 29: 7(float) Constant 1065353216
30: 6(int) Constant 2 30: TypePointer Function 7(float)
31: 6(int) Constant 1 32: TypeInt 32 0
32: 7(float) Constant 1065353216 33: 32(int) Constant 16
33: TypePointer Function 7(float) 34: TypeArray 7(float) 33
35: TypeInt 32 0 35: TypePointer Function 34
36: 35(int) Constant 16 37: 6(int) Constant 4
37: TypeArray 7(float) 36 38: TypeVector 7(float) 2
38: TypePointer Function 37 39: TypePointer Input 38(fvec2)
40: 6(int) Constant 4 40(coord): 39(ptr) Variable Input
41: TypeVector 7(float) 2 41: 32(int) Constant 0
42: TypePointer Input 41(fvec2) 42: TypePointer Input 7(float)
43(coord): 42(ptr) Variable Input 46: 32(int) Constant 8
44: 35(int) Constant 0 47: TypeArray 6(int) 46
45: TypePointer Input 7(float) 48: TypePointer Function 47
49: 35(int) Constant 8 52: TypePointer Function 6(int)
50: TypeArray 6(int) 49 69: 6(int) Constant 5
51: TypePointer Function 50 82: 6(int) Constant 16
55: TypePointer Function 6(int) 86: 7(float) Constant 0
72: 6(int) Constant 5 90(condition): 20(ptr) Variable Input
85: 6(int) Constant 16 96: 6(int) Constant 3
89: 7(float) Constant 0 97: TypePointer Input 9(fvec4)
93(condition): 23(ptr) Variable Input 98(color): 97(ptr) Variable Input
99: 6(int) Constant 3 100: TypePointer Function 9(fvec4)
100: TypePointer Input 9(fvec4) 102: 32(int) Constant 1
101(color): 100(ptr) Variable Input 105: 32(int) Constant 2
103: TypePointer Function 9(fvec4) 107: TypePointer Output 9(fvec4)
105: 35(int) Constant 1 108(gl_FragColor): 107(ptr) Variable Output
108: 35(int) Constant 2 125: TypeImage 7(float) 2D sampled format:Unknown
110: TypePointer Output 9(fvec4) 126: TypeSampledImage 125
111(gl_FragColor): 110(ptr) Variable Output 127: TypePointer UniformConstant 126
128: TypeImage 7(float) 2D sampled format:Unknown 128(samp2D): 127(ptr) Variable UniformConstant
129: TypeSampledImage 128 133: TypePointer Input 8(s1)
130: TypePointer UniformConstant 129 134(foo): 133(ptr) Variable Input
131(samp2D): 130(ptr) Variable UniformConstant 135(foo2): 17(ptr) Variable Input
136(s1): TypeStruct 6(int) 7(float)
137: TypePointer Input 136(s1)
138(foo): 137(ptr) Variable Input
139(s1): TypeStruct 6(int) 7(float)
140(s2): TypeStruct 6(int) 7(float) 139(s1) 9(fvec4)
141: TypePointer Input 140(s2)
142(foo2): 141(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
12(locals2): 11(ptr) Variable Function 12(locals2): 11(ptr) Variable Function
39(localFArray): 38(ptr) Variable Function 36(localFArray): 35(ptr) Variable Function
52(localIArray): 51(ptr) Variable Function 49(localIArray): 48(ptr) Variable Function
71(x): 55(ptr) Variable Function 68(x): 52(ptr) Variable Function
73(localArray): 38(ptr) Variable Function 70(localArray): 35(ptr) Variable Function
78(i): 55(ptr) Variable Function 75(i): 52(ptr) Variable Function
87(a): 38(ptr) Variable Function 84(a): 35(ptr) Variable Function
21: 20(ptr) AccessChain 18(foo3) 19 18: 17(ptr) AccessChain 15(foo3) 16
22: 14(s2) Load 21 19: 10(s2) Load 18
Store 12(locals2) 22 Store 12(locals2) 19
24: 23(ptr) AccessChain 18(foo3) 19 19 21: 20(ptr) AccessChain 15(foo3) 16 16
25: 6(int) Load 24 22: 6(int) Load 21
27: 26(bool) SGreaterThan 25 19 24: 23(bool) SGreaterThan 22 16
SelectionMerge 29 None SelectionMerge 26 None
BranchConditional 27 28 57 BranchConditional 24 25 54
28: Label 25: Label
34: 33(ptr) AccessChain 12(locals2) 30 31 31: 30(ptr) AccessChain 12(locals2) 27 28
Store 34 32 Store 31 29
46: 45(ptr) AccessChain 43(coord) 44 43: 42(ptr) AccessChain 40(coord) 41
47: 7(float) Load 46 44: 7(float) Load 43
48: 33(ptr) AccessChain 39(localFArray) 40 45: 30(ptr) AccessChain 36(localFArray) 37
Store 48 47 Store 45 44
53: 23(ptr) AccessChain 18(foo3) 19 19 50: 20(ptr) AccessChain 15(foo3) 16 16
54: 6(int) Load 53 51: 6(int) Load 50
56: 55(ptr) AccessChain 52(localIArray) 30 53: 52(ptr) AccessChain 49(localIArray) 27
Store 56 54 Store 53 51
Branch 29 Branch 26
57: Label 54: Label
58: 45(ptr) AccessChain 43(coord) 44 55: 42(ptr) AccessChain 40(coord) 41
59: 7(float) Load 58 56: 7(float) Load 55
60: 33(ptr) AccessChain 12(locals2) 30 31 57: 30(ptr) AccessChain 12(locals2) 27 28
Store 60 59 Store 57 56
61: 33(ptr) AccessChain 39(localFArray) 40 58: 30(ptr) AccessChain 36(localFArray) 37
Store 61 32 Store 58 29
62: 55(ptr) AccessChain 52(localIArray) 30 59: 52(ptr) AccessChain 49(localIArray) 27
Store 62 19 Store 59 16
Branch 29 Branch 26
29: Label 26: Label
63: 55(ptr) AccessChain 52(localIArray) 30 60: 52(ptr) AccessChain 49(localIArray) 27
64: 6(int) Load 63 61: 6(int) Load 60
65: 26(bool) IEqual 64 19 62: 23(bool) IEqual 61 16
SelectionMerge 67 None SelectionMerge 64 None
BranchConditional 65 66 67 BranchConditional 62 63 64
66: Label 63: Label
68: 33(ptr) AccessChain 39(localFArray) 40 65: 30(ptr) AccessChain 36(localFArray) 37
69: 7(float) Load 68 66: 7(float) Load 65
70: 7(float) FAdd 69 32 67: 7(float) FAdd 66 29
Store 68 70 Store 65 67
Branch 67 Branch 64
67: Label 64: Label
Store 71(x) 72 Store 68(x) 69
74: 6(int) Load 71(x) 71: 6(int) Load 68(x)
75: 45(ptr) AccessChain 43(coord) 44 72: 42(ptr) AccessChain 40(coord) 41
76: 7(float) Load 75 73: 7(float) Load 72
77: 33(ptr) AccessChain 73(localArray) 74 74: 30(ptr) AccessChain 70(localArray) 71
Store 77 76 Store 74 73
Store 78(i) 19 Store 75(i) 16
Branch 79 Branch 76
79: Label 76: Label
LoopMerge 81 82 None LoopMerge 78 79 None
Branch 83 Branch 80
83: Label 80: Label
84: 6(int) Load 78(i) 81: 6(int) Load 75(i)
86: 26(bool) SLessThan 84 85 83: 23(bool) SLessThan 81 82
BranchConditional 86 80 81 BranchConditional 83 77 78
80: Label 77: Label
88: 6(int) Load 78(i) 85: 6(int) Load 75(i)
90: 33(ptr) AccessChain 87(a) 88 87: 30(ptr) AccessChain 84(a) 85
Store 90 89 Store 87 86
Branch 82
82: Label
91: 6(int) Load 78(i)
92: 6(int) IAdd 91 31
Store 78(i) 92
Branch 79 Branch 79
81: Label 79: Label
94: 6(int) Load 93(condition) 88: 6(int) Load 75(i)
95: 26(bool) IEqual 94 31 89: 6(int) IAdd 88 28
SelectionMerge 97 None Store 75(i) 89
BranchConditional 95 96 97 Branch 76
96: Label 78: Label
98: 37 Load 73(localArray) 91: 6(int) Load 90(condition)
Store 87(a) 98 92: 23(bool) IEqual 91 28
Branch 97 SelectionMerge 94 None
97: Label BranchConditional 92 93 94
102: 9(fvec4) Load 101(color) 93: Label
104: 103(ptr) AccessChain 12(locals2) 99 95: 34 Load 70(localArray)
Store 104 102 Store 84(a) 95
106: 45(ptr) AccessChain 43(coord) 105 Branch 94
107: 7(float) Load 106 94: Label
109: 33(ptr) AccessChain 12(locals2) 99 108 99: 9(fvec4) Load 98(color)
Store 109 107 101: 100(ptr) AccessChain 12(locals2) 96
112: 103(ptr) AccessChain 12(locals2) 99 Store 101 99
113: 9(fvec4) Load 112 103: 42(ptr) AccessChain 40(coord) 102
114: 33(ptr) AccessChain 39(localFArray) 40 104: 7(float) Load 103
115: 7(float) Load 114 106: 30(ptr) AccessChain 12(locals2) 96 105
116: 33(ptr) AccessChain 12(locals2) 30 31 Store 106 104
117: 7(float) Load 116 109: 100(ptr) AccessChain 12(locals2) 96
118: 7(float) FAdd 115 117 110: 9(fvec4) Load 109
119: 6(int) Load 71(x) 111: 30(ptr) AccessChain 36(localFArray) 37
120: 33(ptr) AccessChain 73(localArray) 119 112: 7(float) Load 111
121: 7(float) Load 120 113: 30(ptr) AccessChain 12(locals2) 27 28
122: 7(float) FAdd 118 121 114: 7(float) Load 113
123: 6(int) Load 71(x) 115: 7(float) FAdd 112 114
124: 33(ptr) AccessChain 87(a) 123 116: 6(int) Load 68(x)
125: 7(float) Load 124 117: 30(ptr) AccessChain 70(localArray) 116
126: 7(float) FAdd 122 125 118: 7(float) Load 117
127: 9(fvec4) VectorTimesScalar 113 126 119: 7(float) FAdd 115 118
132: 129 Load 131(samp2D) 120: 6(int) Load 68(x)
133: 41(fvec2) Load 43(coord) 121: 30(ptr) AccessChain 84(a) 120
134: 9(fvec4) ImageSampleImplicitLod 132 133 122: 7(float) Load 121
135: 9(fvec4) FMul 127 134 123: 7(float) FAdd 119 122
Store 111(gl_FragColor) 135 124: 9(fvec4) VectorTimesScalar 110 123
129: 126 Load 128(samp2D)
130: 38(fvec2) Load 40(coord)
131: 9(fvec4) ImageSampleImplicitLod 129 130
132: 9(fvec4) FMul 124 131
Store 108(gl_FragColor) 132
Return Return
FunctionEnd FunctionEnd

View File

@ -7,12 +7,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 97 // Id's are bound by 93
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 10 21 37 40 58 67 EntryPoint Fragment 4 "main" 10 20 34 36 54 63
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source GLSL 400 Source GLSL 400
Name 4 "main" Name 4 "main"
@ -25,43 +25,21 @@ Linked fragment stage:
MemberName 14(lunarStruct2) 0 "i" MemberName 14(lunarStruct2) 0 "i"
MemberName 14(lunarStruct2) 1 "f" MemberName 14(lunarStruct2) 1 "f"
MemberName 14(lunarStruct2) 2 "s1_1" MemberName 14(lunarStruct2) 2 "s1_1"
Name 18 "lunarStruct1" Name 18 "lunarStruct3"
MemberName 18(lunarStruct1) 0 "i" MemberName 18(lunarStruct3) 0 "s2_1"
MemberName 18(lunarStruct1) 1 "f" MemberName 18(lunarStruct3) 1 "i"
Name 19 "lunarStruct3" MemberName 18(lunarStruct3) 2 "f"
MemberName 19(lunarStruct3) 0 "s2_1" MemberName 18(lunarStruct3) 3 "s1_1"
MemberName 19(lunarStruct3) 1 "i" Name 20 "foo3"
MemberName 19(lunarStruct3) 2 "f" Name 30 "scale"
MemberName 19(lunarStruct3) 3 "s1_1" Name 34 "foo2"
Name 21 "foo3" Name 36 "foo"
Name 31 "scale" Name 54 "gl_FragColor"
Name 32 "lunarStruct1" Name 59 "samp2D"
MemberName 32(lunarStruct1) 0 "i" Name 63 "coord"
MemberName 32(lunarStruct1) 1 "f" Name 69 "constructed"
Name 33 "lunarStruct2"
MemberName 33(lunarStruct2) 0 "i"
MemberName 33(lunarStruct2) 1 "f"
MemberName 33(lunarStruct2) 2 "s1_1"
Name 37 "foo2"
Name 38 "lunarStruct1"
MemberName 38(lunarStruct1) 0 "i"
MemberName 38(lunarStruct1) 1 "f"
Name 40 "foo"
Name 58 "gl_FragColor"
Name 63 "samp2D"
Name 67 "coord"
Name 73 "constructed"
Decorate 10(Count) Flat Decorate 10(Count) Flat
MemberDecorate 19(lunarStruct3) 0 Flat Decorate 59(samp2D) DescriptorSet 0
MemberDecorate 19(lunarStruct3) 1 Flat
MemberDecorate 19(lunarStruct3) 2 Flat
MemberDecorate 19(lunarStruct3) 3 Flat
MemberDecorate 33(lunarStruct2) 0 Flat
MemberDecorate 33(lunarStruct2) 1 Flat
MemberDecorate 33(lunarStruct2) 2 Flat
MemberDecorate 38(lunarStruct1) 0 Flat
MemberDecorate 38(lunarStruct1) 1 Flat
Decorate 63(samp2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
@ -74,99 +52,95 @@ Linked fragment stage:
15: TypeInt 32 0 15: TypeInt 32 0
16: 15(int) Constant 3 16: 15(int) Constant 3
17: TypeArray 14(lunarStruct2) 16 17: TypeArray 14(lunarStruct2) 16
18(lunarStruct1): TypeStruct 6(int) 12(float) 18(lunarStruct3): TypeStruct 17 6(int) 12(float) 13(lunarStruct1)
19(lunarStruct3): TypeStruct 17 6(int) 12(float) 18(lunarStruct1) 19: TypePointer Input 18(lunarStruct3)
20: TypePointer Input 19(lunarStruct3) 20(foo3): 19(ptr) Variable Input
21(foo3): 20(ptr) Variable Input 21: 6(int) Constant 0
22: 6(int) Constant 0 22: 6(int) Constant 1
23: 6(int) Constant 1 25: TypeBool
26: TypeBool 29: TypePointer Function 12(float)
30: TypePointer Function 12(float) 31: 15(int) Constant 5
32(lunarStruct1): TypeStruct 6(int) 12(float) 32: TypeArray 14(lunarStruct2) 31
33(lunarStruct2): TypeStruct 6(int) 12(float) 32(lunarStruct1) 33: TypePointer Input 32
34: 15(int) Constant 5 34(foo2): 33(ptr) Variable Input
35: TypeArray 33(lunarStruct2) 34 35: TypePointer Input 13(lunarStruct1)
36: TypePointer Input 35 36(foo): 35(ptr) Variable Input
37(foo2): 36(ptr) Variable Input 41: 6(int) Constant 2
38(lunarStruct1): TypeStruct 6(int) 12(float) 46: TypePointer Input 12(float)
39: TypePointer Input 38(lunarStruct1) 52: TypeVector 12(float) 4
40(foo): 39(ptr) Variable Input 53: TypePointer Output 52(fvec4)
45: 6(int) Constant 2 54(gl_FragColor): 53(ptr) Variable Output
50: TypePointer Input 12(float) 56: TypeImage 12(float) 2D sampled format:Unknown
56: TypeVector 12(float) 4 57: TypeSampledImage 56
57: TypePointer Output 56(fvec4) 58: TypePointer UniformConstant 57
58(gl_FragColor): 57(ptr) Variable Output 59(samp2D): 58(ptr) Variable UniformConstant
60: TypeImage 12(float) 2D sampled format:Unknown 61: TypeVector 12(float) 2
61: TypeSampledImage 60 62: TypePointer Input 61(fvec2)
62: TypePointer UniformConstant 61 63(coord): 62(ptr) Variable Input
63(samp2D): 62(ptr) Variable UniformConstant 67: TypeArray 61(fvec2) 16
65: TypeVector 12(float) 2 68: TypePointer Function 67
66: TypePointer Input 65(fvec2) 73: 12(float) Constant 1065353216
67(coord): 66(ptr) Variable Input 74: 12(float) Constant 1073741824
71: TypeArray 65(fvec2) 16 75: 61(fvec2) ConstantComposite 73 74
72: TypePointer Function 71 79: TypePointer Function 61(fvec2)
77: 12(float) Constant 1065353216
78: 12(float) Constant 1073741824
79: 65(fvec2) ConstantComposite 77 78
83: TypePointer Function 65(fvec2)
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(iLocal): 7(ptr) Variable Function 8(iLocal): 7(ptr) Variable Function
31(scale): 30(ptr) Variable Function 30(scale): 29(ptr) Variable Function
73(constructed): 72(ptr) Variable Function 69(constructed): 68(ptr) Variable Function
11: 6(int) Load 10(Count) 11: 6(int) Load 10(Count)
Store 8(iLocal) 11 Store 8(iLocal) 11
24: 9(ptr) AccessChain 21(foo3) 22 23 22 23: 9(ptr) AccessChain 20(foo3) 21 22 21
25: 6(int) Load 24 24: 6(int) Load 23
27: 26(bool) SGreaterThan 25 22 26: 25(bool) SGreaterThan 24 21
SelectionMerge 29 None SelectionMerge 28 None
BranchConditional 27 28 53 BranchConditional 26 27 49
28: Label 27: Label
41: 9(ptr) AccessChain 40(foo) 22 37: 9(ptr) AccessChain 36(foo) 21
42: 6(int) Load 41 38: 6(int) Load 37
43: 9(ptr) AccessChain 21(foo3) 22 42 22 39: 9(ptr) AccessChain 20(foo3) 21 38 21
44: 6(int) Load 43 40: 6(int) Load 39
46: 6(int) IAdd 44 45 42: 6(int) IAdd 40 41
47: 6(int) Load 8(iLocal) 43: 6(int) Load 8(iLocal)
48: 6(int) IAdd 47 23 44: 6(int) IAdd 43 22
Store 8(iLocal) 48 Store 8(iLocal) 44
49: 6(int) IAdd 46 48 45: 6(int) IAdd 42 44
51: 50(ptr) AccessChain 37(foo2) 49 45 23 47: 46(ptr) AccessChain 34(foo2) 45 41 22
52: 12(float) Load 51 48: 12(float) Load 47
Store 31(scale) 52 Store 30(scale) 48
Branch 29 Branch 28
53: Label 49: Label
54: 50(ptr) AccessChain 21(foo3) 22 22 45 23 50: 46(ptr) AccessChain 20(foo3) 21 21 41 22
55: 12(float) Load 54 51: 12(float) Load 50
Store 31(scale) 55 Store 30(scale) 51
Branch 29 Branch 28
29: Label 28: Label
59: 12(float) Load 31(scale) 55: 12(float) Load 30(scale)
64: 61 Load 63(samp2D) 60: 57 Load 59(samp2D)
68: 65(fvec2) Load 67(coord) 64: 61(fvec2) Load 63(coord)
69: 56(fvec4) ImageSampleImplicitLod 64 68 65: 52(fvec4) ImageSampleImplicitLod 60 64
70: 56(fvec4) VectorTimesScalar 69 59 66: 52(fvec4) VectorTimesScalar 65 55
Store 58(gl_FragColor) 70 Store 54(gl_FragColor) 66
74: 65(fvec2) Load 67(coord) 70: 61(fvec2) Load 63(coord)
75: 12(float) Load 31(scale) 71: 12(float) Load 30(scale)
76: 65(fvec2) CompositeConstruct 75 75 72: 61(fvec2) CompositeConstruct 71 71
80: 71 CompositeConstruct 74 76 79 76: 67 CompositeConstruct 70 72 75
Store 73(constructed) 80 Store 69(constructed) 76
81: 9(ptr) AccessChain 40(foo) 22 77: 9(ptr) AccessChain 36(foo) 21
82: 6(int) Load 81 78: 6(int) Load 77
84: 83(ptr) AccessChain 73(constructed) 82 80: 79(ptr) AccessChain 69(constructed) 78
85: 65(fvec2) Load 84 81: 61(fvec2) Load 80
86: 9(ptr) AccessChain 40(foo) 22 82: 9(ptr) AccessChain 36(foo) 21
87: 6(int) Load 86 83: 6(int) Load 82
88: 83(ptr) AccessChain 73(constructed) 87 84: 79(ptr) AccessChain 69(constructed) 83
89: 65(fvec2) Load 88 85: 61(fvec2) Load 84
90: 12(float) CompositeExtract 85 0 86: 12(float) CompositeExtract 81 0
91: 12(float) CompositeExtract 85 1 87: 12(float) CompositeExtract 81 1
92: 12(float) CompositeExtract 89 0 88: 12(float) CompositeExtract 85 0
93: 12(float) CompositeExtract 89 1 89: 12(float) CompositeExtract 85 1
94: 56(fvec4) CompositeConstruct 90 91 92 93 90: 52(fvec4) CompositeConstruct 86 87 88 89
95: 56(fvec4) Load 58(gl_FragColor) 91: 52(fvec4) Load 54(gl_FragColor)
96: 56(fvec4) FAdd 95 94 92: 52(fvec4) FAdd 91 90
Store 58(gl_FragColor) 96 Store 54(gl_FragColor) 92
Return Return
FunctionEnd FunctionEnd