radeonsi: flush TC L2 cache for indirect draw data

This fixes a bug when indirect draw data is generated by transform
feedback.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2016-08-08 17:06:22 +02:00
parent 76c4a3b567
commit 2852dedaa0
2 changed files with 9 additions and 4 deletions
@@ -1242,10 +1242,10 @@ static void si_set_streamout_targets(struct pipe_context *ctx,
* and most other clients can use TC L2 as well, we don't need
* to flush it.
*
* The only case which requires flushing it is VGT DMA index
* fetching, which is a rare case. Thus, flag the TC L2
* dirtiness in the resource and handle it when index fetching
* is used.
* The only cases which requires flushing it is VGT DMA index
* fetching (on <= CIK) and indirect draw data, which are rare
* cases. Thus, flag the TC L2 dirtiness in the resource and
* handle it at draw call time.
*/
for (i = 0; i < sctx->b.streamout.num_targets; i++)
if (sctx->b.streamout.targets[i])
@@ -967,6 +967,11 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
r600_resource(ib.buffer)->TC_L2_dirty = false;
}
if (info->indirect && r600_resource(info->indirect)->TC_L2_dirty) {
sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
r600_resource(info->indirect)->TC_L2_dirty = false;
}
/* Check flush flags. */
if (sctx->b.flags)
si_mark_atom_dirty(sctx, sctx->atoms.s.cache_flush);