OSDN Git Service

anv: flush fast clear colors into compressed surfaces
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 23 Dec 2018 17:49:23 +0000 (17:49 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 8 Jan 2019 16:37:00 +0000 (16:37 +0000)
commitadd5a2ec92f4b3f7ac8353e5986dc04186a7b6da
tree516b4c35d2dc0a58d665c514700b4146efb09e68
parent366eb656ac6fe677828f20295d8916506552a0e8
anv: flush fast clear colors into compressed surfaces

In the following scenario :

   1. Create image format R8G8B8A8_UNORM
   2. Create image view format R8G8B8A8_SRGB
   3. Clear the view through a sub pass to a particular color
   4. Barrier on the image to from color attachment to source transfer
   5. Copy the image into a linear buffer to check the content

The step 4 resolving the clear color is unaware of the SRGB format of
the view, because the blorp resolve operations operate on images the
color associated with the resolve will not operate on SRGB format but
UNORM. Leading to the wrong color being written into surfaces.

This change forces a clear color resolve at the end of the render pass
so following resolves won't have to deal with the clear color with a
format that doesn't match the image's format.

On gfxbench vulkan_5_normal 1280x720, this appear to cost us ~0.5fps,
from 49.316 down to 48.949.

v2: Only fast clear resolve when image & view have different formats
    (Lionel)

v3: Update warning (Jason)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108911
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
src/intel/vulkan/genX_cmd_buffer.c