Fix #373: Implicitly make gl_FragColor a location=0 output.

This commit is contained in:
John Kessenich 2017-05-20 13:23:25 -06:00
parent 1d585ac8bd
commit 2c6f48b1f6
36 changed files with 44 additions and 1 deletions

View File

@ -8,6 +8,7 @@ remap.uniformarray.everything.frag
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 5663 "main" 3608 4957 4339 5139 EntryPoint Fragment 5663 "main" 3608 4957 4339 5139
ExecutionMode 5663 OriginUpperLeft ExecutionMode 5663 OriginUpperLeft
Decorate 5139 Location 0
8: TypeVoid 8: TypeVoid
1282: TypeFunction 8 1282: TypeFunction 8
13: TypeFloat 32 13: TypeFloat 32

View File

@ -16,6 +16,7 @@ remap.uniformarray.none.frag
Name 35 "alpha" Name 35 "alpha"
Name 47 "gl_FragColor" Name 47 "gl_FragColor"
Name 52 "texSampler2D" Name 52 "texSampler2D"
Decorate 47(gl_FragColor) Location 0
Decorate 52(texSampler2D) DescriptorSet 0 Decorate 52(texSampler2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -18,6 +18,7 @@ spv.always-discard.frag
Name 30 "y" Name 30 "y"
Name 36 "radius" Name 36 "radius"
Name 59 "gl_FragColor" Name 59 "gl_FragColor"
Decorate 59(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -17,6 +17,7 @@ spv.always-discard2.frag
Name 21 "tex_coord" Name 21 "tex_coord"
Name 30 "y" Name 30 "y"
Name 38 "gl_FragColor" Name 38 "gl_FragColor"
Decorate 38(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -17,6 +17,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Name 17 "coord" Name 17 "coord"
Name 34 "gl_FragColor" Name 34 "gl_FragColor"
Decorate 13(tex) DescriptorSet 0 Decorate 13(tex) DescriptorSet 0
Decorate 34(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -51,6 +51,7 @@ spv.conversion.frag
Name 454 "i_f4" Name 454 "i_f4"
Decorate 39(i_i) Flat Decorate 39(i_i) Flat
Decorate 157(i_i4) Flat Decorate 157(i_i4) Flat
Decorate 322(gl_FragColor) Location 0
Decorate 446(i_i2) Flat Decorate 446(i_i2) Flat
Decorate 448(i_i3) Flat Decorate 448(i_i3) Flat
2: TypeVoid 2: TypeVoid

View File

@ -28,6 +28,7 @@ spv.deepRvalue.frag
Name 133 "t" Name 133 "t"
Name 146 "gl_FragColor" Name 146 "gl_FragColor"
Decorate 111(samp2D) DescriptorSet 0 Decorate 111(samp2D) DescriptorSet 0
Decorate 146(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -18,6 +18,7 @@ spv.discard-dce.frag
Name 30 "y" Name 30 "y"
Name 36 "radius" Name 36 "radius"
Name 59 "gl_FragColor" Name 59 "gl_FragColor"
Decorate 59(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -15,6 +15,7 @@ spv.doWhileLoop.frag
Name 17 "bigColor" Name 17 "bigColor"
Name 27 "d" Name 27 "d"
Name 32 "gl_FragColor" Name 32 "gl_FragColor"
Decorate 32(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -24,6 +24,7 @@ spv.earlyReturnDiscard.frag
Name 77 "b" Name 77 "b"
Name 105 "gl_FragColor" Name 105 "gl_FragColor"
Name 109 "threshhold3" Name 109 "threshhold3"
Decorate 105(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -19,6 +19,7 @@ spv.flowControl.frag
Name 25 "bigColor" Name 25 "bigColor"
Name 30 "smallColor" Name 30 "smallColor"
Name 35 "gl_FragColor" Name 35 "gl_FragColor"
Decorate 35(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -26,6 +26,7 @@ spv.forLoop.frag
Name 104 "f" Name 104 "f"
Name 117 "i" Name 117 "i"
Decorate 24(Count) Flat Decorate 24(Count) Flat
Decorate 36(gl_FragColor) Location 0
Decorate 53(v4) Flat Decorate 53(v4) Flat
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -32,6 +32,7 @@ spv.forwardFun.frag
Decorate 27(f) RelaxedPrecision Decorate 27(f) RelaxedPrecision
Decorate 28 RelaxedPrecision Decorate 28 RelaxedPrecision
Decorate 30(gl_FragColor) RelaxedPrecision Decorate 30(gl_FragColor) RelaxedPrecision
Decorate 30(gl_FragColor) Location 0
Decorate 31 RelaxedPrecision Decorate 31 RelaxedPrecision
Decorate 32 RelaxedPrecision Decorate 32 RelaxedPrecision
Decorate 33 RelaxedPrecision Decorate 33 RelaxedPrecision

View File

@ -28,6 +28,7 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas
Name 66 "g" Name 66 "g"
Name 69 "gl_FragColor" Name 69 "gl_FragColor"
Name 75 "bigColor" Name 75 "bigColor"
Decorate 69(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -44,6 +44,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Name 133 "param" Name 133 "param"
Name 136 "arg" Name 136 "arg"
Name 152 "gl_FragColor" Name 152 "gl_FragColor"
Decorate 152(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1

View File

@ -11,6 +11,7 @@ spv.glFragColor.frag
Source GLSL 330 Source GLSL 330
Name 4 "main" Name 4 "main"
Name 9 "gl_FragColor" Name 9 "gl_FragColor"
Decorate 9(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -14,6 +14,7 @@ spv.length.frag
Name 14 "v" Name 14 "v"
Name 26 "gl_FragColor" Name 26 "gl_FragColor"
Name 32 "u" Name 32 "u"
Decorate 26(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -42,6 +42,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Name 135 "foo2" Name 135 "foo2"
Decorate 15(foo3) Flat Decorate 15(foo3) Flat
Decorate 90(condition) Flat Decorate 90(condition) Flat
Decorate 108(gl_FragColor) Location 0
Decorate 128(samp2D) DescriptorSet 0 Decorate 128(samp2D) DescriptorSet 0
Decorate 134(foo) Flat Decorate 134(foo) Flat
Decorate 135(foo2) Flat Decorate 135(foo2) Flat

View File

@ -49,6 +49,7 @@ spv.loops.frag
Name 687 "d18" Name 687 "d18"
Name 698 "d17" Name 698 "d17"
Decorate 157(Count) Flat Decorate 157(Count) Flat
Decorate 615(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -30,6 +30,7 @@ spv.loopsArtificial.frag
Name 153 "d2" Name 153 "d2"
Name 154 "d3" Name 154 "d3"
Name 157 "Count" Name 157 "Count"
Decorate 140(gl_FragColor) Location 0
Decorate 157(Count) Flat Decorate 157(Count) Flat
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -20,6 +20,7 @@ spv.prepost.frag
Name 66 "z" Name 66 "z"
Name 73 "v" Name 73 "v"
Name 90 "gl_FragColor" Name 90 "gl_FragColor"
Decorate 90(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1

View File

@ -13,6 +13,7 @@ spv.simpleFunctionCall.frag
Name 9 "foo(" Name 9 "foo("
Name 12 "BaseColor" Name 12 "BaseColor"
Name 17 "gl_FragColor" Name 17 "gl_FragColor"
Decorate 17(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -36,6 +36,7 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to
MemberDecorate 9(lunarStruct2) 0 RelaxedPrecision MemberDecorate 9(lunarStruct2) 0 RelaxedPrecision
MemberDecorate 10(lunarStruct3) 1 RelaxedPrecision MemberDecorate 10(lunarStruct3) 1 RelaxedPrecision
Decorate 16 RelaxedPrecision Decorate 16 RelaxedPrecision
Decorate 31(gl_FragColor) Location 0
Decorate 40(samp2D) DescriptorSet 0 Decorate 40(samp2D) DescriptorSet 0
Decorate 44(coord) RelaxedPrecision Decorate 44(coord) RelaxedPrecision
Decorate 45 RelaxedPrecision Decorate 45 RelaxedPrecision

View File

@ -40,6 +40,7 @@ spv.structDeref.frag
Name 99 "gl_FragColor" Name 99 "gl_FragColor"
Name 116 "samp2D" Name 116 "samp2D"
Name 122 "foo2" Name 122 "foo2"
Decorate 99(gl_FragColor) Location 0
Decorate 116(samp2D) DescriptorSet 0 Decorate 116(samp2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -24,6 +24,7 @@ spv.structure.frag
Name 50 "samp2D" Name 50 "samp2D"
Name 54 "coord" Name 54 "coord"
Name 59 "foo" Name 59 "foo"
Decorate 45(gl_FragColor) Location 0
Decorate 50(samp2D) DescriptorSet 0 Decorate 50(samp2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -24,6 +24,7 @@ spv.swizzle.frag
Name 81 "c" Name 81 "c"
Name 83 "rep" Name 83 "rep"
Name 107 "blend" Name 107 "blend"
Decorate 69(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -25,6 +25,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Name 49 "blend" Name 49 "blend"
Decorate 16(texSampler2D) DescriptorSet 0 Decorate 16(texSampler2D) DescriptorSet 0
Decorate 33(texSampler3D) DescriptorSet 0 Decorate 33(texSampler3D) DescriptorSet 0
Decorate 43(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -45,6 +45,7 @@ WARNING: 0:12: varying deprecated in version 130; may be removed in future relea
Decorate 130(texSamplerCube) DescriptorSet 0 Decorate 130(texSamplerCube) DescriptorSet 0
Decorate 145(shadowSampler1D) DescriptorSet 0 Decorate 145(shadowSampler1D) DescriptorSet 0
Decorate 164(shadowSampler2D) DescriptorSet 0 Decorate 164(shadowSampler2D) DescriptorSet 0
Decorate 291(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -55,6 +55,7 @@ spv.types.frag
Decorate 111(i_i3) Flat Decorate 111(i_i3) Flat
Decorate 118(u_i4) Flat Decorate 118(u_i4) Flat
Decorate 120(i_i4) Flat Decorate 120(i_i4) Flat
Decorate 160(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeBool 6: TypeBool

View File

@ -16,6 +16,7 @@ spv.uniformArray.frag
Name 35 "alpha" Name 35 "alpha"
Name 47 "gl_FragColor" Name 47 "gl_FragColor"
Name 52 "texSampler2D" Name 52 "texSampler2D"
Decorate 47(gl_FragColor) Location 0
Decorate 52(texSampler2D) DescriptorSet 0 Decorate 52(texSampler2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -38,6 +38,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Decorate 20(foo3) Flat Decorate 20(foo3) Flat
Decorate 34(foo2) Flat Decorate 34(foo2) Flat
Decorate 36(foo) Flat Decorate 36(foo) Flat
Decorate 54(gl_FragColor) Location 0
Decorate 59(samp2D) DescriptorSet 0 Decorate 59(samp2D) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -18,6 +18,7 @@ spv.varyingArray.frag
Name 45 "gl_FragColor" Name 45 "gl_FragColor"
Name 48 "foo" Name 48 "foo"
Decorate 13(texSampler2D) DescriptorSet 0 Decorate 13(texSampler2D) DescriptorSet 0
Decorate 45(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -22,6 +22,7 @@ spv.varyingArrayIndirect.frag
Decorate 13(texSampler2D) DescriptorSet 0 Decorate 13(texSampler2D) DescriptorSet 0
Decorate 22(b) Flat Decorate 22(b) Flat
Decorate 31(a) Flat Decorate 31(a) Flat
Decorate 56(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -20,6 +20,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Name 37 "gl_FragColor" Name 37 "gl_FragColor"
Name 40 "BaseColor" Name 40 "BaseColor"
Name 42 "d" Name 42 "d"
Decorate 37(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
10: TypeFloat 32 10: TypeFloat 32

View File

@ -15,6 +15,7 @@ spv.whileLoop.frag
Name 24 "d" Name 24 "d"
Name 28 "bigColor" Name 28 "bigColor"
Name 33 "gl_FragColor" Name 33 "gl_FragColor"
Decorate 33(gl_FragColor) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32

View File

@ -5187,7 +5187,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
SpecialQualifier("gl_FrontFacing", EvqFace, EbvFace, symbolTable); SpecialQualifier("gl_FrontFacing", EvqFace, EbvFace, symbolTable);
SpecialQualifier("gl_FragCoord", EvqFragCoord, EbvFragCoord, symbolTable); SpecialQualifier("gl_FragCoord", EvqFragCoord, EbvFragCoord, symbolTable);
SpecialQualifier("gl_PointCoord", EvqPointCoord, EbvPointCoord, symbolTable); SpecialQualifier("gl_PointCoord", EvqPointCoord, EbvPointCoord, symbolTable);
if (spvVersion.spv == 0)
SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable); SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable);
else {
TSymbol* symbol = symbolTable.find("gl_FragColor");
if (symbol) {
symbol->getWritableType().getQualifier().storage = EvqVaryingOut;
symbol->getWritableType().getQualifier().layoutLocation = 0;
}
}
SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable); SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable);
SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable); SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable);
SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable); SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable);