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/gallium/auxiliary/util | |
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/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_blit.c | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 22 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.h | 7 |
3 files changed, 14 insertions, 20 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index d1571cd1f56..9a43c2f6556 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -112,7 +112,7 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) for (i = 0; i < 2; i++) { ctx->velem[i].src_offset = i * 4 * sizeof(float); ctx->velem[i].instance_divisor = 0; - ctx->velem[i].vertex_buffer_index = cso_get_aux_vertex_buffer_slot(cso); + ctx->velem[i].vertex_buffer_index = 0; ctx->velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; } @@ -631,8 +631,7 @@ util_blit_pixels_tex(struct blit_state *ctx, s0, t0, s1, t1, z); - util_draw_vertex_buffer(ctx->pipe, ctx->cso, ctx->vbuf, - cso_get_aux_vertex_buffer_slot(ctx->cso), + util_draw_vertex_buffer(ctx->pipe, ctx->cso, ctx->vbuf, 0, offset, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 8a680d60a68..42f37c75742 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -154,8 +154,7 @@ struct u_vbuf { uint32_t enabled_vb_mask; /* Saved vertex buffer. */ - unsigned aux_vertex_buffer_slot; - struct pipe_vertex_buffer aux_vertex_buffer_saved; + struct pipe_vertex_buffer vertex_buffer0_saved; /* Vertex buffers for the driver. * There are usually no user buffers. */ @@ -300,13 +299,11 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, } struct u_vbuf * -u_vbuf_create(struct pipe_context *pipe, - struct u_vbuf_caps *caps, unsigned aux_vertex_buffer_index) +u_vbuf_create(struct pipe_context *pipe, struct u_vbuf_caps *caps) { struct u_vbuf *mgr = CALLOC_STRUCT(u_vbuf); mgr->caps = *caps; - mgr->aux_vertex_buffer_slot = aux_vertex_buffer_index; mgr->pipe = pipe; mgr->cso_cache = cso_cache_create(); mgr->translate_cache = translate_cache_create(); @@ -381,7 +378,7 @@ void u_vbuf_destroy(struct u_vbuf *mgr) for (i = 0; i < PIPE_MAX_ATTRIBS; i++) pipe_vertex_buffer_unreference(&mgr->real_vertex_buffer[i]); - pipe_vertex_buffer_unreference(&mgr->aux_vertex_buffer_saved); + pipe_vertex_buffer_unreference(&mgr->vertex_buffer0_saved); translate_cache_destroy(mgr->translate_cache); cso_cache_delete(mgr->cso_cache); @@ -1313,15 +1310,14 @@ void u_vbuf_restore_vertex_elements(struct u_vbuf *mgr) mgr->ve_saved = NULL; } -void u_vbuf_save_aux_vertex_buffer_slot(struct u_vbuf *mgr) +void u_vbuf_save_vertex_buffer0(struct u_vbuf *mgr) { - pipe_vertex_buffer_reference(&mgr->aux_vertex_buffer_saved, - &mgr->vertex_buffer[mgr->aux_vertex_buffer_slot]); + pipe_vertex_buffer_reference(&mgr->vertex_buffer0_saved, + &mgr->vertex_buffer[0]); } -void u_vbuf_restore_aux_vertex_buffer_slot(struct u_vbuf *mgr) +void u_vbuf_restore_vertex_buffer0(struct u_vbuf *mgr) { - u_vbuf_set_vertex_buffers(mgr, mgr->aux_vertex_buffer_slot, 1, - &mgr->aux_vertex_buffer_saved); - pipe_vertex_buffer_unreference(&mgr->aux_vertex_buffer_saved); + u_vbuf_set_vertex_buffers(mgr, 0, 1, &mgr->vertex_buffer0_saved); + pipe_vertex_buffer_unreference(&mgr->vertex_buffer0_saved); } diff --git a/src/gallium/auxiliary/util/u_vbuf.h b/src/gallium/auxiliary/util/u_vbuf.h index d0704524561..a6139834575 100644 --- a/src/gallium/auxiliary/util/u_vbuf.h +++ b/src/gallium/auxiliary/util/u_vbuf.h @@ -61,8 +61,7 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, unsigned flags); struct u_vbuf * -u_vbuf_create(struct pipe_context *pipe, - struct u_vbuf_caps *caps, unsigned aux_vertex_buffer_index); +u_vbuf_create(struct pipe_context *pipe, struct u_vbuf_caps *caps); void u_vbuf_destroy(struct u_vbuf *mgr); @@ -77,7 +76,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info); /* Save/restore functionality. */ void u_vbuf_save_vertex_elements(struct u_vbuf *mgr); void u_vbuf_restore_vertex_elements(struct u_vbuf *mgr); -void u_vbuf_save_aux_vertex_buffer_slot(struct u_vbuf *mgr); -void u_vbuf_restore_aux_vertex_buffer_slot(struct u_vbuf *mgr); +void u_vbuf_save_vertex_buffer0(struct u_vbuf *mgr); +void u_vbuf_restore_vertex_buffer0(struct u_vbuf *mgr); #endif |