Commit 55d611e7 by Jamie Madill

Fix ASSERT failure in XFB test.

With the invariant handling changes, we're also exporting gl_Position and other builtin variables from the translator where we were not previously. This was causing an assert in the XFB code, where we would inadvertently assign a register to gl_Position, and trip up logic further in the varying handling logic. BUG=angle:808 Change-Id: I674902da75c572e969f9516033a85c7a7170d7d1 Reviewed-on: https://chromium-review.googlesource.com/225261Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 39eab03f
......@@ -262,6 +262,13 @@ int DynamicHLSL::packVaryings(InfoLog &infoLog, VaryingPacking packing, rx::Shad
for (unsigned int feedbackVaryingIndex = 0; feedbackVaryingIndex < transformFeedbackVaryings.size(); feedbackVaryingIndex++)
{
const std::string &transformFeedbackVarying = transformFeedbackVaryings[feedbackVaryingIndex];
if (transformFeedbackVarying == "gl_Position" || transformFeedbackVarying == "gl_PointSize")
{
// do not pack builtin XFB varyings
continue;
}
if (packedVaryings.find(transformFeedbackVarying) == packedVaryings.end())
{
bool found = false;
......@@ -281,7 +288,7 @@ int DynamicHLSL::packVaryings(InfoLog &infoLog, VaryingPacking packing, rx::Shad
}
}
if (!found && transformFeedbackVarying != "gl_Position" && transformFeedbackVarying != "gl_PointSize")
if (!found)
{
infoLog.append("Transform feedback varying %s does not exist in the vertex shader.", transformFeedbackVarying.c_str());
return -1;
......
......@@ -153,7 +153,7 @@ void ShaderD3D::releaseCompiler()
void ShaderD3D::parseVaryings(void *compiler)
{
if (!mHlsl.empty())
if (!mHlsl.empty())
{
const std::vector<sh::Varying> *varyings = ShGetVaryings(compiler);
ASSERT(varyings);
......
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