Validate uniform binding at link time
GLSL ES Spec 3.10.4, section 4.4.5 has the rules for linking uniforms
with binding layout qualifiers. If a binding layout qualifier for a
uniform variable is specified in both vertex and fragment shaders, the
qualifiers must match.
BUG=angleproject:1893
TEST=dEQP-GLES31.functional.layout_binding.*binding_contradictory*
Change-Id: I0ae6a1a8967df818be8136510c22daee848b9da7
Reviewed-on: https://chromium-review.googlesource.com/447557
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/VariableInfo.cpp b/src/compiler/translator/VariableInfo.cpp
index 5b7a759..b4f2eaa 100644
--- a/src/compiler/translator/VariableInfo.cpp
+++ b/src/compiler/translator/VariableInfo.cpp
@@ -569,6 +569,7 @@
{
Uniform uniform;
setCommonVariableProperties(variable.getType(), variable.getSymbol(), &uniform);
+ uniform.binding = variable.getType().getLayoutQualifier().binding;
return uniform;
}