glslang -> SPV: Use the new TBuiltInVariable instead of string compares to get the type of SPV built in. Also fixed gl_FragData and gl_PrimitiveIDIn.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31226 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-05-18 23:25:32 +00:00
parent dff18a2be0
commit 40e391184c
10 changed files with 81 additions and 105 deletions

View File

@ -290,64 +290,40 @@ spv::Decoration TranslateInvariantDecoration(const glslang::TType& type)
// Translate glslang built-in variable to SPIR-V built in decoration. // Translate glslang built-in variable to SPIR-V built in decoration.
spv::BuiltIn TranslateBuiltInDecoration(const glslang::TIntermSymbol& node) spv::BuiltIn TranslateBuiltInDecoration(const glslang::TIntermSymbol& node)
{ {
const glslang::TString& name = node.getName(); switch (node.getQualifier().builtIn) {
if (name.compare(0, 3, "gl_") != 0) case glslang::EbvPosition: return spv::BuiltInPosition;
return (spv::BuiltIn)spv::BadValue; case glslang::EbvPointSize: return spv::BuiltInPointSize;
case glslang::EbvClipVertex: return spv::BuiltInClipVertex;
switch (node.getQualifier().storage) { case glslang::EbvClipDistance: return spv::BuiltInClipDistance;
case glslang::EvqPosition: return spv::BuiltInPosition; case glslang::EbvCullDistance: return spv::BuiltInCullDistance;
case glslang::EvqPointSize: return spv::BuiltInPointSize; case glslang::EbvVertexId: return spv::BuiltInVertexId;
case glslang::EvqClipVertex: return spv::BuiltInClipVertex; case glslang::EbvInstanceId: return spv::BuiltInInstanceId;
case glslang::EvqVertexId: return spv::BuiltInVertexId; case glslang::EbvPrimitiveId: return spv::BuiltInPrimitiveId;
case glslang::EvqInstanceId: return spv::BuiltInInstanceId; case glslang::EbvInvocationId: return spv::BuiltInInvocationId;
case glslang::EvqFragCoord: return spv::BuiltInFragCoord; case glslang::EbvLayer: return spv::BuiltInLayer;
case glslang::EvqPointCoord: return spv::BuiltInPointCoord; case glslang::EbvViewportIndex: return spv::BuiltInViewportIndex;
case glslang::EvqFace: return spv::BuiltInFrontFacing; case glslang::EbvTessLevelInner: return spv::BuiltInTessLevelInner;
case glslang::EvqFragColor: return spv::BuiltInFragColor; case glslang::EbvTessLevelOuter: return spv::BuiltInTessLevelOuter;
case glslang::EvqFragDepth: return spv::BuiltInFragDepth; case glslang::EbvTessCoord: return spv::BuiltInTessCoord;
default: case glslang::EbvPatchVertices: return spv::BuiltInPatchVertices;
if (name == "gl_ClipDistance") case glslang::EbvFragCoord: return spv::BuiltInFragCoord;
return spv::BuiltInClipDistance; case glslang::EbvPointCoord: return spv::BuiltInPointCoord;
else if (name == "gl_PrimitiveID" || name == "gl_PrimitiveIDIn") case glslang::EbvFace: return spv::BuiltInFrontFacing;
return spv::BuiltInPrimitiveId; case glslang::EbvSampleId: return spv::BuiltInSampleId;
else if (name == "gl_InvocationID") case glslang::EbvSamplePosition: return spv::BuiltInSamplePosition;
return spv::BuiltInInvocationId; case glslang::EbvSampleMask: return spv::BuiltInSampleMask;
else if (name == "gl_Layer") case glslang::EbvFragColor: return spv::BuiltInFragColor;
return spv::BuiltInLayer; case glslang::EbvFragData: return spv::BuiltInFragColor;
else if (name == "gl_ViewportIndex") case glslang::EbvFragDepth: return spv::BuiltInFragDepth;
return spv::BuiltInViewportIndex; case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation;
else if (name == "gl_TessLevelOuter") case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
return spv::BuiltInTessLevelOuter; case glslang::EbvWorkGroupSize: return spv::BuiltInWorkgroupSize;
else if (name == "gl_TessLevelInner") case glslang::EbvWorkGroupId: return spv::BuiltInWorkgroupId;
return spv::BuiltInTessLevelInner; case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId;
else if (name == "gl_TessCoord") case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
return spv::BuiltInTessCoord; case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId;
else if (name == "gl_PatchVerticesIn") default: return (spv::BuiltIn)spv::BadValue;
return spv::BuiltInPatchVertices;
else if (name == "gl_SampleID")
return spv::BuiltInSampleId;
else if (name == "gl_SamplePosition")
return spv::BuiltInSamplePosition;
else if (name == "gl_SampleMask" || name == "gl_SampleMaskIn")
return spv::BuiltInSampleMask;
// Compute shader:
else if (name == "gl_NumWorkGroups")
return spv::BuiltInNumWorkgroups;
else if (name == "gl_WorkGroupSize")
return spv::BuiltInWorkgroupSize;
else if (name == "gl_WorkGroupID")
return spv::BuiltInWorkgroupId;
else if (name == "gl_LocalInvocationID")
return spv::BuiltInLocalInvocationId;
else if (name == "gl_GlobalInvocationID")
return spv::BuiltInGlobalInvocationId;
else if (name == "gl_LocalInvocationIndexID")
return spv::BuiltInLocalInvocationIndex;
break;
} }
return (spv::BuiltIn)spv::BadValue;
} }
// //
@ -2193,7 +2169,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
case glslang::EOpConvUintToDouble: case glslang::EOpConvUintToDouble:
convOp = spv::OpConvertUToF; convOp = spv::OpConvertUToF;
break; break;
case glslang::EOpConvDoubleToFloat: case glslang::EOpConvDoubleToFloat:
case glslang::EOpConvFloatToDouble: case glslang::EOpConvFloatToDouble:
convOp = spv::OpFConvert; convOp = spv::OpFConvert;
@ -2224,7 +2200,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
if (convOp == spv::OpSelect) { if (convOp == spv::OpSelect) {
zero = makeSmearedConstant(zero, vectorSize); zero = makeSmearedConstant(zero, vectorSize);
one = makeSmearedConstant(one, vectorSize); one = makeSmearedConstant(one, vectorSize);
result = builder.createTriOp(convOp, destType, operand, one, zero); result = builder.createTriOp(convOp, destType, operand, one, zero);
} else } else
result = builder.createUnaryOp(convOp, destType, operand); result = builder.createUnaryOp(convOp, destType, operand);

View File

@ -109,7 +109,7 @@ ERROR: node is still EOpNull!
0:35 1 (const int) 0:35 1 (const int)
0:36 move second child to first child (temp int) 0:36 move second child to first child (temp int)
0:36 'gl_PrimitiveID' (layout(stream=0 ) out int PrimitiveID) 0:36 'gl_PrimitiveID' (layout(stream=0 ) out int PrimitiveID)
0:36 'gl_PrimitiveIDIn' (in int) 0:36 'gl_PrimitiveIDIn' (in int PrimitiveID)
0:37 move second child to first child (temp int) 0:37 move second child to first child (temp int)
0:37 'gl_Layer' (layout(stream=0 ) out int Layer) 0:37 'gl_Layer' (layout(stream=0 ) out int Layer)
0:37 Constant: 0:37 Constant:
@ -250,7 +250,7 @@ ERROR: node is still EOpNull!
0:35 1 (const int) 0:35 1 (const int)
0:36 move second child to first child (temp int) 0:36 move second child to first child (temp int)
0:36 'gl_PrimitiveID' (layout(stream=0 ) out int PrimitiveID) 0:36 'gl_PrimitiveID' (layout(stream=0 ) out int PrimitiveID)
0:36 'gl_PrimitiveIDIn' (in int) 0:36 'gl_PrimitiveIDIn' (in int PrimitiveID)
0:37 move second child to first child (temp int) 0:37 move second child to first child (temp int)
0:37 'gl_Layer' (layout(stream=0 ) out int Layer) 0:37 'gl_Layer' (layout(stream=0 ) out int Layer)
0:37 Constant: 0:37 Constant:

View File

@ -47,8 +47,8 @@ ERROR: node is still EOpNull!
0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor) 0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor)
0:10 'varyingVar' (smooth in 4-component vector of float) 0:10 'varyingVar' (smooth in 4-component vector of float)
0:11 move second child to first child (temp 4-component vector of float) 0:11 move second child to first child (temp 4-component vector of float)
0:11 direct index (temp 4-component vector of float) 0:11 direct index (temp 4-component vector of float FragData)
0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:11 Constant: 0:11 Constant:
0:11 1 (const int) 0:11 1 (const int)
0:11 'inVar' (smooth in 4-component vector of float) 0:11 'inVar' (smooth in 4-component vector of float)
@ -120,8 +120,8 @@ ERROR: node is still EOpNull!
0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor) 0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor)
0:10 'varyingVar' (smooth in 4-component vector of float) 0:10 'varyingVar' (smooth in 4-component vector of float)
0:11 move second child to first child (temp 4-component vector of float) 0:11 move second child to first child (temp 4-component vector of float)
0:11 direct index (temp 4-component vector of float) 0:11 direct index (temp 4-component vector of float FragData)
0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:11 Constant: 0:11 Constant:
0:11 1 (const int) 0:11 1 (const int)
0:11 'inVar' (smooth in 4-component vector of float) 0:11 'inVar' (smooth in 4-component vector of float)

View File

@ -9,8 +9,8 @@ Shader version: 330
0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor) 0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor)
0:10 'varyingVar' (smooth in 4-component vector of float) 0:10 'varyingVar' (smooth in 4-component vector of float)
0:11 move second child to first child (temp 4-component vector of float) 0:11 move second child to first child (temp 4-component vector of float)
0:11 direct index (temp 4-component vector of float) 0:11 direct index (temp 4-component vector of float FragData)
0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:11 Constant: 0:11 Constant:
0:11 1 (const int) 0:11 1 (const int)
0:11 vector-times-matrix (temp 4-component vector of float) 0:11 vector-times-matrix (temp 4-component vector of float)
@ -35,8 +35,8 @@ Shader version: 330
0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor) 0:10 'gl_FragColor' (fragColor 4-component vector of float FragColor)
0:10 'varyingVar' (smooth in 4-component vector of float) 0:10 'varyingVar' (smooth in 4-component vector of float)
0:11 move second child to first child (temp 4-component vector of float) 0:11 move second child to first child (temp 4-component vector of float)
0:11 direct index (temp 4-component vector of float) 0:11 direct index (temp 4-component vector of float FragData)
0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:11 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:11 Constant: 0:11 Constant:
0:11 1 (const int) 0:11 1 (const int)
0:11 vector-times-matrix (temp 4-component vector of float) 0:11 vector-times-matrix (temp 4-component vector of float)

View File

@ -127,8 +127,8 @@ ERROR: node is still EOpNull!
0:43 Function Call: foo(f1[5]; (global 4-element array of float) 0:43 Function Call: foo(f1[5]; (global 4-element array of float)
0:43 'u' (temp 5-element array of float) 0:43 'u' (temp 5-element array of float)
0:45 move second child to first child (temp 4-component vector of float) 0:45 move second child to first child (temp 4-component vector of float)
0:45 direct index (temp 4-component vector of float) 0:45 direct index (temp 4-component vector of float FragData)
0:45 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:45 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:45 Constant: 0:45 Constant:
0:45 1000 (const int) 0:45 1000 (const int)
0:45 Constant: 0:45 Constant:
@ -137,8 +137,8 @@ ERROR: node is still EOpNull!
0:45 1.000000 0:45 1.000000
0:45 1.000000 0:45 1.000000
0:46 move second child to first child (temp 4-component vector of float) 0:46 move second child to first child (temp 4-component vector of float)
0:46 direct index (temp 4-component vector of float) 0:46 direct index (temp 4-component vector of float FragData)
0:46 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:46 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:46 Constant: 0:46 Constant:
0:46 -1 (const int) 0:46 -1 (const int)
0:46 Constant: 0:46 Constant:
@ -147,8 +147,8 @@ ERROR: node is still EOpNull!
0:46 1.000000 0:46 1.000000
0:46 1.000000 0:46 1.000000
0:47 move second child to first child (temp 4-component vector of float) 0:47 move second child to first child (temp 4-component vector of float)
0:47 direct index (temp 4-component vector of float) 0:47 direct index (temp 4-component vector of float FragData)
0:47 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:47 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:47 Constant: 0:47 Constant:
0:47 3 (const int) 0:47 3 (const int)
0:47 Constant: 0:47 Constant:
@ -371,8 +371,8 @@ ERROR: node is still EOpNull!
0:43 Function Call: foo(f1[5]; (global 4-element array of float) 0:43 Function Call: foo(f1[5]; (global 4-element array of float)
0:43 'u' (temp 5-element array of float) 0:43 'u' (temp 5-element array of float)
0:45 move second child to first child (temp 4-component vector of float) 0:45 move second child to first child (temp 4-component vector of float)
0:45 direct index (temp 4-component vector of float) 0:45 direct index (temp 4-component vector of float FragData)
0:45 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:45 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:45 Constant: 0:45 Constant:
0:45 1000 (const int) 0:45 1000 (const int)
0:45 Constant: 0:45 Constant:
@ -381,8 +381,8 @@ ERROR: node is still EOpNull!
0:45 1.000000 0:45 1.000000
0:45 1.000000 0:45 1.000000
0:46 move second child to first child (temp 4-component vector of float) 0:46 move second child to first child (temp 4-component vector of float)
0:46 direct index (temp 4-component vector of float) 0:46 direct index (temp 4-component vector of float FragData)
0:46 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:46 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:46 Constant: 0:46 Constant:
0:46 -1 (const int) 0:46 -1 (const int)
0:46 Constant: 0:46 Constant:
@ -391,8 +391,8 @@ ERROR: node is still EOpNull!
0:46 1.000000 0:46 1.000000
0:46 1.000000 0:46 1.000000
0:47 move second child to first child (temp 4-component vector of float) 0:47 move second child to first child (temp 4-component vector of float)
0:47 direct index (temp 4-component vector of float) 0:47 direct index (temp 4-component vector of float FragData)
0:47 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:47 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:47 Constant: 0:47 Constant:
0:47 3 (const int) 0:47 3 (const int)
0:47 Constant: 0:47 Constant:

View File

@ -99,8 +99,8 @@ ERROR: node is still EOpNull!
0:36 Function Call: foo(f1[5]; (global 4-element array of mediump float) 0:36 Function Call: foo(f1[5]; (global 4-element array of mediump float)
0:36 'u' (temp 5-element array of mediump float) 0:36 'u' (temp 5-element array of mediump float)
0:38 move second child to first child (temp mediump 4-component vector of float) 0:38 move second child to first child (temp mediump 4-component vector of float)
0:38 direct index (temp mediump 4-component vector of float) 0:38 direct index (temp mediump 4-component vector of float FragData)
0:38 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:38 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:38 Constant: 0:38 Constant:
0:38 1000 (const int) 0:38 1000 (const int)
0:38 Constant: 0:38 Constant:
@ -109,8 +109,8 @@ ERROR: node is still EOpNull!
0:38 1.000000 0:38 1.000000
0:38 1.000000 0:38 1.000000
0:39 move second child to first child (temp mediump 4-component vector of float) 0:39 move second child to first child (temp mediump 4-component vector of float)
0:39 direct index (temp mediump 4-component vector of float) 0:39 direct index (temp mediump 4-component vector of float FragData)
0:39 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:39 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:39 Constant: 0:39 Constant:
0:39 -1 (const int) 0:39 -1 (const int)
0:39 Constant: 0:39 Constant:
@ -119,8 +119,8 @@ ERROR: node is still EOpNull!
0:39 1.000000 0:39 1.000000
0:39 1.000000 0:39 1.000000
0:40 move second child to first child (temp mediump 4-component vector of float) 0:40 move second child to first child (temp mediump 4-component vector of float)
0:40 direct index (temp mediump 4-component vector of float) 0:40 direct index (temp mediump 4-component vector of float FragData)
0:40 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:40 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:40 Constant: 0:40 Constant:
0:40 3 (const int) 0:40 3 (const int)
0:40 Constant: 0:40 Constant:
@ -236,8 +236,8 @@ ERROR: node is still EOpNull!
0:36 Function Call: foo(f1[5]; (global 4-element array of mediump float) 0:36 Function Call: foo(f1[5]; (global 4-element array of mediump float)
0:36 'u' (temp 5-element array of mediump float) 0:36 'u' (temp 5-element array of mediump float)
0:38 move second child to first child (temp mediump 4-component vector of float) 0:38 move second child to first child (temp mediump 4-component vector of float)
0:38 direct index (temp mediump 4-component vector of float) 0:38 direct index (temp mediump 4-component vector of float FragData)
0:38 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:38 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:38 Constant: 0:38 Constant:
0:38 1000 (const int) 0:38 1000 (const int)
0:38 Constant: 0:38 Constant:
@ -246,8 +246,8 @@ ERROR: node is still EOpNull!
0:38 1.000000 0:38 1.000000
0:38 1.000000 0:38 1.000000
0:39 move second child to first child (temp mediump 4-component vector of float) 0:39 move second child to first child (temp mediump 4-component vector of float)
0:39 direct index (temp mediump 4-component vector of float) 0:39 direct index (temp mediump 4-component vector of float FragData)
0:39 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:39 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:39 Constant: 0:39 Constant:
0:39 -1 (const int) 0:39 -1 (const int)
0:39 Constant: 0:39 Constant:
@ -256,8 +256,8 @@ ERROR: node is still EOpNull!
0:39 1.000000 0:39 1.000000
0:39 1.000000 0:39 1.000000
0:40 move second child to first child (temp mediump 4-component vector of float) 0:40 move second child to first child (temp mediump 4-component vector of float)
0:40 direct index (temp mediump 4-component vector of float) 0:40 direct index (temp mediump 4-component vector of float FragData)
0:40 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float) 0:40 'gl_FragData' (fragColor 32-element array of mediump 4-component vector of float FragData)
0:40 Constant: 0:40 Constant:
0:40 3 (const int) 0:40 3 (const int)
0:40 Constant: 0:40 Constant:

View File

@ -7,8 +7,8 @@ Shader version: 130
0:5 Function Parameters: 0:5 Function Parameters:
0:7 Sequence 0:7 Sequence
0:7 move second child to first child (temp 4-component vector of float) 0:7 move second child to first child (temp 4-component vector of float)
0:7 direct index (temp 4-component vector of float) 0:7 direct index (temp 4-component vector of float FragData)
0:7 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:7 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:7 Constant: 0:7 Constant:
0:7 1 (const int) 0:7 1 (const int)
0:7 'Color' (smooth in 4-component vector of float) 0:7 'Color' (smooth in 4-component vector of float)
@ -25,8 +25,8 @@ Shader version: 130
0:5 Function Parameters: 0:5 Function Parameters:
0:7 Sequence 0:7 Sequence
0:7 move second child to first child (temp 4-component vector of float) 0:7 move second child to first child (temp 4-component vector of float)
0:7 direct index (temp 4-component vector of float) 0:7 direct index (temp 4-component vector of float FragData)
0:7 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:7 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:7 Constant: 0:7 Constant:
0:7 1 (const int) 0:7 1 (const int)
0:7 'Color' (smooth in 4-component vector of float) 0:7 'Color' (smooth in 4-component vector of float)

View File

@ -7,8 +7,8 @@ Shader version: 130
0:7 Function Parameters: 0:7 Function Parameters:
0:9 Sequence 0:9 Sequence
0:9 move second child to first child (temp 4-component vector of float) 0:9 move second child to first child (temp 4-component vector of float)
0:9 indirect index (temp 4-component vector of float) 0:9 indirect index (temp 4-component vector of float FragData)
0:9 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:9 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:9 'i' (uniform int) 0:9 'i' (uniform int)
0:9 'Color' (smooth in 4-component vector of float) 0:9 'Color' (smooth in 4-component vector of float)
0:? Linker Objects 0:? Linker Objects
@ -25,8 +25,8 @@ Shader version: 130
0:7 Function Parameters: 0:7 Function Parameters:
0:9 Sequence 0:9 Sequence
0:9 move second child to first child (temp 4-component vector of float) 0:9 move second child to first child (temp 4-component vector of float)
0:9 indirect index (temp 4-component vector of float) 0:9 indirect index (temp 4-component vector of float FragData)
0:9 'gl_FragData' (fragColor 32-element array of 4-component vector of float) 0:9 'gl_FragData' (fragColor 32-element array of 4-component vector of float FragData)
0:9 'i' (uniform int) 0:9 'i' (uniform int)
0:9 'Color' (smooth in 4-component vector of float) 0:9 'Color' (smooth in 4-component vector of float)
0:? Linker Objects 0:? Linker Objects

View File

@ -66,8 +66,8 @@ enum TStorageQualifier {
EvqTemporary, // For temporaries (within a function), read/write EvqTemporary, // For temporaries (within a function), read/write
EvqGlobal, // For globals read/write EvqGlobal, // For globals read/write
EvqConst, // User-defined constant values, will be semantically constant and constant folded EvqConst, // User-defined constant values, will be semantically constant and constant folded
EvqVaryingIn, // pipeline input, read only, also supercategory for all built-ins not included in this enum (see TBuiltIn) EvqVaryingIn, // pipeline input, read only, also supercategory for all built-ins not included in this enum (see TBuiltInVariable)
EvqVaryingOut, // pipeline ouput, read/write, also supercategory for all built-ins not included in this enum (see TBuiltIn) EvqVaryingOut, // pipeline ouput, read/write, also supercategory for all built-ins not included in this enum (see TBuiltInVariable)
EvqUniform, // read only, shared with app EvqUniform, // read only, shared with app
EvqBuffer, // read/write, shared with app EvqBuffer, // read/write, shared with app
EvqShared, // compute shader's read/write 'shared' qualifier EvqShared, // compute shader's read/write 'shared' qualifier

View File

@ -2706,6 +2706,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable); BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable);
BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable); BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable);
BuiltInVariable("gl_PrimitiveIDIn", EbvPrimitiveId, symbolTable);
BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable);
BuiltInVariable("gl_InvocationID", EbvInvocationId, symbolTable); BuiltInVariable("gl_InvocationID", EbvInvocationId, symbolTable);
BuiltInVariable("gl_Layer", EbvLayer, symbolTable); BuiltInVariable("gl_Layer", EbvLayer, symbolTable);
@ -2767,8 +2768,6 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
// Compatibility variables // Compatibility variables
SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable);
BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable);
BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable);
BuiltInVariable("gl_in", "gl_Color", EbvColor, symbolTable); BuiltInVariable("gl_in", "gl_Color", EbvColor, symbolTable);
@ -3037,6 +3036,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
arraySizes->setSize(resources.maxDrawBuffers); arraySizes->setSize(resources.maxDrawBuffers);
fragData.setArraySizes(arraySizes); fragData.setArraySizes(arraySizes);
symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData));
SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable);
} }
break; break;