gallium: split transfer_inline_write into buffer and texture callbacks
authorMarek Olšák <marek.olsak@amd.com>
Sat, 16 Jul 2016 19:19:48 +0000 (21:19 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 23 Jul 2016 11:33:42 +0000 (13:33 +0200)
commit1ffe77e7bb2486ea74cda077ed2a9622b758395c
tree4a04818614fc8c4e086e9dcd32dbadecbac4b6fb
parent0ba7288376dc66f932336862c8a6abb629b47686
gallium: split transfer_inline_write into buffer and texture callbacks

to reduce the call indirections with u_resource_vtbl.

The worst call tree you could get was:
  - u_transfer_inline_write_vtbl
    - u_default_transfer_inline_write
      - u_transfer_map_vtbl
        - driver_transfer_map
      - u_transfer_unmap_vtbl
        - driver_transfer_unmap

That's 6 indirect calls. Some drivers only had 5. The goal is to have
1 indirect call for drivers that care. The resource type can be determined
statically at most call sites.

The new interface is:
  pipe_context::buffer_subdata(ctx, resource, usage, offset, size, data)
  pipe_context::texture_subdata(ctx, resource, level, usage, box, data,
                                stride, layer_stride)

v2: fix whitespace, correct ilo's behavior

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
57 files changed:
src/gallium/auxiliary/postprocess/pp_mlaa.c
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_transfer.c
src/gallium/auxiliary/util/u_transfer.h
src/gallium/docs/source/context.rst
src/gallium/drivers/ddebug/dd_context.c
src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/i915/i915_resource.c
src/gallium/drivers/i915/i915_resource.h
src/gallium/drivers/i915/i915_resource_buffer.c
src/gallium/drivers/i915/i915_resource_texture.c
src/gallium/drivers/ilo/ilo_transfer.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/noop/noop_pipe.c
src/gallium/drivers/nouveau/nouveau_buffer.c
src/gallium/drivers/nouveau/nv30/nv30_miptree.c
src/gallium/drivers/nouveau/nv30/nv30_resource.c
src/gallium/drivers/nouveau/nv50/nv50_miptree.c
src/gallium/drivers/nouveau/nv50/nv50_resource.c
src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
src/gallium/drivers/r300/r300_resource.c
src/gallium/drivers/r300/r300_screen_buffer.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r600/evergreen_compute.c
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/svga/svga_resource.c
src/gallium/drivers/svga/svga_resource_buffer.c
src/gallium/drivers/svga/svga_resource_texture.c
src/gallium/drivers/swr/swr_context.cpp
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/vc4/vc4_resource.c
src/gallium/drivers/virgl/virgl_buffer.c
src/gallium/drivers/virgl/virgl_resource.c
src/gallium/drivers/virgl/virgl_texture.c
src/gallium/include/pipe/p_context.h
src/gallium/state_trackers/clover/core/resource.cpp
src/gallium/state_trackers/nine/buffer9.h
src/gallium/state_trackers/nine/nine_state.c
src/gallium/state_trackers/nine/surface9.c
src/gallium/state_trackers/nine/volume9.c
src/gallium/state_trackers/omx/vid_enc.c
src/gallium/state_trackers/va/image.c
src/gallium/state_trackers/vdpau/bitmap.c
src/gallium/state_trackers/vdpau/output.c
src/gallium/state_trackers/vdpau/surface.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/graw_util.h
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/vs-test.c
src/mesa/state_tracker/st_cb_bufferobjects.c
src/mesa/state_tracker/st_cb_texture.c