vbo: Move no_current_update out of _mesa_prim.

The _mesa_prim::no_current_update flag should tell the compiled
display list if the current attributes that are placed in the dlists
vbo shall take a defined state past replay of a display list.
Immediate mode draws compiled into display lists should set the
current values. Array draws may leave the current values in
undefined state.
So finally this flag is not a property of every primitive
but it is a property of the compiled display list and there it
is a property of the last primitive compiled into the list.
So move the flag out of _mesa_prim into vbo_save.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
Mathias Fröhlich 2018-10-29 06:13:19 +01:00
parent eae4ee9419
commit b899f5e59c
4 changed files with 9 additions and 8 deletions

View File

@ -46,9 +46,8 @@ struct _mesa_prim
GLuint indexed:1;
GLuint begin:1;
GLuint end:1;
GLuint no_current_update:1;
GLuint is_indirect:1;
GLuint pad:19;
GLuint pad:20;
GLuint start;
GLuint count;

View File

@ -47,6 +47,8 @@ void vbo_save_init( struct gl_context *ctx )
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
save->VAO[vpm] = NULL;
save->no_current_update = false;
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
}

View File

@ -173,6 +173,8 @@ struct vbo_save_context {
struct _mesa_prim *prims;
GLuint prim_count, prim_max;
bool no_current_update;
struct vbo_save_vertex_store *vertex_store;
struct vbo_save_primitive_store *prim_store;

View File

@ -602,7 +602,7 @@ compile_vertex_list(struct gl_context *ctx)
node->prim_store->refcount++;
if (node->prims[0].no_current_update) {
if (save->no_current_update) {
node->current_data = NULL;
}
else {
@ -720,7 +720,6 @@ wrap_buffers(struct gl_context *ctx)
struct vbo_save_context *save = &vbo_context(ctx)->save;
GLint i = save->prim_count - 1;
GLenum mode;
GLboolean no_current_update;
assert(i < (GLint) save->prim_max);
assert(i >= 0);
@ -729,7 +728,6 @@ wrap_buffers(struct gl_context *ctx)
*/
save->prims[i].count = (save->vert_count - save->prims[i].start);
mode = save->prims[i].mode;
no_current_update = save->prims[i].no_current_update;
/* store the copied vertices, and allocate a new list.
*/
@ -738,7 +736,6 @@ wrap_buffers(struct gl_context *ctx)
/* Restart interrupted primitive
*/
save->prims[0].mode = mode;
save->prims[0].no_current_update = no_current_update;
save->prims[0].begin = 0;
save->prims[0].end = 0;
save->prims[0].pad = 0;
@ -1205,8 +1202,6 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK;
save->prims[i].begin = 1;
save->prims[i].end = 0;
save->prims[i].no_current_update =
(mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
save->prims[i].pad = 0;
save->prims[i].start = save->vert_count;
save->prims[i].count = 0;
@ -1214,6 +1209,9 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].base_instance = 0;
save->prims[i].is_indirect = 0;
save->no_current_update =
(mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
if (save->out_of_memory) {
_mesa_install_save_vtxfmt(ctx, &save->vtxfmt_noop);
}