gallium: add start_slot parameter to set_vertex_buffers
authorMarek Olšák <maraeo@gmail.com>
Thu, 29 Mar 2012 15:51:50 +0000 (17:51 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 30 Oct 2012 23:55:13 +0000 (00:55 +0100)
commite73bf3b805de78299f1a652668ba4e6eab9bac94
tree11839d343c6aad3a8fb5c594cadf961288adbea0
parenta7c5be098aee3a8228cbd95558bac29cb7ff6a3d
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 <brianp@vmware.com>
78 files changed:
src/gallium/auxiliary/Makefile.sources
src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/cso_cache/cso_context.h
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_context.h
src/gallium/auxiliary/postprocess/pp_run.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/auxiliary/util/u_draw_quad.c
src/gallium/auxiliary/util/u_draw_quad.h
src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_helpers.c [new file with mode: 0644]
src/gallium/auxiliary/util/u_helpers.h [new file with mode: 0644]
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_math.h
src/gallium/auxiliary/util/u_vbuf.c
src/gallium/auxiliary/util/u_vbuf.h
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_matrix_filter.c
src/gallium/auxiliary/vl/vl_median_filter.c
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/drivers/galahad/glhd_context.c
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/i915/i915_surface.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_draw_arrays.c
src/gallium/drivers/llvmpipe/lp_state_vertex.c
src/gallium/drivers/llvmpipe/lp_surface.c
src/gallium/drivers/noop/noop_state.c
src/gallium/drivers/nv30/nv30_draw.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_push.c
src/gallium/drivers/nv30/nv30_state.c
src/gallium/drivers/nv50/nv50_state.c
src/gallium/drivers/nvc0/nvc0_state.c
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/radeonsi/r600_blit.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_state_vertex.c
src/gallium/drivers/softpipe/sp_surface.c
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_blit.c
src/gallium/drivers/svga/svga_pipe_vertex.c
src/gallium/drivers/svga/svga_swtnl_state.c
src/gallium/drivers/trace/tr_context.c
src/gallium/include/pipe/p_context.h
src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
src/gallium/state_trackers/vega/renderer.c
src/gallium/tests/graw/fs-fragcoord.c
src/gallium/tests/graw/fs-frontface.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/fs-write-z.c
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/occlusion-query.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/quad-tex.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tex-srgb.c
src/gallium/tests/graw/tex-swizzle.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/tri.c
src/gallium/tests/graw/vs-test.c
src/mesa/state_tracker/st_atom_array.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_drawtex.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_draw_feedback.c