Commit d63243f5 by Corentin Wallez

renderergl_utils: Require explicit location qualifier for OpenGLES3

BUG=525930 Change-Id: I591308078c5a392a527291419567a11241a8be17 Reviewed-on: https://chromium-review.googlesource.com/309636Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 121ea584
......@@ -177,6 +177,12 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root)
}
}
// GLSL ES 3 explicit location qualifiers need to use an extension before GLSL 330
if (getShaderVersion() >= 300 && getOutputType() < SH_GLSL_330_CORE_OUTPUT)
{
sink << "#extension GL_ARB_explicit_attrib_location : require\n";
}
TExtensionGLSL extensionGLSL(getOutputType());
root->traverse(&extensionGLSL);
......
......@@ -539,6 +539,15 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
LimitVersion(maxSupportedESVersion, gl::Version(2, 0));
}
// ES3 needs to support explicit layout location qualifiers, while it might be possible to
// fake them in our side, we currently don't support that.
if (!functions->isAtLeastGL(gl::Version(3, 3)) &&
!functions->hasGLExtension("GL_ARB_explicit_attrib_location") &&
!functions->isAtLeastGLES(gl::Version(3, 0)))
{
LimitVersion(maxSupportedESVersion, gl::Version(2, 0));
}
// Extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = functions->standard == STANDARD_GL_DESKTOP ||
......
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