<div dir="auto">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Jan 18, 2017 2:22 AM, "Topi Pohjolainen" <<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>> wrote:<br type="attribution"><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>
v2 (Jason): Check that destination exists before trying to add to<br>
render cache. Depth clears and resolves don't have it.<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 | 8 +++++++-<br>
1 file changed, 7 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..b72ecb6 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,9 @@ retry:<br>
brw->no_depth_or_stencil = false;<br>
brw->ib.type = -1;<br>
<br>
+ if (params->dst.enabled)<br>
+ brw_render_cache_set_add_bo(<wbr>brw, params->dst.addr.buffer);<br>
+<br>
/* Flush the sampler cache so any texturing from the destination is<br>
* coherent.<br>
*/<br>
--<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>
</blockquote></div></div>