[Mesa-dev] [PATCH 04/14] intel/blorp: Add fast-clear to the special case in MSAA resolves
Nanley Chery
nanleychery at gmail.com
Mon Nov 27 16:54:30 UTC 2017
On Mon, Nov 13, 2017 at 08:12:44AM -0800, Jason Ekstrand wrote:
> This doesn't go all the way of avoiding the txf_ms if it's fast-cleared,
> however it does at least make us only do it once. This should improve
> performance of MSAA resolves in the presence of lots of clear color.
> Without the patch, enabling fast-clears in the multisampling Sascha demo
> drops the framerate by about 10%. With this patch, enabling fast-clears
> increases the demo's framerate by 25%.
Nice!
> ---
> src/intel/blorp/blorp_blit.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
> index 19f6c36..65fed05 100644
> --- a/src/intel/blorp/blorp_blit.c
> +++ b/src/intel/blorp/blorp_blit.c
> @@ -21,7 +21,7 @@
> * IN THE SOFTWARE.
> */
>
> -#include "compiler/nir/nir_builder.h"
> +#include "blorp_nir_builder.h"
>
> #include "blorp_priv.h"
>
> @@ -687,9 +687,11 @@ blorp_nir_manual_blend_average(nir_builder *b, struct brw_blorp_blit_vars *v,
> mcs_zero = nir_iand(b, mcs_zero,
> nir_ieq(b, nir_channel(b, mcs, 1), nir_imm_int(b, 0)));
> }
> + nir_ssa_def *mcs_clear =
> + blorp_nir_mcs_is_clear_color(b, mcs, tex_samples);
>
Since the related optimization of sampling from slice 0 is already
documented, I think it would also be good to update the documentation to
include this one.
Whether or not you update it, patches 3 and 4 are:
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
> nir_if *if_stmt = nir_if_create(b->shader);
> - if_stmt->condition = nir_src_for_ssa(mcs_zero);
> + if_stmt->condition = nir_src_for_ssa(nir_ior(b, mcs_zero, mcs_clear));
> nir_cf_node_insert(b->cursor, &if_stmt->cf_node);
>
> b->cursor = nir_after_cf_list(&if_stmt->then_list);
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list