On 24.02.2016 19:28, Marek Olšák wrote: > On Wed, Feb 24, 2016 at 4:02 AM, Michel Dänzer <mic...@daenzer.net> wrote: >> On 24.02.2016 01:45, Marek Olšák wrote: >>> From: Marek Olšák <marek.ol...@amd.com> >>> >>> This can increase perf for shaders that kill pixels (kill, alpha-test, >>> alpha-to-coverage). >>> --- >>> src/gallium/drivers/radeonsi/si_shader.h | 1 + >>> src/gallium/drivers/radeonsi/si_state.c | 6 +++--- >>> src/gallium/drivers/radeonsi/si_state_shaders.c | 16 +++++++++++++--- >>> 3 files changed, 17 insertions(+), 6 deletions(-) >>> >>> diff --git a/src/gallium/drivers/radeonsi/si_shader.h >>> b/src/gallium/drivers/radeonsi/si_shader.h >>> index ff5c24d..637d264 100644 >>> --- a/src/gallium/drivers/radeonsi/si_shader.h >>> +++ b/src/gallium/drivers/radeonsi/si_shader.h >>> @@ -365,6 +365,7 @@ struct si_shader { >>> struct r600_resource *scratch_bo; >>> union si_shader_key key; >>> bool is_binary_shared; >>> + unsigned z_order; >>> >>> /* The following data is all that's needed for binary shaders. */ >>> struct radeon_shader_binary binary; >>> diff --git a/src/gallium/drivers/radeonsi/si_state.c >>> b/src/gallium/drivers/radeonsi/si_state.c >>> index 2dfdbeb..b23b17a 100644 >>> --- a/src/gallium/drivers/radeonsi/si_state.c >>> +++ b/src/gallium/drivers/radeonsi/si_state.c >>> @@ -1339,10 +1339,10 @@ static void si_emit_db_render_state(struct >>> si_context *sctx, struct r600_atom *s >>> sctx->ps_db_shader_control; >>> >>> /* Bug workaround for smoothing (overrasterization) on SI. */ >>> - if (sctx->b.chip_class == SI && sctx->smoothing_enabled) >>> + if (sctx->b.chip_class == SI && sctx->smoothing_enabled) { >>> + db_shader_control &= C_02880C_Z_ORDER; >>> db_shader_control |= S_02880C_Z_ORDER(V_02880C_LATE_Z); >>> - else >>> - db_shader_control |= >>> S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z); >>> + } >> >> The switch from LATE_Z to EARLY_Z_THEN_LATE_Z here should either be in a >> separate change, or at least explained in the commit log or a code >> comment. With any of that done, this change is > > It doesn't switch from LATE_Z to EARLY_Z_THEN_LATE_Z. It actually > doesn't change the behavior at all. The bug workaround simply sets > LATE_Z no matter which mode is preferred.
Ah sorry, looks like I managed to read that part of the patch backwards. :( The patch is Reviewed-by: Michel Dänzer <michel.daen...@amd.com> -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev