diff options
author | Marek Olšák <[email protected]> | 2018-05-08 17:31:46 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-05-12 21:08:09 -0400 |
commit | 86d63b53a20a747e3de769549572d895c7fbb736 (patch) | |
tree | 0b4aa27d8a617070daa5894a6cf9577b193758f3 /src/mesa | |
parent | ce188813bfe63068119cbf3d0f76e1ea3d27b722 (diff) |
gallium: remove aux_vertex_buffer_slot code
The slot index is always 0, and is pretty unlikely to change in the future.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 5 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawtex.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 15 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 10 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_pbo.c | 2 |
5 files changed, 7 insertions, 28 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index b25ae5f80eb..1bfc82db43e 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -774,10 +774,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx, u_upload_unmap(pipe->stream_uploader); - cso_set_vertex_buffers(st->cso_context, - cso_get_aux_vertex_buffer_slot(st->cso_context), - 1, &vb); - + cso_set_vertex_buffers(st->cso_context, 0, 1, &vb); cso_draw_arrays(st->cso_context, PIPE_PRIM_QUADS, 0, num_verts); out: diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index f18925ecfe6..b6bf71d4cd1 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -276,8 +276,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, cso_set_viewport(cso, &vp); } - util_draw_vertex_buffer(pipe, cso, vbuffer, - cso_get_aux_vertex_buffer_slot(cso), + util_draw_vertex_buffer(pipe, cso, vbuffer, 0, offset, /* offset */ PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 061b8b9c4c2..50c8b2e6549 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -395,26 +395,17 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, /* Setup vertex element info for 'struct st_util_vertex'. */ { - const unsigned slot = cso_get_aux_vertex_buffer_slot(st->cso_context); - - /* If this assertion ever fails all state tracker calls to - * cso_get_aux_vertex_buffer_slot() should be audited. This - * particular call would have to be moved to just before each - * drawing call. - */ - assert(slot == 0); - STATIC_ASSERT(sizeof(struct st_util_vertex) == 9 * sizeof(float)); memset(&st->util_velems, 0, sizeof(st->util_velems)); st->util_velems[0].src_offset = 0; - st->util_velems[0].vertex_buffer_index = slot; + st->util_velems[0].vertex_buffer_index = 0; st->util_velems[0].src_format = PIPE_FORMAT_R32G32B32_FLOAT; st->util_velems[1].src_offset = 3 * sizeof(float); - st->util_velems[1].vertex_buffer_index = slot; + st->util_velems[1].vertex_buffer_index = 0; st->util_velems[1].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; st->util_velems[2].src_offset = 7 * sizeof(float); - st->util_velems[2].vertex_buffer_index = slot; + st->util_velems[2].vertex_buffer_index = 0; st->util_velems[2].src_format = PIPE_FORMAT_R32G32_FLOAT; } diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 12cae85f408..208ea735a78 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -419,15 +419,7 @@ st_draw_quad(struct st_context *st, u_upload_unmap(st->pipe->stream_uploader); - /* At the time of writing, cso_get_aux_vertex_buffer_slot() always returns - * zero. If that ever changes we need to audit the calls to that function - * and make sure the slot number is used consistently everywhere. - */ - assert(cso_get_aux_vertex_buffer_slot(st->cso_context) == 0); - - cso_set_vertex_buffers(st->cso_context, - cso_get_aux_vertex_buffer_slot(st->cso_context), - 1, &vb); + cso_set_vertex_buffers(st->cso_context, 0, 1, &vb); if (num_instances > 1) { cso_draw_arrays_instanced(st->cso_context, PIPE_PRIM_TRIANGLE_FAN, 0, 4, diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c index 628e3ca64a5..6c55e85f069 100644 --- a/src/mesa/state_tracker/st_pbo.c +++ b/src/mesa/state_tracker/st_pbo.c @@ -245,7 +245,7 @@ st_pbo_draw(struct st_context *st, const struct st_pbo_addresses *addr, velem.src_offset = 0; velem.instance_divisor = 0; - velem.vertex_buffer_index = cso_get_aux_vertex_buffer_slot(cso); + velem.vertex_buffer_index = 0; velem.src_format = PIPE_FORMAT_R32G32_FLOAT; cso_set_vertex_elements(cso, 1, &velem); |