swr: Add path to draw directly from client memory without copy.
authorBruce Cherniak <bruce.cherniak@intel.com>
Wed, 12 Jul 2017 20:04:47 +0000 (15:04 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 12 Jul 2017 21:56:40 +0000 (16:56 -0500)
commit02735e6cf8821f83e04fb78cd24960a4903ce118
tree0407f33c257975811333cb82e9de6627748efff9
parent1520a06607b58cdcadcf888594b0c2f269ba68b2
swr: Add path to draw directly from client memory without copy.

If size of client memory copy is too large, don't copy. The draw will
access user-buffer directly and then block.  This is faster and more
efficient than queuing many large client draws.

Applications that still use large client arrays benefit from this.  VMD
is an example.

The threshold for this path defaults to 32KB.  This value can be
overridden by setting environment variable SWR_CLIENT_COPY_LIMIT.

v2: Use #define for default value, rather than hard-coded constant.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/swr_context.h
src/gallium/drivers/swr/swr_draw.cpp
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/swr/swr_screen.h
src/gallium/drivers/swr/swr_state.cpp