diff --git a/.pick_status.json b/.pick_status.json index eab0f632d0d..5414f7d595e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -414,7 +414,7 @@ "description": "i915: fix i915_set_vertex_buffers() related refcnt imbalance and remove redundancies", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0278d1fa323cf1f289a2c5f4cd803c4203d4a48a", "notes": null diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index f9ecb6c5c09..826c5c6b538 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -78,14 +78,14 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, /* * Map vertex buffers */ - for (i = 0; i < i915->nr_vertex_buffers; i++) { - const void *buf = i915->vertex_buffers[i].is_user_buffer - ? i915->vertex_buffers[i].buffer.user + for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { + const void *buf = draw->pt.vertex_buffer[i].is_user_buffer + ? draw->pt.vertex_buffer[i].buffer.user : NULL; if (!buf) { - if (!i915->vertex_buffers[i].buffer.resource) + if (!draw->pt.vertex_buffer[i].buffer.resource) continue; - buf = i915_buffer(i915->vertex_buffers[i].buffer.resource)->data; + buf = i915_buffer(draw->pt.vertex_buffer[i].buffer.resource)->data; } draw_set_mapped_vertex_buffer(draw, i, buf, ~0); } @@ -112,13 +112,13 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, /* * Do the drawing */ - draw_vbo(i915->draw, info, drawid_offset, NULL, draws, num_draws, 0); + draw_vbo(draw, info, drawid_offset, NULL, draws, num_draws, 0); /* * unmap vertex/index buffers */ - for (i = 0; i < i915->nr_vertex_buffers; i++) { - draw_set_mapped_vertex_buffer(i915->draw, i, NULL, 0); + for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { + draw_set_mapped_vertex_buffer(draw, i, NULL, 0); } if (mapped_indices) draw_set_indexes(draw, NULL, 0, 0); @@ -127,7 +127,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, * Instead of flushing on every state change, we flush once here * when we fire the vbo. */ - draw_flush(i915->draw); + draw_flush(draw); } /* diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index 12062ad9741..b0a7b7330ab 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -32,6 +32,7 @@ #include "pipe/p_defines.h" #include "pipe/p_state.h" +#include "draw/draw_private.h" #include "draw/draw_vertex.h" #include "tgsi/tgsi_scan.h" @@ -272,8 +273,6 @@ struct i915_context { void *vs; struct i915_velems_state *velems; - unsigned nr_vertex_buffers; - struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS]; struct pipe_blend_color blend_color; struct pipe_stencil_ref stencil_ref; diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index b12cf3dac1e..95965dc571b 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -1012,11 +1012,11 @@ i915_set_vertex_buffers(struct pipe_context *pipe, unsigned count, struct i915_context *i915 = i915_context(pipe); struct draw_context *draw = i915->draw; - util_set_vertex_buffers_count(i915->vertex_buffers, &i915->nr_vertex_buffers, - buffers, count, true); + assert(count <= PIPE_MAX_ATTRIBS); - /* pass-through to draw module */ - draw_set_vertex_buffers(draw, count, buffers); + util_set_vertex_buffers_count(draw->pt.vertex_buffer, + &draw->pt.nr_vertex_buffers, buffers, count, + true); } static void * diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index f0275af7bbf..1c123561cc6 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -60,8 +60,8 @@ i915_util_blitter_save_states(struct i915_context *i915) util_blitter_save_viewport(i915->blitter, &i915->viewport); util_blitter_save_scissor(i915->blitter, &i915->scissor); util_blitter_save_vertex_elements(i915->blitter, i915->velems); - util_blitter_save_vertex_buffers(i915->blitter, i915->vertex_buffers, - i915->nr_vertex_buffers); + util_blitter_save_vertex_buffers(i915->blitter, i915->draw->pt.vertex_buffer, + i915->draw->pt.nr_vertex_buffers); util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);