|
@@ -535,6 +535,9 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
error(infoSink, "number of invocations must match between compilation units");
|
|
error(infoSink, "number of invocations must match between compilation units");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that at least one compilation unit
|
|
|
|
+ // must declare the vertices layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (vertices == TQualifier::layoutNotSet)
|
|
if (vertices == TQualifier::layoutNotSet)
|
|
vertices = unit.vertices;
|
|
vertices = unit.vertices;
|
|
else if (unit.vertices != TQualifier::layoutNotSet && vertices != unit.vertices) {
|
|
else if (unit.vertices != TQualifier::layoutNotSet && vertices != unit.vertices) {
|
|
@@ -545,20 +548,30 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
else
|
|
else
|
|
assert(0);
|
|
assert(0);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // The mesh shader extension requires that at least one compilation unit
|
|
|
|
+ // must declare the max_primitives layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (primitives == TQualifier::layoutNotSet)
|
|
if (primitives == TQualifier::layoutNotSet)
|
|
primitives = unit.primitives;
|
|
primitives = unit.primitives;
|
|
- else if (primitives != unit.primitives) {
|
|
|
|
|
|
+ else if (unit.primitives != TQualifier::layoutNotSet && primitives != unit.primitives) {
|
|
if (language == EShLangMesh)
|
|
if (language == EShLangMesh)
|
|
error(infoSink, "Contradictory layout max_primitives values");
|
|
error(infoSink, "Contradictory layout max_primitives values");
|
|
else
|
|
else
|
|
assert(0);
|
|
assert(0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that at least one compilation unit
|
|
|
|
+ // must declare the input primitive layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (inputPrimitive == ElgNone)
|
|
if (inputPrimitive == ElgNone)
|
|
inputPrimitive = unit.inputPrimitive;
|
|
inputPrimitive = unit.inputPrimitive;
|
|
else if (unit.inputPrimitive != ElgNone && inputPrimitive != unit.inputPrimitive)
|
|
else if (unit.inputPrimitive != ElgNone && inputPrimitive != unit.inputPrimitive)
|
|
error(infoSink, "Contradictory input layout primitives");
|
|
error(infoSink, "Contradictory input layout primitives");
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that at least one compilation unit
|
|
|
|
+ // must declare the output primitive layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (outputPrimitive == ElgNone)
|
|
if (outputPrimitive == ElgNone)
|
|
outputPrimitive = unit.outputPrimitive;
|
|
outputPrimitive = unit.outputPrimitive;
|
|
else if (unit.outputPrimitive != ElgNone && outputPrimitive != unit.outputPrimitive)
|
|
else if (unit.outputPrimitive != ElgNone && outputPrimitive != unit.outputPrimitive)
|
|
@@ -567,19 +580,27 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger)
|
|
if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger)
|
|
error(infoSink, "gl_FragCoord redeclarations must match across shaders");
|
|
error(infoSink, "gl_FragCoord redeclarations must match across shaders");
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that at least one compilation unit
|
|
|
|
+ // must declare the vertex spacing layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (vertexSpacing == EvsNone)
|
|
if (vertexSpacing == EvsNone)
|
|
vertexSpacing = unit.vertexSpacing;
|
|
vertexSpacing = unit.vertexSpacing;
|
|
- else if (vertexSpacing != unit.vertexSpacing)
|
|
|
|
|
|
+ else if (unit.vertexSpacing != EvsNone && vertexSpacing != unit.vertexSpacing)
|
|
error(infoSink, "Contradictory input vertex spacing");
|
|
error(infoSink, "Contradictory input vertex spacing");
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that at least one compilation unit
|
|
|
|
+ // must declare the triangle ordering layout, but not all units need to do so.
|
|
|
|
+ // However, all declarations must match.
|
|
if (vertexOrder == EvoNone)
|
|
if (vertexOrder == EvoNone)
|
|
vertexOrder = unit.vertexOrder;
|
|
vertexOrder = unit.vertexOrder;
|
|
- else if (vertexOrder != unit.vertexOrder)
|
|
|
|
|
|
+ else if (unit.vertexOrder != EvoNone && vertexOrder != unit.vertexOrder)
|
|
error(infoSink, "Contradictory triangle ordering");
|
|
error(infoSink, "Contradictory triangle ordering");
|
|
|
|
|
|
MERGE_TRUE(pointMode);
|
|
MERGE_TRUE(pointMode);
|
|
|
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
for (int i = 0; i < 3; ++i) {
|
|
|
|
+ // The GLSL specification requires that all workgroup size declarations must match
|
|
|
|
+ // but not all units have to declare the layout.
|
|
if (unit.localSizeNotDefault[i]) {
|
|
if (unit.localSizeNotDefault[i]) {
|
|
if (!localSizeNotDefault[i]) {
|
|
if (!localSizeNotDefault[i]) {
|
|
localSize[i] = unit.localSize[i];
|
|
localSize[i] = unit.localSize[i];
|
|
@@ -589,9 +610,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
error(infoSink, "Contradictory local size");
|
|
error(infoSink, "Contradictory local size");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that all workgroup size specialization
|
|
|
|
+ // ids declarations must match, but not all units have to declare the layout.
|
|
if (localSizeSpecId[i] == TQualifier::layoutNotSet)
|
|
if (localSizeSpecId[i] == TQualifier::layoutNotSet)
|
|
localSizeSpecId[i] = unit.localSizeSpecId[i];
|
|
localSizeSpecId[i] = unit.localSizeSpecId[i];
|
|
- else if (localSizeSpecId[i] != unit.localSizeSpecId[i])
|
|
|
|
|
|
+ else if (unit.localSizeSpecId[i] != TQualifier::layoutNotSet && localSizeSpecId[i] != unit.localSizeSpecId[i])
|
|
error(infoSink, "Contradictory local size specialization ids");
|
|
error(infoSink, "Contradictory local size specialization ids");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -602,9 +625,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
MERGE_TRUE(nonCoherentStencilAttachmentReadEXT);
|
|
MERGE_TRUE(nonCoherentStencilAttachmentReadEXT);
|
|
MERGE_TRUE(nonCoherentTileAttachmentReadQCOM);
|
|
MERGE_TRUE(nonCoherentTileAttachmentReadQCOM);
|
|
|
|
|
|
|
|
+ // The GLSL specification requires that all depth layout redeclarations must match,
|
|
|
|
+ // but not all units have to declare the layout.
|
|
if (depthLayout == EldNone)
|
|
if (depthLayout == EldNone)
|
|
depthLayout = unit.depthLayout;
|
|
depthLayout = unit.depthLayout;
|
|
- else if (depthLayout != unit.depthLayout)
|
|
|
|
|
|
+ else if (unit.depthLayout != EldNone && depthLayout != unit.depthLayout)
|
|
error(infoSink, "Contradictory depth layouts");
|
|
error(infoSink, "Contradictory depth layouts");
|
|
|
|
|
|
MERGE_TRUE(depthReplacing);
|
|
MERGE_TRUE(depthReplacing);
|
|
@@ -615,9 +640,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|
MERGE_TRUE(xfbMode);
|
|
MERGE_TRUE(xfbMode);
|
|
|
|
|
|
for (size_t b = 0; b < xfbBuffers.size(); ++b) {
|
|
for (size_t b = 0; b < xfbBuffers.size(); ++b) {
|
|
|
|
+ // The GLSL specification requires that all xfb_stride declarations for
|
|
|
|
+ // the same buffer must match, but not all units have to declare the layout.
|
|
if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd)
|
|
if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd)
|
|
xfbBuffers[b].stride = unit.xfbBuffers[b].stride;
|
|
xfbBuffers[b].stride = unit.xfbBuffers[b].stride;
|
|
- else if (xfbBuffers[b].stride != unit.xfbBuffers[b].stride)
|
|
|
|
|
|
+ else if (unit.xfbBuffers[b].stride != TQualifier::layoutXfbStrideEnd && xfbBuffers[b].stride != unit.xfbBuffers[b].stride)
|
|
error(infoSink, "Contradictory xfb_stride");
|
|
error(infoSink, "Contradictory xfb_stride");
|
|
xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride);
|
|
xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride);
|
|
if (unit.xfbBuffers[b].contains64BitType)
|
|
if (unit.xfbBuffers[b].contains64BitType)
|