swr: Add path to draw directly from client memory without copy

Graphics / Mesa 3D Graphics Library / Mesa - Bruce Cherniak [intel.com] - 12 July 2017 17:56 EDT

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.

02735e6 swr: Add path to draw directly from client memory without copy.
src/gallium/drivers/swr/swr_context.h | 1 +
src/gallium/drivers/swr/swr_draw.cpp | 9 +++++++++
src/gallium/drivers/swr/swr_screen.cpp | 13 ++++++++++++
src/gallium/drivers/swr/swr_screen.h | 2 ++
src/gallium/drivers/swr/swr_state.cpp | 37 ++++++++++++++++++++++++----------
5 files changed, 51 insertions(+), 11 deletions(-)

Upstream: cgit.freedesktop.org


  • Share