summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-03-29 17:51:50 +0200
committerMarek Olšák <[email protected]>2012-10-31 00:55:13 +0100
commite73bf3b805de78299f1a652668ba4e6eab9bac94 (patch)
tree11839d343c6aad3a8fb5c594cadf961288adbea0 /src/gallium/auxiliary/vl
parenta7c5be098aee3a8228cbd95558bac29cb7ff6a3d (diff)
gallium: add start_slot parameter to set_vertex_buffers
This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_matrix_filter.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_median_filter.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c6
4 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 0cb1a9f38ad..7ea13bf593d 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -1013,7 +1013,7 @@ vl_compositor_render(struct vl_compositor_state *s,
c->pipe->set_scissor_state(c->pipe, &s->scissor);
c->pipe->set_framebuffer_state(c->pipe, &c->fb_state);
c->pipe->bind_vs_state(c->pipe, c->vs);
- c->pipe->set_vertex_buffers(c->pipe, 1, &c->vertex_buf);
+ c->pipe->set_vertex_buffers(c->pipe, 0, 1, &c->vertex_buf);
c->pipe->bind_vertex_elements_state(c->pipe, c->vertex_elems_state);
pipe_set_constant_buffer(c->pipe, PIPE_SHADER_FRAGMENT, 0, s->csc_matrix);
c->pipe->bind_rasterizer_state(c->pipe, c->rast);
diff --git a/src/gallium/auxiliary/vl/vl_matrix_filter.c b/src/gallium/auxiliary/vl/vl_matrix_filter.c
index 333fcc8f813..438bedab226 100644
--- a/src/gallium/auxiliary/vl/vl_matrix_filter.c
+++ b/src/gallium/auxiliary/vl/vl_matrix_filter.c
@@ -311,7 +311,7 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter,
filter->pipe->bind_fs_state(filter->pipe, filter->fs);
filter->pipe->set_framebuffer_state(filter->pipe, &fb_state);
filter->pipe->set_viewport_state(filter->pipe, &viewport);
- filter->pipe->set_vertex_buffers(filter->pipe, 1, &filter->quad);
+ filter->pipe->set_vertex_buffers(filter->pipe, 0, 1, &filter->quad);
filter->pipe->bind_vertex_elements_state(filter->pipe, filter->ves);
util_draw_arrays(filter->pipe, PIPE_PRIM_QUADS, 0, 4);
diff --git a/src/gallium/auxiliary/vl/vl_median_filter.c b/src/gallium/auxiliary/vl/vl_median_filter.c
index 5770ff8258a..dfa280a6d2a 100644
--- a/src/gallium/auxiliary/vl/vl_median_filter.c
+++ b/src/gallium/auxiliary/vl/vl_median_filter.c
@@ -390,7 +390,7 @@ vl_median_filter_render(struct vl_median_filter *filter,
filter->pipe->bind_fs_state(filter->pipe, filter->fs);
filter->pipe->set_framebuffer_state(filter->pipe, &fb_state);
filter->pipe->set_viewport_state(filter->pipe, &viewport);
- filter->pipe->set_vertex_buffers(filter->pipe, 1, &filter->quad);
+ filter->pipe->set_vertex_buffers(filter->pipe, 0, 1, &filter->quad);
filter->pipe->bind_vertex_elements_state(filter->pipe, filter->ves);
util_draw_arrays(filter->pipe, PIPE_PRIM_QUADS, 0, 4);
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 4614c8abd37..eb82b95bb4c 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -711,7 +711,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
if (!ref_frames[j] || !ref_frames[j][i]) continue;
vb[2] = vl_vb_get_mv(&buf->vertex_stream, j);;
- dec->base.context->set_vertex_buffers(dec->base.context, 3, vb);
+ dec->base.context->set_vertex_buffers(dec->base.context, 0, 3, vb);
vl_mc_render_ref(i ? &dec->mc_c : &dec->mc_y, &buf->mc[i], ref_frames[j][i]);
}
@@ -722,7 +722,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
if (!buf->num_ycbcr_blocks[i]) continue;
vb[1] = vl_vb_get_ycbcr(&buf->vertex_stream, i);
- dec->base.context->set_vertex_buffers(dec->base.context, 2, vb);
+ dec->base.context->set_vertex_buffers(dec->base.context, 0, 2, vb);
vl_zscan_render(i ? &dec->zscan_c : & dec->zscan_y, &buf->zscan[i] , buf->num_ycbcr_blocks[i]);
@@ -741,7 +741,7 @@ vl_mpeg12_end_frame(struct pipe_video_decoder *decoder,
if (!buf->num_ycbcr_blocks[plane]) continue;
vb[1] = vl_vb_get_ycbcr(&buf->vertex_stream, plane);
- dec->base.context->set_vertex_buffers(dec->base.context, 2, vb);
+ dec->base.context->set_vertex_buffers(dec->base.context, 0, 2, vb);
if (dec->base.entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT)
vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[plane]);