<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">I think the commit message could use some work. How about:<br><br></div><div class="gmail_quote">i965/blorp: Use the render cache mechanism instead of explicit flusing<br></div><div class="gmail_quote"><br>On Tue, Jan 17, 2017 at 10:48 AM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">by replacing brw_emit_mi_flush() with brw_render_cache_set_check_<wbr>flush().<br>
The latter splits the flush in two:<br>
<br>
brw_emit_pipe_control_flush(<wbr>brw,<br>
PIPE_CONTROL_DEPTH_CACHE_FLUSH |<br>
PIPE_CONTROL_RENDER_TARGET_<wbr>FLUSH |<br>
PIPE_CONTROL_CS_STALL);<br>
<br>
brw_emit_pipe_control_flush(<wbr>brw,<br>
PIPE_CONTROL_TEXTURE_CACHE_<wbr>INVALIDATE |<br>
PIPE_CONTROL_CONST_CACHE_<wbr>INVALIDATE);<br>
<br>
instead of<br>
<br>
int flags = PIPE_CONTROL_NO_WRITE | PIPE_CONTROL_RENDER_TARGET_<wbr>FLUSH;<br>
if (brw->gen >= 6) {<br>
flags |= PIPE_CONTROL_INSTRUCTION_<wbr>INVALIDATE |<br>
PIPE_CONTROL_CONST_CACHE_<wbr>INVALIDATE |<br>
PIPE_CONTROL_DEPTH_CACHE_FLUSH |<br>
PIPE_CONTROL_VF_CACHE_<wbr>INVALIDATE |<br>
PIPE_CONTROL_TEXTURE_CACHE_<wbr>INVALIDATE |<br>
PIPE_CONTROL_CS_STALL;<br>
}<br>
brw_emit_pipe_control_flush(<wbr>brw, flags);<br>
<br>
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>genX_blorp_exec.c | 7 ++++++-<br>
1 file changed, 6 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>genX_blorp_exec.c b/src/mesa/drivers/dri/i965/<wbr>genX_blorp_exec.c<br>
index bb1dfa9..c0cbde5 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>genX_blorp_exec.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>genX_blorp_exec.c<br>
@@ -25,6 +25,7 @@<br>
<br>
#include "intel_batchbuffer.h"<br>
#include "intel_mipmap_tree.h"<br>
+#include "intel_fbo.h"<br>
<br>
#include "brw_context.h"<br>
#include "brw_state.h"<br>
@@ -179,7 +180,9 @@ genX(blorp_exec)(struct blorp_batch *batch,<br>
* data with different formats, which blorp does for stencil and depth<br>
* data.<br>
*/<br>
- brw_emit_mi_flush(brw);<br>
+ if (params->src.enabled)<br>
+ brw_render_cache_set_check_<wbr>flush(brw, params->src.addr.buffer);<br>
+ brw_render_cache_set_check_<wbr>flush(brw, params->dst.addr.buffer);<br>
<br>
brw_select_pipeline(brw, BRW_RENDER_PIPELINE);<br>
<br>
@@ -256,6 +259,8 @@ retry:<br>
brw->no_depth_or_stencil = false;<br>
brw->ib.type = -1;<br>
<br>
+ brw_render_cache_set_add_bo(<wbr>brw, params->dst.addr.buffer);<br></blockquote><div><br></div><div>For depth clears, you may not have a destination. Probably best to make this one conditional as well. Otherwise, we'll add NULL to the set.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
/* Flush the sampler cache so any texturing from the destination is<br>
* coherent.<br>
*/<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>