Tessellation: implement 'patch' semantics.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24486 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-12-12 01:25:37 +00:00
parent a57a78ed9f
commit 116c30b6ed
14 changed files with 311 additions and 221 deletions

View File

@@ -245,7 +245,7 @@ public:
smooth = false;
flat = false;
nopersp = false;
patch = false; // TODO 4.0 tessellation: implement semantics of patch (all of 4.3 stuff...), including arrayed inputs
patch = false;
sample = false;
shared = false;
coherent = false;

View File

@@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "24468"
#define GLSLANG_DATE "2013/12/11 11:57:40"
#define GLSLANG_REVISION "24480"
#define GLSLANG_DATE "2013/12/11 15:38:19"

View File

@@ -1638,41 +1638,6 @@ void TParseContext::globalQualifierCheck(TSourceLoc loc, const TQualifier& quali
return;
}
if (language == EShLangVertex && qualifier.storage == EvqVaryingIn) {
if (publicType.basicType == EbtStruct) {
error(loc, "cannot be a structure or array", GetStorageQualifierString(qualifier.storage), "");
return;
}
if (publicType.arraySizes) {
requireProfile(loc, ~EEsProfile, "vertex input arrays");
profileRequires(loc, ENoProfile, 150, 0, "vertex input arrays");
}
}
if (language == EShLangFragment && qualifier.storage == EvqVaryingOut) {
profileRequires(loc, EEsProfile, 300, 0, "fragment shader output");
if (publicType.basicType == EbtStruct) {
error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), "");
return;
}
}
if (language == EShLangVertex && qualifier.storage == EvqVaryingOut) {
if (publicType.userDef) {
profileRequires(loc, EEsProfile, 300, 0, "vertex-shader struct output");
profileRequires(loc, ~EEsProfile, 150, 0, "vertex-shader struct output");
}
}
if (language == EShLangFragment && qualifier.storage == EvqVaryingIn) {
if (publicType.userDef) {
profileRequires(loc, EEsProfile, 300, 0, "fragment-shader struct input");
profileRequires(loc, ~EEsProfile, 150, 0, "fragment-shader struct input");
}
}
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble) {
profileRequires(loc, EEsProfile, 300, 0, "shader input/output");
if (! qualifier.flat) {
@@ -1683,9 +1648,85 @@ void TParseContext::globalQualifierCheck(TSourceLoc loc, const TQualifier& quali
}
}
if (language == EShLangVertex && qualifier.storage == EvqVaryingIn &&
(qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant))
error(loc, "vertex input cannot be further qualified", "", "");
if (qualifier.patch && qualifier.isInterpolation())
error(loc, "cannot use interpolation qualifiers with patch", "patch", "");
if (qualifier.storage == EvqVaryingIn) {
switch (language) {
case EShLangVertex:
if (publicType.basicType == EbtStruct) {
error(loc, "cannot be a structure or array", GetStorageQualifierString(qualifier.storage), "");
return;
}
if (publicType.arraySizes) {
requireProfile(loc, ~EEsProfile, "vertex input arrays");
profileRequires(loc, ENoProfile, 150, 0, "vertex input arrays");
}
if (qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant)
error(loc, "vertex input cannot be further qualified", "", "");
break;
case EShLangTessControl:
if (qualifier.patch)
error(loc, "can only use on output in tessellation-control shader", "patch", "");
break;
case EShLangTessEvaluation:
break;
case EShLangGeometry:
break;
case EShLangFragment:
if (publicType.userDef) {
profileRequires(loc, EEsProfile, 300, 0, "fragment-shader struct input");
profileRequires(loc, ~EEsProfile, 150, 0, "fragment-shader struct input");
}
break;
case EShLangCompute:
break;
default:
break;
}
} else {
// qualifier.storage == EvqVaryingOut
switch (language) {
case EShLangVertex:
if (publicType.userDef) {
profileRequires(loc, EEsProfile, 300, 0, "vertex-shader struct output");
profileRequires(loc, ~EEsProfile, 150, 0, "vertex-shader struct output");
}
break;
case EShLangTessControl:
break;
case EShLangTessEvaluation:
if (qualifier.patch)
error(loc, "can only use on input in tessellation-evaluation shader", "patch", "");
break;
case EShLangGeometry:
break;
case EShLangFragment:
profileRequires(loc, EEsProfile, 300, 0, "fragment shader output");
if (publicType.basicType == EbtStruct) {
error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), "");
return;
}
break;
case EShLangCompute:
break;
default:
break;
}
}
}
//

View File

@@ -1228,6 +1228,8 @@ storage_qualifier
}
| PATCH {
parseContext.globalCheck($1.loc, "patch");
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
parseContext.profileRequires($1.loc, ~EEsProfile, 400, 1, &GL_ARB_tessellation_shader, "patch");
$$.init($1.loc);
$$.qualifier.patch = true;
}