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/225261
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp b/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
index 13411eb..daf73f2 100644
--- a/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
+++ b/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
@@ -262,6 +262,13 @@
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 @@
}
}
- 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;