summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a4xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-12-01 11:55:36 -0500
committerRob Clark <[email protected]>2014-12-01 12:02:25 -0500
commitbb19f2c3c4a47c25c2680ad2d94a10f8ee5e70d7 (patch)
tree4ffb67963b4121777aeee80870a6e479eaa36375 /src/gallium/drivers/freedreno/a4xx
parentebbd34a468a9e8f3f4d8900be38755d77a662f1f (diff)
freedreno/a4xx: invalidate cache when vbo's change
Otherwise vertex shader can see stale cache data. This in particular happens when the same vbo is updated and reused. Not sure yet if vbo's at differing addresses but bound to same vertex buffer slot could have issues, but seems safest to flush whenever new vertex buffers are bound. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a4xx')
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_emit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
index 3f51e502d0a..44a824ab164 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c
@@ -328,6 +328,13 @@ fd4_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd4_emit *emit)
OUT_RING(ring, 0x00000000); /* XXX VFD_CONTROL_2 */
OUT_RING(ring, 0x0000fc00); /* XXX VFD_CONTROL_3 */
OUT_RING(ring, 0x00000000); /* XXX VFD_CONTROL_4 */
+
+ /* cache invalidate, otherwise vertex fetch could see
+ * stale vbo contents:
+ */
+ OUT_PKT0(ring, REG_A4XX_UCHE_INVALIDATE0, 2);
+ OUT_RING(ring, 0x00000000);
+ OUT_RING(ring, 0x00000012);
}
void