Commit 743913c1 by Alexis Hetu Committed by Alexis Hétu

Varying interpolation qualifier check

Made sure varyings had the same interpolation qualifier in fragment shader and vertex shader (either both flat or both smooth ). Fixes: dEQP-GLES3.functional.shaders.linkage.varying.rules.interpolation_mismatch_1 Change-Id: I7f68490dc19a3365e492b666acda6f5db91d10ab Reviewed-on: https://swiftshader-review.googlesource.com/15768Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent da163edb
......@@ -2921,7 +2921,7 @@ namespace glsl
}
}
activeVaryings.push_back(glsl::Varying(glVariableType(type), name, type.getArraySize(), registerIndex, 0));
activeVaryings.push_back(glsl::Varying(glVariableType(type), name, type.getArraySize(), type.getQualifier(), registerIndex, 0));
}
}
......
......@@ -152,8 +152,8 @@ namespace glsl
struct Varying
{
Varying(GLenum type, const std::string &name, int arraySize, int reg = -1, int col = -1)
: type(type), name(name), arraySize(arraySize), reg(reg), col(col)
Varying(GLenum type, const std::string &name, int arraySize, TQualifier qualifier, int reg = -1, int col = -1)
: type(type), name(name), arraySize(arraySize), qualifier(qualifier), reg(reg), col(col)
{
}
......@@ -170,6 +170,7 @@ namespace glsl
GLenum type;
std::string name;
int arraySize;
TQualifier qualifier;
int reg; // First varying register, assigned during link
int col; // First register element, assigned during link
......
......@@ -1330,6 +1330,13 @@ namespace es2
return false;
}
if((output.qualifier == EvqFlatOut) ^ (input.qualifier == EvqFlatIn))
{
appendToInfoLog("Interpolation qualifiers for %s differ between vertex and fragment shaders", output.name.c_str());
return false;
}
matched = true;
break;
}
......
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