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:
parent
3f997bccc6
commit
a0dc303b45
|
@ -64,6 +64,7 @@ struct vbo_save_vertex_list {
|
||||||
struct pipe_draw_start_count_bias start_count;
|
struct pipe_draw_start_count_bias start_count;
|
||||||
};
|
};
|
||||||
uint8_t mode;
|
uint8_t mode;
|
||||||
|
bool draw_begins;
|
||||||
|
|
||||||
int16_t private_refcount[VP_MODE_MAX];
|
int16_t private_refcount[VP_MODE_MAX];
|
||||||
struct gl_context *ctx;
|
struct gl_context *ctx;
|
||||||
|
|
|
@ -874,6 +874,7 @@ compile_vertex_list(struct gl_context *ctx)
|
||||||
free(merged_prims);
|
free(merged_prims);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
node->draw_begins = node->cold->prims[0].begin;
|
||||||
|
|
||||||
if (!save->current_bo) {
|
if (!save->current_bo) {
|
||||||
save->current_bo = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID + 1);
|
save->current_bo = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID + 1);
|
||||||
|
|
|
@ -166,7 +166,7 @@ vbo_save_playback_vertex_list_loopback(struct gl_context *ctx, void *data)
|
||||||
|
|
||||||
FLUSH_FOR_DRAW(ctx);
|
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
|
/* Error: we're about to begin a new primitive but we're already
|
||||||
* inside a glBegin/End pair.
|
* 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);
|
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
|
/* Error: we're about to begin a new primitive but we're already
|
||||||
* inside a glBegin/End pair.
|
* inside a glBegin/End pair.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue