i965: Emit texture cache flushes on gen6 along with render cache flushes.
authorEric Anholt <eric@anholt.net>
Mon, 25 Jul 2011 18:50:27 +0000 (11:50 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 25 Jul 2011 20:47:01 +0000 (13:47 -0700)
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.

src/mesa/drivers/dri/intel/intel_batchbuffer.c

index 97cc219ce6dbb091f093392de0b9c7d2f7dbb6d9..db4343be10c08ffce7b7c436b011a74e1d177f9b 100644 (file)
@@ -390,6 +390,7 @@ intel_batchbuffer_emit_mi_flush(struct intel_context *intel)
         OUT_BATCH(PIPE_CONTROL_INSTRUCTION_FLUSH |
                   PIPE_CONTROL_WRITE_FLUSH |
                   PIPE_CONTROL_DEPTH_CACHE_FLUSH |
+                  PIPE_CONTROL_TC_FLUSH |
                   PIPE_CONTROL_NO_WRITE);
         OUT_BATCH(0); /* write address */
         OUT_BATCH(0); /* write data */