iris: Replace buffer backing storage and rebind to update addresses

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 23 April 2019 07:24 EDT

This implements PIPE_CAP_INVALIDATE_BUFFER and invalidate_resource(), as well as the PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE flag. When either of these happen, we swap out the backing storage of the buffer for a new idle BO, allowing us to write to it immediately without stalling or queueing a blit.

On my Skylake GT4e at 1920x1080, this improves performance in games:


| DiRT Rally | +25% (avg) | +17% (max) | | Bioshock Infinite | +22% (avg) | +11% (max) | | Shadow of Mordor | +27% (avg) | +83% (max) |

5ad0c88dbe3 iris: Replace buffer backing storage and rebind to update addresses.
src/gallium/drivers/iris/iris_context.h | 3 +
src/gallium/drivers/iris/iris_resource.c | 47 ++++++++++--
src/gallium/drivers/iris/iris_screen.c | 1 +
src/gallium/drivers/iris/iris_state.c | 125 +++++++++++++++++++++++++++++++
4 files changed, 171 insertions(+), 5 deletions(-)

Upstream: cgit.freedesktop.org


  • Share