v3dv: add a fast path for vkCmdClearAttachments

Graphics / Mesa 3D Graphics Library / Mesa - Iago Toral Quiroga [igalia.com] - 13 October 2020 21:21 UTC

Since vkCmdClearAttachments executes inside a render pass, we would benefit from converting it to a draw within the current subpass job to improve batching and avoid expensive tile load/store operations.

This can dramatically improve performance for applications using this command, however, we can only use this if we are clearing the base layers of framebuffer attachments, since otherwise we would need to use layered rendering, which we don't support yet.

This improves vkQuake3 performance dramatically (almost 100% performance improvement at 1080p), which calls this twice per frame.


47e02a2ef11 v3dv: add a fast path for vkCmdClearAttachments
src/broadcom/vulkan/v3dv_cmd_buffer.c | 11 +-
src/broadcom/vulkan/v3dv_device.c | 21 +-
src/broadcom/vulkan/v3dv_meta_clear.c | 556 ++++++++++++++++++++++++++++++----
src/broadcom/vulkan/v3dv_meta_copy.c | 2 +-
src/broadcom/vulkan/v3dv_private.h | 12 +-
5 files changed, 538 insertions(+), 64 deletions(-)

Upstream: cgit.freedesktop.org

  • Share