Commit ee09b58e by Geoff Lang

Notify the VertexArrayImpl when a buffer is detached.

Update VertexArrayGL to clear it's cached buffer binding when a buffer is detached to prevent name aliasing. Fixes: * DEQP standalone crashes. * WebGL Conformance DEQP tests. Change-Id: If21a617629e15873ddeae0368b5399616f2ca68b Reviewed-on: https://chromium-review.googlesource.com/278050Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent c41fd050
...@@ -44,13 +44,15 @@ void VertexArray::detachBuffer(GLuint bufferName) ...@@ -44,13 +44,15 @@ void VertexArray::detachBuffer(GLuint bufferName)
{ {
if (mVertexAttributes[attribute].buffer.id() == bufferName) if (mVertexAttributes[attribute].buffer.id() == bufferName)
{ {
mVertexAttributes[attribute].buffer.set(NULL); mVertexAttributes[attribute].buffer.set(nullptr);
mVertexArray->setAttribute(attribute, mVertexAttributes[attribute]);
} }
} }
if (mElementArrayBuffer.id() == bufferName) if (mElementArrayBuffer.id() == bufferName)
{ {
mElementArrayBuffer.set(NULL); mElementArrayBuffer.set(nullptr);
mVertexArray->setElementArrayBuffer(nullptr);
} }
} }
......
...@@ -74,6 +74,13 @@ VertexArrayGL::~VertexArrayGL() ...@@ -74,6 +74,13 @@ VertexArrayGL::~VertexArrayGL()
void VertexArrayGL::setElementArrayBuffer(const gl::Buffer *buffer) void VertexArrayGL::setElementArrayBuffer(const gl::Buffer *buffer)
{ {
mElementArrayBuffer.set(buffer); mElementArrayBuffer.set(buffer);
// If the buffer is being unbound/deleted, reset the currently applied buffer ID
// so that even if a new buffer is generated with the same ID, it will be re-bound.
if (buffer == nullptr && mAppliedElementArrayBuffer != mStreamingElementArrayBuffer)
{
mAppliedElementArrayBuffer = 0;
}
} }
void VertexArrayGL::setAttribute(size_t idx, const gl::VertexAttribute &attr) void VertexArrayGL::setAttribute(size_t idx, const gl::VertexAttribute &attr)
......
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