Turn on non-uniform blocks (in/out/buffer), and prevent new stages from working with "no profile" (before 150) shaders.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23470 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
9d30218fb6
commit
a4ea1313c3
9 changed files with 60 additions and 39 deletions
|
|
@ -97,6 +97,10 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb,
|
|||
globalUniformDefaults.layoutMatrix = ElmColumnMajor;
|
||||
globalUniformDefaults.layoutPacking = ElpShared;
|
||||
|
||||
globalBufferDefaults.clear();
|
||||
globalBufferDefaults.layoutMatrix = ElmColumnMajor;
|
||||
globalBufferDefaults.layoutPacking = ElpShared;
|
||||
|
||||
globalInputDefaults.clear();
|
||||
|
||||
globalOutputDefaults.clear();
|
||||
|
|
@ -2356,12 +2360,21 @@ void TParseContext::addBlock(TSourceLoc loc, TTypeList& typeList, const TString*
|
|||
if (profile == EEsProfile && arraySizes)
|
||||
arraySizeRequiredCheck(loc, arraySizes->getSize());
|
||||
|
||||
if (currentBlockDefaults.storage == EvqUniform) {
|
||||
requireProfile(loc, ~ENoProfile, "uniform block");
|
||||
switch (currentBlockDefaults.storage) {
|
||||
case EvqBuffer:
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, "buffer block");
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, 0, "buffer block");
|
||||
break;
|
||||
case EvqUniform:
|
||||
profileRequires(loc, EEsProfile, 300, 0, "uniform block");
|
||||
} else {
|
||||
error(loc, "only uniform interface blocks are supported", blockName->c_str(), "");
|
||||
|
||||
profileRequires(loc, ENoProfile, 140, 0, "uniform block");
|
||||
break;
|
||||
case EvqIn:
|
||||
case EvqOut:
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, "in/out block");
|
||||
break;
|
||||
default:
|
||||
error(loc, "only uniform, in, or out interface blocks are supported", blockName->c_str(), "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2384,6 +2397,7 @@ void TParseContext::addBlock(TSourceLoc loc, TTypeList& typeList, const TString*
|
|||
|
||||
TQualifier defaultQualification;
|
||||
switch (currentBlockDefaults.storage) {
|
||||
case EvqBuffer: defaultQualification = globalBufferDefaults; break;
|
||||
case EvqUniform: defaultQualification = globalUniformDefaults; break;
|
||||
case EvqIn: defaultQualification = globalInputDefaults; break;
|
||||
case EvqOut: defaultQualification = globalOutputDefaults; break;
|
||||
|
|
@ -2471,6 +2485,12 @@ void TParseContext::addQualifierToExisting(TSourceLoc loc, TQualifier qualifier,
|
|||
void TParseContext::updateQualifierDefaults(TQualifier qualifier)
|
||||
{
|
||||
switch (qualifier.storage) {
|
||||
case EvqBuffer:
|
||||
if (qualifier.layoutMatrix != ElmNone)
|
||||
globalBufferDefaults.layoutMatrix = qualifier.layoutMatrix;
|
||||
if (qualifier.layoutPacking != ElpNone)
|
||||
globalBufferDefaults.layoutPacking = qualifier.layoutPacking;
|
||||
break;
|
||||
case EvqUniform:
|
||||
if (qualifier.layoutMatrix != ElmNone)
|
||||
globalUniformDefaults.layoutMatrix = qualifier.layoutMatrix;
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ protected:
|
|||
static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2)); // see computeSamplerTypeIndex()
|
||||
TPrecisionQualifier defaultSamplerPrecision[maxSamplerIndex];
|
||||
bool afterEOF;
|
||||
TQualifier globalBufferDefaults;
|
||||
TQualifier globalUniformDefaults;
|
||||
TQualifier globalInputDefaults;
|
||||
TQualifier globalOutputDefaults;
|
||||
|
|
|
|||
|
|
@ -340,31 +340,28 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||
// Correct for stage type...
|
||||
switch (stage) {
|
||||
case EShLangGeometry:
|
||||
if (version < 150 || profile == EEsProfile) {
|
||||
if (version < 150 || (profile != ECoreProfile && profile != ECompatibilityProfile)) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: geometry shaders require non-es profile and version 150 or above");
|
||||
version = 150;
|
||||
if (profile == EEsProfile)
|
||||
profile = ECoreProfile;
|
||||
profile = ECoreProfile;
|
||||
}
|
||||
break;
|
||||
case EShLangTessControl:
|
||||
case EShLangTessEvaluation:
|
||||
if (version < 400 || profile == EEsProfile) {
|
||||
if (version < 400 || (profile != ECoreProfile && profile != ECompatibilityProfile)) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: tessellation shaders require non-es profile and version 400 or above");
|
||||
version = 400;
|
||||
if (profile == EEsProfile)
|
||||
profile = ECoreProfile;
|
||||
profile = ECoreProfile;
|
||||
}
|
||||
break;
|
||||
case EShLangCompute:
|
||||
if (version < 430 || profile == EEsProfile) {
|
||||
if (version < 430 || (profile != ECoreProfile && profile != ECompatibilityProfile)) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: compute shaders require non-es profile and version 430 or above");
|
||||
version = 430;
|
||||
if (profile == EEsProfile)
|
||||
profile = ECoreProfile;
|
||||
profile = ECoreProfile;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue