mesa: Introduce a yet unused _DrawVAO.

During the patch series this VAO gets populated with either the currently
bound VAO or an internal VAO that will be used for immediate mode and
dlist rendering.

v2: More comments about the _DrawVAO, filter and enabled mask.
    Rename _DrawVAOEnabled to _DrawVAOEnabledAttribs.
v3: Fix and move comment.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Mathias Fröhlich
2016-08-24 08:45:05 +02:00
parent ce3d2421a0
commit 08c7474189
7 changed files with 69 additions and 0 deletions

View File

@@ -49,6 +49,7 @@
#include "arrayobj.h"
#include "macros.h"
#include "mtypes.h"
#include "state.h"
#include "varray.h"
#include "main/dispatch.h"
#include "util/bitscan.h"
@@ -578,6 +579,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, bool no_error)
* deleted.
*/
_mesa_set_drawing_arrays(ctx, NULL);
_mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
ctx->NewState |= _NEW_ARRAY;
_mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
@@ -629,6 +631,8 @@ delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids)
if (ctx->Array.LastLookedUpVAO == obj)
_mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, NULL);
if (ctx->Array._DrawVAO == obj)
_mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
/* Unreference the array object.
* If refcount hits zero, the object will be deleted.