[Mesa-dev] [PATCH 00/14] anv: Enable fast-clears for multisampled images

Jason Ekstrand jason at jlekstrand.net
Mon Nov 13 16:12:40 UTC 2017


We've had multisample compression support for some time and we've had
single-sampled fast-clears but multisampled fast clears haven't been all
that high on anyone's priority list.  It still isn't, but I've been
thinking about how to do it and finally decided it's time to type it out.

The first two patches are bug fixes that I noticed along the way.

Patches 3-4 add another case to our "are all samples identical" check where
it now checks for both 0 and the magic fast-clear value.  This significantly
improves the performance of MSAA resolves for the case where most of the
image is cleared.  Not many real-world use-cases actually hit this but the
multisampling Sascha demo does and this prevents us from regressing it.

Patches 5-10 add indirect clear color support to BLORP.  The internal
mechanism used is identical to Vulkan where we use MI_ commands to memcpy
the clear color bits into the surface state.  We then switch Vulkan over to
using the regular blorp_ccs_resolve entrypoint with an indirect clear color
instead of using blorp_ccs_resolve_attachment.  The only reason we needed
the _attachment version before was so that the Vulkan driver could provide
the surface state because it needed to copy in the clear color.  Now that
blorp can do it directly, this is no longer needed.

Patches 11 and 12 add indirect clear support to blorp_mcs_partial_resolve.
This one is a bit trickier because it needs the clear color in the shader.
This meant setting up another vertex buffer binding to point to the indirect
clear value and let us load it in.

Patches 13 and 14 are the trivial patches to actually enable MSAA fast-clears.
Now that we've got full support in blorp, it's just a matter of not bailing
in a few places when we see samples > 1.

Cc: Nanley Chery <nanley.g.chery at intel.com>
Cc: Topi Pohjolainen <topi.pohjolainen at intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

Jason Ekstrand (14):
  anv/cmd_buffer: Advance the address when initializing clear colors
  anv/cmd_buffer: Take bo_offset into account in fast clear state
    addresses
  intel/blorp/blit: Rename blorp_nir_txf_ms_mcs
  intel/blorp: Add fast-clear to the special case in MSAA resolves
  i965/blorp: Use a designated initializer for blorp_surf
  intel/blorp: Add initial support for indirect clear colors
  intel/blorp: Take a range of layers in blorp_ccs_resolve
  anv: Move get_fast_clear_state_address into anv_private.h
  anv: Let blorp handle indirect clear colors for CCS resolves
  intel/blorp: Drop blorp_resolve_ccs_attachment
  intel/blorp: Add a helper for filling out VERTEX_BUFFER_STATE
  intel/blorp: Add indirect clear color support to mcs_partial_resolve
  anv/blorp: Add an mcs_partial_resolve helper
  anv: Add support for MSAA fast-clears

 src/intel/blorp/blorp.c                     |   1 +
 src/intel/blorp/blorp.h                     |  21 ++-
 src/intel/blorp/blorp_blit.c                |  15 ++-
 src/intel/blorp/blorp_clear.c               |  86 ++++++------
 src/intel/blorp/blorp_genX_exec.h           | 198 +++++++++++++++++++++-------
 src/intel/blorp/blorp_priv.h                |   2 +
 src/intel/vulkan/anv_blorp.c                |  69 +++++++---
 src/intel/vulkan/anv_private.h              |  37 +++++-
 src/intel/vulkan/genX_blorp_exec.c          |  10 ++
 src/intel/vulkan/genX_cmd_buffer.c          | 132 ++++---------------
 src/mesa/drivers/dri/i965/brw_blorp.c       |  17 +--
 src/mesa/drivers/dri/i965/genX_blorp_exec.c |  13 ++
 12 files changed, 359 insertions(+), 242 deletions(-)

-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list