diff options
author | Marek Olšák <[email protected]> | 2020-03-21 22:49:03 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-04-06 10:28:53 -0400 |
commit | f3cce7087a562f77be7306e70d4e62bc214bb5fa (patch) | |
tree | 1d5f93dc13deb0e7822a9296a4b48f61442ec665 /src/mesa/main/attrib.c | |
parent | e630271e0ec3eee7d921d76d3924873f6ee6b59b (diff) |
mesa: don't ever bind NullBufferObj for glBindBuffer targets
Since VAOs don't use NullBufferObj for vertex attribs anymore, let's remove
more uses of NullBufferObj.
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r-- | src/mesa/main/attrib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index ce6c519737f..f84844ccea2 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1666,21 +1666,24 @@ restore_array_attrib(struct gl_context *ctx, _mesa_BindVertexArray(src->VAO->Name); /* Restore or recreate the buffer objects by the names ... */ - if (is_vao_name_zero || src->ArrayBufferObj->Name == 0 || + if (is_vao_name_zero || !src->ArrayBufferObj || _mesa_IsBuffer(src->ArrayBufferObj->Name)) { /* ... and restore its content */ copy_array_attrib(ctx, dest, src, false); _mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, - src->ArrayBufferObj->Name); + src->ArrayBufferObj ? + src->ArrayBufferObj->Name : 0); } else { copy_array_attrib(ctx, dest, src, true); } - if (is_vao_name_zero || src->VAO->IndexBufferObj->Name == 0 || - _mesa_IsBuffer(src->VAO->IndexBufferObj->Name)) + if (is_vao_name_zero || !src->VAO->IndexBufferObj || + _mesa_IsBuffer(src->VAO->IndexBufferObj->Name)) { _mesa_BindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, - src->VAO->IndexBufferObj->Name); + src->VAO->IndexBufferObj ? + src->VAO->IndexBufferObj->Name : 0); + } } /** |