Re: [Mesa-dev] [PATCH 00/29] anv: Rework resolves and fast clears

2017-11-28 Thread Pohjolainen, Topi
On Mon, Nov 27, 2017 at 07:05:50PM -0800, Jason Ekstrand wrote:
> This patch series is a major rework of the aux tracking and fast clear code
> in our Vulkan driver.  It's broken up into three basic pieces:
> 
>  1) Patches 1-13 rework the way layout transitions work and add some
> additional granularity to our aux tracking scheme.  This is required to
> support Y-tiled window system buffers where we have CCS_E but need to
> do a full resolve prior to handing it off to the window system.  The
> current code does a partial resolve if and only if CCS_E is enabled.
> These patches may get back-ported to 17.3 because it seems that people
> are hitting issues with this somewhere in Chrome.
> 
>  2) Patches 14-25 rework the code we have for doing fast clears, setting up
> indirect clear colors, and doing implicit layout transitions.  In
> particular, we pull them all together into a single begin/end_subpass
> function pair instead of scattering them across multiple functions in
> genX_cmd_buffer.c and anv_blorp.c.  This allows us to avoid the
> redundant fast-clear that you get when you have LOAD_OP_CLEAR combined
> with IMAGE_LAYOUT_UNDEFINED.
> 
>  3) Patches 26-29 revive my old CCS ambiguate pass and make us use that
> instead of a fast-clear for initializing CCS buffers on gen9+.  This
> should allow us to avoid some unneeded resolves in a couple of corner
> cases.  It also simplifies transition_color_buffer a decent bit.
> 
> I've organized this patch series in order of priority both in terms of time
> and in terms of importance.  If the third chunk doesn't land for a while or
> never at all, I'm not going to cry over it, but I do think it's quite a bit
> better.
> 
> Cc: Nanley Chery 
> 
> Jason Ekstrand (29):
>   intel/isl: Codify AUX operations in an enum
>   anv/blorp: Rework image clear/resolve helpers
>   anv/blorp: Support ISL_AUX_USAGE_HIZ in surf_for_anv_image
>   anv/blorp: Rework HiZ ops to look like MCS and CCS
>   anv/image: Update a comment

I had to go back-and-forth in patch 2 but I really liked the end result. There
is a case missed in patch 4 it seems, but patches 1-5:

Reviewed-by: Topi Pohjolainen 

I will try to read the rest also. I'm not that familiar with the big picture
in anvil so I wouldn't put too much weight on it.

>   anv/image: Add a helper for determining when fast clears are supported
>   anv/image: Support color aspects in layout_to_aux_usage
>   anv/cmd_buffer: Recurse in transition_color_buffer instead of falling
> through
>   anv/cmd_buffer: Generalize transition_color_buffer
>   anv/cmd_buffer: Add an anv_genX_call macro
>   anv/cmd_buffer: Add a mark_image_written helper
>   anv/cmd_buffer: Drop the genX from get/set_needs_resolve
>   anv/cmd_buffer: Rework aux tracking
>   anv/cmd_buffer: Apply subpass flushes before set_subpass
>   anv/cmd_buffer: Add begin/end_subpass helpers
>   anv/cmd_buffer: Pass a subpass id into begin_subpass
>   anv/cmd_buffer: Move the color portion of clear_subpass into
> begin_subpass
>   intel/blorp: Add a blorp_hiz_clear_depth_stencil helper
>   anv/cmd_buffer: Move the rest of clear_subpass into begin_subpass
>   anv/cmd_buffer: Decide whether or not to HiZ clear up-front
>   anv/cmd_buffer: Iterate all subpass attachments when clearing
>   anv/cmd_buffer: Add a concept of pending load aspects
>   anv/cmd_buffer: Sync clear values in begin_subpass
>   anv/cmd_buffer: Do subpass image transitions in begin/end_subpass
>   anv/cmd_buffer: Avoid unnecessary transitions before fast clears
>   intel/blorp: Add a CCS ambiguation pass
>   anv/cmd_buffer: Pull the undefined layout condition into the if
>   anv/cmd_buffer: Re-arrange the logic around UNDEFINED fast-clears
>   anv: Use blorp_ccs_ambiguate instead of fast-clears
> 
>  src/intel/blorp/blorp.h|  16 +
>  src/intel/blorp/blorp_clear.c  | 156 
>  src/intel/isl/isl.h|  74 ++--
>  src/intel/vulkan/anv_blorp.c   | 661 +++---
>  src/intel/vulkan/anv_cmd_buffer.c  |  52 ++-
>  src/intel/vulkan/anv_genX.h|   6 +
>  src/intel/vulkan/anv_image.c   | 108 -
>  src/intel/vulkan/anv_private.h |  86 +++-
>  src/intel/vulkan/genX_cmd_buffer.c | 795 
> +++--
>  9 files changed, 1249 insertions(+), 705 deletions(-)
> 
> -- 
> 2.5.0.400.gff86faf
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 00/29] anv: Rework resolves and fast clears

2017-11-27 Thread Jason Ekstrand
This patch series is a major rework of the aux tracking and fast clear code
in our Vulkan driver.  It's broken up into three basic pieces:

 1) Patches 1-13 rework the way layout transitions work and add some
additional granularity to our aux tracking scheme.  This is required to
support Y-tiled window system buffers where we have CCS_E but need to
do a full resolve prior to handing it off to the window system.  The
current code does a partial resolve if and only if CCS_E is enabled.
These patches may get back-ported to 17.3 because it seems that people
are hitting issues with this somewhere in Chrome.

 2) Patches 14-25 rework the code we have for doing fast clears, setting up
indirect clear colors, and doing implicit layout transitions.  In
particular, we pull them all together into a single begin/end_subpass
function pair instead of scattering them across multiple functions in
genX_cmd_buffer.c and anv_blorp.c.  This allows us to avoid the
redundant fast-clear that you get when you have LOAD_OP_CLEAR combined
with IMAGE_LAYOUT_UNDEFINED.

 3) Patches 26-29 revive my old CCS ambiguate pass and make us use that
instead of a fast-clear for initializing CCS buffers on gen9+.  This
should allow us to avoid some unneeded resolves in a couple of corner
cases.  It also simplifies transition_color_buffer a decent bit.

I've organized this patch series in order of priority both in terms of time
and in terms of importance.  If the third chunk doesn't land for a while or
never at all, I'm not going to cry over it, but I do think it's quite a bit
better.

Cc: Nanley Chery 

Jason Ekstrand (29):
  intel/isl: Codify AUX operations in an enum
  anv/blorp: Rework image clear/resolve helpers
  anv/blorp: Support ISL_AUX_USAGE_HIZ in surf_for_anv_image
  anv/blorp: Rework HiZ ops to look like MCS and CCS
  anv/image: Update a comment
  anv/image: Add a helper for determining when fast clears are supported
  anv/image: Support color aspects in layout_to_aux_usage
  anv/cmd_buffer: Recurse in transition_color_buffer instead of falling
through
  anv/cmd_buffer: Generalize transition_color_buffer
  anv/cmd_buffer: Add an anv_genX_call macro
  anv/cmd_buffer: Add a mark_image_written helper
  anv/cmd_buffer: Drop the genX from get/set_needs_resolve
  anv/cmd_buffer: Rework aux tracking
  anv/cmd_buffer: Apply subpass flushes before set_subpass
  anv/cmd_buffer: Add begin/end_subpass helpers
  anv/cmd_buffer: Pass a subpass id into begin_subpass
  anv/cmd_buffer: Move the color portion of clear_subpass into
begin_subpass
  intel/blorp: Add a blorp_hiz_clear_depth_stencil helper
  anv/cmd_buffer: Move the rest of clear_subpass into begin_subpass
  anv/cmd_buffer: Decide whether or not to HiZ clear up-front
  anv/cmd_buffer: Iterate all subpass attachments when clearing
  anv/cmd_buffer: Add a concept of pending load aspects
  anv/cmd_buffer: Sync clear values in begin_subpass
  anv/cmd_buffer: Do subpass image transitions in begin/end_subpass
  anv/cmd_buffer: Avoid unnecessary transitions before fast clears
  intel/blorp: Add a CCS ambiguation pass
  anv/cmd_buffer: Pull the undefined layout condition into the if
  anv/cmd_buffer: Re-arrange the logic around UNDEFINED fast-clears
  anv: Use blorp_ccs_ambiguate instead of fast-clears

 src/intel/blorp/blorp.h|  16 +
 src/intel/blorp/blorp_clear.c  | 156 
 src/intel/isl/isl.h|  74 ++--
 src/intel/vulkan/anv_blorp.c   | 661 +++---
 src/intel/vulkan/anv_cmd_buffer.c  |  52 ++-
 src/intel/vulkan/anv_genX.h|   6 +
 src/intel/vulkan/anv_image.c   | 108 -
 src/intel/vulkan/anv_private.h |  86 +++-
 src/intel/vulkan/genX_cmd_buffer.c | 795 +++--
 9 files changed, 1249 insertions(+), 705 deletions(-)

-- 
2.5.0.400.gff86faf

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev