Semantics: 'invocations' defaults to 1, not 0.
'invocations' was using 0 as the "shader never set" flag and as the default. Formalize this and explicit set to 1 and link time.
This commit is contained in:
@@ -12,7 +12,7 @@ ERROR: 7 compilation errors. No code generated.
|
|||||||
|
|
||||||
|
|
||||||
Shader version: 410
|
Shader version: 410
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = none
|
output primitive = none
|
||||||
@@ -65,7 +65,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
|
|||||||
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
||||||
|
|
||||||
Shader version: 410
|
Shader version: 410
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = none
|
output primitive = none
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ ERROR: 6 compilation errors. No code generated.
|
|||||||
|
|
||||||
|
|
||||||
Shader version: 420
|
Shader version: 420
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = triangles
|
input primitive = triangles
|
||||||
output primitive = none
|
output primitive = none
|
||||||
@@ -137,7 +137,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
|
|||||||
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
||||||
|
|
||||||
Shader version: 420
|
Shader version: 420
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = triangles
|
input primitive = triangles
|
||||||
output primitive = none
|
output primitive = none
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ERROR: 1 compilation errors. No code generated.
|
|||||||
|
|
||||||
|
|
||||||
Shader version: 420
|
Shader version: 420
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = triangles
|
input primitive = triangles
|
||||||
output primitive = none
|
output primitive = none
|
||||||
@@ -44,7 +44,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
|
|||||||
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
||||||
|
|
||||||
Shader version: 420
|
Shader version: 420
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = triangles
|
input primitive = triangles
|
||||||
output primitive = none
|
output primitive = none
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||||
|
|
||||||
Shader version: 450
|
Shader version: 450
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = none
|
output primitive = none
|
||||||
@@ -40,7 +40,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
|
|||||||
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
||||||
|
|
||||||
Shader version: 450
|
Shader version: 450
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = none
|
output primitive = none
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ ERROR: 1 compilation errors. No code generated.
|
|||||||
|
|
||||||
|
|
||||||
Shader version: 150
|
Shader version: 150
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = points
|
output primitive = points
|
||||||
@@ -29,7 +29,7 @@ ERROR: node is still EOpNull!
|
|||||||
|
|
||||||
noMain2.geom
|
noMain2.geom
|
||||||
Shader version: 150
|
Shader version: 150
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = line_strip
|
output primitive = line_strip
|
||||||
@@ -52,7 +52,7 @@ ERROR: Linking fragment stage: Multiple function bodies in multiple compilation
|
|||||||
main(
|
main(
|
||||||
|
|
||||||
Shader version: 150
|
Shader version: 150
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = -1
|
max_vertices = -1
|
||||||
input primitive = none
|
input primitive = none
|
||||||
output primitive = points
|
output primitive = points
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
max_vertices_0.geom
|
max_vertices_0.geom
|
||||||
Shader version: 330
|
Shader version: 330
|
||||||
invocations = 0
|
invocations = -1
|
||||||
max_vertices = 0
|
max_vertices = 0
|
||||||
input primitive = points
|
input primitive = points
|
||||||
output primitive = triangle_strip
|
output primitive = triangle_strip
|
||||||
@@ -19,7 +19,7 @@ Linked geometry stage:
|
|||||||
|
|
||||||
|
|
||||||
Shader version: 330
|
Shader version: 330
|
||||||
invocations = 0
|
invocations = 1
|
||||||
max_vertices = 0
|
max_vertices = 0
|
||||||
input primitive = points
|
input primitive = points
|
||||||
output primitive = triangle_strip
|
output primitive = triangle_strip
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Linked geometry stage:
|
|||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Geometry 4 "main" 18 70 10 29 33
|
EntryPoint Geometry 4 "main" 18 70 10 29 33
|
||||||
ExecutionMode 4 InputTrianglesAdjacency
|
ExecutionMode 4 InputTrianglesAdjacency
|
||||||
ExecutionMode 4 Invocations 0
|
ExecutionMode 4 Invocations 1
|
||||||
ExecutionMode 4 OutputTriangleStrip
|
ExecutionMode 4 OutputTriangleStrip
|
||||||
ExecutionMode 4 OutputVertices 30
|
ExecutionMode 4 OutputVertices 30
|
||||||
Source GLSL 150
|
Source GLSL 150
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Linked geometry stage:
|
|||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Geometry 4 "main" 20 13
|
EntryPoint Geometry 4 "main" 20 13
|
||||||
ExecutionMode 4 Triangles
|
ExecutionMode 4 Triangles
|
||||||
ExecutionMode 4 Invocations 0
|
ExecutionMode 4 Invocations 1
|
||||||
ExecutionMode 4 OutputTriangleStrip
|
ExecutionMode 4 OutputTriangleStrip
|
||||||
ExecutionMode 4 OutputVertices 3
|
ExecutionMode 4 OutputVertices 3
|
||||||
Source GLSL 330
|
Source GLSL 330
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ struct TShaderQualifiers {
|
|||||||
TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives
|
TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives
|
||||||
bool pixelCenterInteger; // fragment shader
|
bool pixelCenterInteger; // fragment shader
|
||||||
bool originUpperLeft; // fragment shader
|
bool originUpperLeft; // fragment shader
|
||||||
int invocations; // 0 means no declaration
|
int invocations;
|
||||||
int vertices; // both for tessellation "vertices" and geometry "max_vertices"
|
int vertices; // both for tessellation "vertices" and geometry "max_vertices"
|
||||||
TVertexSpacing spacing;
|
TVertexSpacing spacing;
|
||||||
TVertexOrder order;
|
TVertexOrder order;
|
||||||
@@ -790,7 +790,7 @@ struct TShaderQualifiers {
|
|||||||
geometry = ElgNone;
|
geometry = ElgNone;
|
||||||
originUpperLeft = false;
|
originUpperLeft = false;
|
||||||
pixelCenterInteger = false;
|
pixelCenterInteger = false;
|
||||||
invocations = 0; // 0 means no declaration
|
invocations = TQualifier::layoutNotSet;
|
||||||
vertices = TQualifier::layoutNotSet;
|
vertices = TQualifier::layoutNotSet;
|
||||||
spacing = EvsNone;
|
spacing = EvsNone;
|
||||||
order = EvoNone;
|
order = EvoNone;
|
||||||
@@ -813,7 +813,7 @@ struct TShaderQualifiers {
|
|||||||
pixelCenterInteger = src.pixelCenterInteger;
|
pixelCenterInteger = src.pixelCenterInteger;
|
||||||
if (src.originUpperLeft)
|
if (src.originUpperLeft)
|
||||||
originUpperLeft = src.originUpperLeft;
|
originUpperLeft = src.originUpperLeft;
|
||||||
if (src.invocations != 0)
|
if (src.invocations != TQualifier::layoutNotSet)
|
||||||
invocations = src.invocations;
|
invocations = src.invocations;
|
||||||
if (src.vertices != TQualifier::layoutNotSet)
|
if (src.vertices != TQualifier::layoutNotSet)
|
||||||
vertices = src.vertices;
|
vertices = src.vertices;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
// For the version, it uses the latest git tag followed by the number of commits.
|
// For the version, it uses the latest git tag followed by the number of commits.
|
||||||
// For the date, it uses the current date (when then script is run).
|
// For the date, it uses the current date (when then script is run).
|
||||||
|
|
||||||
#define GLSLANG_REVISION "SPIRV99.841"
|
#define GLSLANG_REVISION "SPIRV99.842"
|
||||||
#define GLSLANG_DATE "12-Dec-2015"
|
#define GLSLANG_DATE "13-Dec-2015"
|
||||||
|
|||||||
@@ -3889,7 +3889,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
|||||||
case EShLangGeometry:
|
case EShLangGeometry:
|
||||||
if (id == "invocations") {
|
if (id == "invocations") {
|
||||||
profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations");
|
profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations");
|
||||||
publicType.shaderQualifiers.invocations = value;
|
if (value == 0)
|
||||||
|
error(loc, "must be at least 1", "invocations", "");
|
||||||
|
else
|
||||||
|
publicType.shaderQualifiers.invocations = value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (id == "max_vertices") {
|
if (id == "max_vertices") {
|
||||||
@@ -4276,7 +4279,7 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
|
|||||||
|
|
||||||
if (shaderQualifiers.geometry != ElgNone)
|
if (shaderQualifiers.geometry != ElgNone)
|
||||||
error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), "");
|
error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), "");
|
||||||
if (shaderQualifiers.invocations > 0)
|
if (shaderQualifiers.invocations != TQualifier::layoutNotSet)
|
||||||
error(loc, message, "invocations", "");
|
error(loc, message, "invocations", "");
|
||||||
if (shaderQualifiers.vertices != TQualifier::layoutNotSet) {
|
if (shaderQualifiers.vertices != TQualifier::layoutNotSet) {
|
||||||
if (language == EShLangGeometry)
|
if (language == EShLangGeometry)
|
||||||
@@ -5453,7 +5456,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
|
|||||||
if (language == EShLangTessControl)
|
if (language == EShLangTessControl)
|
||||||
checkIoArraysConsistency(loc);
|
checkIoArraysConsistency(loc);
|
||||||
}
|
}
|
||||||
if (publicType.shaderQualifiers.invocations) {
|
if (publicType.shaderQualifiers.invocations != TQualifier::layoutNotSet) {
|
||||||
if (publicType.qualifier.storage != EvqVaryingIn)
|
if (publicType.qualifier.storage != EvqVaryingIn)
|
||||||
error(loc, "can only apply to 'in'", "invocations", "");
|
error(loc, "can only apply to 'in'", "invocations", "");
|
||||||
if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations))
|
if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations))
|
||||||
|
|||||||
@@ -359,6 +359,10 @@ void TIntermediate::finalCheck(TInfoSink& infoSink)
|
|||||||
// overlap/alias/missing I/O, etc.
|
// overlap/alias/missing I/O, etc.
|
||||||
inOutLocationCheck(infoSink);
|
inOutLocationCheck(infoSink);
|
||||||
|
|
||||||
|
// invocations
|
||||||
|
if (invocations == TQualifier::layoutNotSet)
|
||||||
|
invocations = 1;
|
||||||
|
|
||||||
if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipVertex"))
|
if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipVertex"))
|
||||||
error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)");
|
error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)");
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ class TIntermediate {
|
|||||||
public:
|
public:
|
||||||
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), spv(0),
|
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), spv(0),
|
||||||
numMains(0), numErrors(0), recursive(false),
|
numMains(0), numErrors(0), recursive(false),
|
||||||
invocations(0), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false),
|
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone),
|
||||||
|
pixelCenterInteger(false), originUpperLeft(false),
|
||||||
vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false)
|
vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false)
|
||||||
{
|
{
|
||||||
localSize[0] = 1;
|
localSize[0] = 1;
|
||||||
@@ -204,7 +205,7 @@ public:
|
|||||||
|
|
||||||
bool setInvocations(int i)
|
bool setInvocations(int i)
|
||||||
{
|
{
|
||||||
if (invocations > 0)
|
if (invocations != TQualifier::layoutNotSet)
|
||||||
return invocations == i;
|
return invocations == i;
|
||||||
invocations = i;
|
invocations = i;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user