vbo/dlist: only use merged primitives when it's ok to do so

Merging primitives generates incorrect gl_PrimitiveID[In] values.
So make merged primitives construction non-destructive and fallback
to drawing with original primitives if a program reads gl_PrimitiveId.

This commit adds _mesa_update_primitive_id_is_unused modeled after
_mesa_update_allow_draw_out_of_order to update ctx->_PrimitiveIDIsUnused
each time shaders are updated.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7078>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2020-10-20 10:57:04 +02:00
parent 1c016a5ba0
commit ebb228bec5
9 changed files with 113 additions and 41 deletions

View File

@@ -1294,6 +1294,7 @@ _mesa_initialize_context(struct gl_context *ctx,
}
ctx->FirstTimeCurrent = GL_TRUE;
ctx->_PrimitiveIDIsUnused = true;
return GL_TRUE;