Commit 8314465d by Corentin Wallez Committed by Commit Bot

GL backend: add a workaround for bad default current vertex attributes

BUG=angleproject:1492 BUG=351528 Change-Id: Ie4b25b0106282c9f60d19053e5a320549887bc8b Reviewed-on: https://chromium-review.googlesource.com/379196Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent a4e6f074
...@@ -137,6 +137,17 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at ...@@ -137,6 +137,17 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at
{ {
mSkipDrawCalls = true; mSkipDrawCalls = true;
} }
if (mWorkarounds.initializeCurrentVertexAttributes)
{
GLint maxVertexAttribs = 0;
mFunctions->getIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
for (GLint i = 0; i < maxVertexAttribs; ++i)
{
mFunctions->vertexAttrib4f(i, 0.0f, 0.0f, 0.0f, 1.0f);
}
}
} }
RendererGL::~RendererGL() RendererGL::~RendererGL()
......
...@@ -67,6 +67,9 @@ struct WorkaroundsGL ...@@ -67,6 +67,9 @@ struct WorkaroundsGL
// In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row. // In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row.
bool unpackOverlappingRowsSeparatelyUnpackBuffer; bool unpackOverlappingRowsSeparatelyUnpackBuffer;
// During initialization, assign the current vertex attributes to the spec-mandated defaults.
bool initializeCurrentVertexAttributes;
}; };
} }
......
...@@ -896,6 +896,8 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround ...@@ -896,6 +896,8 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround
workarounds->alwaysCallUseProgramAfterLink = true; workarounds->alwaysCallUseProgramAfterLink = true;
workarounds->unpackOverlappingRowsSeparatelyUnpackBuffer = vendor == VENDOR_ID_NVIDIA; workarounds->unpackOverlappingRowsSeparatelyUnpackBuffer = vendor == VENDOR_ID_NVIDIA;
workarounds->initializeCurrentVertexAttributes = vendor == VENDOR_ID_NVIDIA;
} }
} }
......
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