Commit 7bf5fcc5 by Rex Xu

Fix parser issue: redeclare gl_FragStencilRefARB is not supported

parent 918caa7e
......@@ -2,6 +2,8 @@
#extension GL_ARB_shader_stencil_export: enable
out int gl_FragStencilRefARB;
void main()
{
gl_FragStencilRefARB = 100;
......
......@@ -3872,6 +3872,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
identifier == "gl_BackSecondaryColor" ||
identifier == "gl_SecondaryColor" ||
(identifier == "gl_Color" && language == EShLangFragment) ||
(identifier == "gl_FragStencilRefARB" && (nonEsRedecls && version >= 140)
&& language == EShLangFragment) ||
#ifdef NV_EXTENSIONS
identifier == "gl_SampleMask" ||
identifier == "gl_Layer" ||
......@@ -3954,6 +3956,12 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
error(loc, "all redeclarations must use the same depth layout on", "redeclaration", symbol->getName().c_str());
}
}
else if (identifier == "gl_FragStencilRefARB") {
if (qualifier.hasLayout())
error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str());
if (qualifier.storage != EvqVaryingOut)
error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str());
}
#ifdef NV_EXTENSIONS
else if (identifier == "gl_SampleMask") {
if (!publicType.layoutOverrideCoverage) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment