<div dir="ltr">Ping<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 1, 2018 at 1:21 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
<br>
---<br>
 src/gallium/drivers/radeonsi/<wbr>si_state_binning.c | 14 +++++---------<br>
 1 file changed, 5 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/<wbr>radeonsi/si_state_binning.c b/src/gallium/drivers/<wbr>radeonsi/si_state_binning.c<br>
index 9948a95488c..6d07492ced7 100644<br>
--- a/src/gallium/drivers/<wbr>radeonsi/si_state_binning.c<br>
+++ b/src/gallium/drivers/<wbr>radeonsi/si_state_binning.c<br>
@@ -332,32 +332,28 @@ void si_emit_dpbb_state(struct si_context *sctx)<br>
        if (!sscreen->dpbb_allowed || !blend || !dsa || sctx->dpbb_force_off) {<br>
                si_emit_dpbb_disable(sctx);<br>
                return;<br>
        }<br>
<br>
        bool ps_can_kill = G_02880C_KILL_ENABLE(db_<wbr>shader_control) ||<br>
                           G_02880C_MASK_EXPORT_ENABLE(<wbr>db_shader_control) ||<br>
                           G_02880C_COVERAGE_TO_MASK_<wbr>ENABLE(db_shader_control) ||<br>
                           blend->alpha_to_coverage;<br>
<br>
-       /* This is ported from Vulkan, but it doesn't make much sense to me.<br>
-        * Maybe it's for RE-Z? But Vulkan doesn't use RE-Z. TODO: Clarify this.<br>
-        */<br>
-       bool ps_can_reject_z_trivially =<br>
+       bool db_can_reject_z_trivially =<br>
                !G_02880C_Z_EXPORT_ENABLE(db_<wbr>shader_control) ||<br>
-               G_02880C_CONSERVATIVE_Z_<wbr>EXPORT(db_shader_control);<br>
+               G_02880C_CONSERVATIVE_Z_<wbr>EXPORT(db_shader_control) ||<br>
+               G_02880C_DEPTH_BEFORE_SHADER(<wbr>db_shader_control);<br>
<br>
-       /* Disable binning if PS can kill trivially with DB writes.<br>
-        * Ported from Vulkan. (heuristic?)<br>
-        */<br>
+       /* Disable DPBB when it's believed to be inefficient. */<br>
        if (ps_can_kill &&<br>
-           ps_can_reject_z_trivially &&<br>
+           db_can_reject_z_trivially &&<br>
            sctx->framebuffer.state.zsbuf &&<br>
            dsa->db_can_write) {<br>
                si_emit_dpbb_disable(sctx);<br>
                return;<br>
        }<br>
<br>
        /* Compute the bin size. */<br>
        /* TODO: We could also look at enabled pixel shader outputs. */<br>
        unsigned cb_target_enabled_4bit = sctx->framebuffer.colorbuf_<wbr>enabled_4bit &<br>
                                          blend->cb_target_enabled_4bit;<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
</font></span></blockquote></div><br></div>