Commit e9cc469f by Jamie Madill

Accept mismatching auxiliary interpolations.

The ES3.1 spec, and discussion on Khronos.org, confirm that dEQP is correct in accepting mismatching centroid specifiers in shader linkage. Mismatching flat/smooth is still a link error. Fixes: shaders.linkage.varying.rules.differing_interpolation_2 Change-Id: I3016f4147e7c1b16b02371ee95866c8daf826212 Reviewed-on: https://chromium-review.googlesource.com/251205Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a2643b64
......@@ -28,6 +28,9 @@ enum InterpolationType
INTERPOLATION_FLAT
};
// Validate link & SSO consistency of interpolation qualifiers
COMPILER_EXPORT bool InterpolationTypesMatch(InterpolationType a, InterpolationType b);
// Uniform block layout qualifier, see section 4.3.8.3 of the ESSL 3.00.4 spec
enum BlockLayoutType
{
......
......@@ -14,6 +14,23 @@
namespace sh
{
namespace
{
InterpolationType GetNonAuxiliaryInterpolationType(InterpolationType interpolation)
{
return (interpolation == INTERPOLATION_CENTROID ? INTERPOLATION_SMOOTH : interpolation);
}
}
// The ES 3.0 spec is not clear on this point, but the ES 3.1 spec, and discussion
// on Khronos.org, clarifies that a smooth/flat mismatch produces a link error,
// but auxiliary qualifier mismatch (centroid) does not.
bool InterpolationTypesMatch(InterpolationType a, InterpolationType b)
{
return (GetNonAuxiliaryInterpolationType(a) == GetNonAuxiliaryInterpolationType(b));
}
ShaderVariable::ShaderVariable()
: type(0),
precision(0),
......
......@@ -1543,7 +1543,7 @@ bool Program::linkValidateVaryings(InfoLog &infoLog, const std::string &varyingN
return false;
}
if (vertexVarying.interpolation != fragmentVarying.interpolation)
if (!sh::InterpolationTypesMatch(vertexVarying.interpolation, fragmentVarying.interpolation))
{
infoLog.append("Interpolation types for %s differ between vertex and fragment shaders", varyingName.c_str());
return false;
......
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