anv/cmd_buffer: consider multiview masks for tracking pending clear aspects
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 21 Feb 2018 08:47:09 +0000 (09:47 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 2 Apr 2018 07:53:15 +0000 (09:53 +0200)
commitf60c5fc17e23ee12b7ae0e0d81a6c606a94faee6
tree18319c144d5bfcdb7e826bde31ce35b6f1dfc4c6
parentc88e7fe29ec7ddab5dc26664b9770066c790ceb5
anv/cmd_buffer: consider multiview masks for tracking pending clear aspects

When multiview is active a subpass clear may only clear a subset of the
attachment layers. Other subpasses in the same render pass may also
clear too and we want to honor those clears as well, however, we need to
ensure that we only clear a layer once, on the first subpass that uses
a particular layer (view) of a given attachment.

This means that when we check if a subpass attachment needs to be cleared
we need to check if all the layers used by that subpass (as indicated by
its view_mask) have already been cleared in previous subpasses or not, in
which case, we must clear any pending layers used by the subpass, and only
those pending.

v2:
  - track pending clear views in the attachment state (Jason)
  - rebased on top of fast-clear rework.

v3:
  - rebased on top of subpass rework.

v4: rebased.

v5 (Caio):
 - Rebased.
 - Initialize pending clear views to only have bits set for layers
   that exist.
 - Reset pending clear views in one go rather one bit at a time.
 - Put "last subpass for this attachment" condition in a separate
   function to simplify the conditional that resets pending_clear_aspects.

Fixes:
dEQP-VK.multiview.readback_implicit_clear.*

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c