Merge pull request #967 from dsrbecky/multiview

Multiview extension: Accept layout(num_views) qualifier
This commit is contained in:
John Kessenich
2017-07-03 22:14:09 -06:00
committed by GitHub
5 changed files with 34 additions and 10 deletions

View File

@@ -970,6 +970,7 @@ struct TShaderQualifiers {
bool earlyFragmentTests; // fragment input
TLayoutDepth layoutDepth;
bool blendEquation; // true if any blend equation was specified
int numViews; // multiview extenstions
#ifdef NV_EXTENSIONS
bool layoutOverrideCoverage; // true if layout override_coverage set
@@ -994,6 +995,7 @@ struct TShaderQualifiers {
earlyFragmentTests = false;
layoutDepth = EldNone;
blendEquation = false;
numViews = TQualifier::layoutNotSet;
#ifdef NV_EXTENSIONS
layoutOverrideCoverage = false;
#endif
@@ -1033,6 +1035,8 @@ struct TShaderQualifiers {
layoutDepth = src.layoutDepth;
if (src.blendEquation)
blendEquation = src.blendEquation;
if (src.numViews != TQualifier::layoutNotSet)
numViews = src.numViews;
#ifdef NV_EXTENSIONS
if (src.layoutOverrideCoverage)
layoutOverrideCoverage = src.layoutOverrideCoverage;

View File

@@ -4206,6 +4206,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
}
return;
}
if (id == "num_views") {
requireExtensions(loc, Num_OVR_multiview_EXTs, OVR_multiview_EXTs, "num_views");
publicType.shaderQualifiers.numViews = value;
return;
}
#if NV_EXTENSIONS
if (language == EShLangVertex ||
@@ -4804,6 +4809,8 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
}
if (shaderQualifiers.blendEquation)
error(loc, message, "blend equation", "");
if (shaderQualifiers.numViews != TQualifier::layoutNotSet)
error(loc, message, "num_views", "");
}
// Correct and/or advance an object's offset layout qualifier.