vbo: utilize structure padding to optimize indirection cold->prims[0].begin

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13589>
This commit is contained in:
Marek Olšák 2021-10-29 03:09:47 -04:00 committed by Marge Bot
parent 3f997bccc6
commit a0dc303b45
3 changed files with 4 additions and 2 deletions

View File

@ -64,6 +64,7 @@ struct vbo_save_vertex_list {
struct pipe_draw_start_count_bias start_count;
};
uint8_t mode;
bool draw_begins;
int16_t private_refcount[VP_MODE_MAX];
struct gl_context *ctx;

View File

@ -874,6 +874,7 @@ compile_vertex_list(struct gl_context *ctx)
free(merged_prims);
end:
node->draw_begins = node->cold->prims[0].begin;
if (!save->current_bo) {
save->current_bo = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID + 1);

View File

@ -166,7 +166,7 @@ vbo_save_playback_vertex_list_loopback(struct gl_context *ctx, void *data)
FLUSH_FOR_DRAW(ctx);
if (_mesa_inside_begin_end(ctx) && node->cold->prims[0].begin) {
if (_mesa_inside_begin_end(ctx) && node->draw_begins) {
/* Error: we're about to begin a new primitive but we're already
* inside a glBegin/End pair.
*/
@ -304,7 +304,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data, bool copy_to_c
FLUSH_FOR_DRAW(ctx);
if (_mesa_inside_begin_end(ctx) && node->cold->prims[0].begin) {
if (_mesa_inside_begin_end(ctx) && node->draw_begins) {
/* Error: we're about to begin a new primitive but we're already
* inside a glBegin/End pair.
*/