zink: defer pipe_context::clear calls when not currently in a renderpass

Graphics / Mesa 3D Graphics Library / Mesa - Mike Blumenkrantz [gmail.com] - 24 February 2021 01:58 UTC

instead, we can attach the clear to the next renderpass start and even add it to the renderpass cache for reuse

also add handling for flushing clears on map or fb switching to avoid brekaing behavior

this should save us a lot of time with potentially beginning/ending renderpasses as well as allowing drivers to do better batching of clears by passing in all the buffers at once

this doesn't handle deferring conditional renders yet in a futile attempt to try and keep the size of the patch down

5c629e9ff24 zink: defer pipe_context::clear calls when not currently in a renderpass
src/gallium/drivers/zink/zink_blit.c | 5 +
src/gallium/drivers/zink/zink_clear.c | 275 +++++++++++++++++++++++-----
src/gallium/drivers/zink/zink_context.c | 85 ++++++++-
src/gallium/drivers/zink/zink_context.h | 53 ++++++
src/gallium/drivers/zink/zink_render_pass.c | 6 +-
src/gallium/drivers/zink/zink_render_pass.h | 5 +
src/gallium/drivers/zink/zink_resource.c | 1 +
7 files changed, 380 insertions(+), 50 deletions(-)

Upstream: cgit.freedesktop.org


  • Share