freedreno: Fix streamout offset_buf dirtiness

We also need to mark the offset buffer as dirty.

Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
This commit is contained in:
Rob Clark 2023-09-28 12:43:33 -07:00 committed by Marge Bot
parent 1f6e20cca6
commit 4c0defda8a
2 changed files with 13 additions and 3 deletions

View file

@ -182,9 +182,15 @@ batch_draw_tracking_for_dirty_bits(struct fd_batch *batch) assert_dt
/* Mark streamout buffers as being written.. */
if (dirty & FD_DIRTY_STREAMOUT) {
for (unsigned i = 0; i < ctx->streamout.num_targets; i++)
if (ctx->streamout.targets[i])
resource_written(batch, ctx->streamout.targets[i]->buffer);
for (unsigned i = 0; i < ctx->streamout.num_targets; i++) {
struct fd_stream_output_target *target =
fd_stream_output_target(ctx->streamout.targets[i]);
if (target) {
resource_written(batch, target->base.buffer);
resource_written(batch, target->offset_buf);
}
}
}
if (dirty & FD_DIRTY_QUERY) {

View file

@ -702,6 +702,10 @@ fd_set_stream_output_targets(struct pipe_context *pctx, unsigned num_targets,
if (targets[i]) {
fd_resource_set_usage(targets[i]->buffer, FD_DIRTY_STREAMOUT);
fd_dirty_resource(ctx, targets[i]->buffer, FD_DIRTY_STREAMOUT, true);
struct fd_stream_output_target *target = fd_stream_output_target(targets[i]);
fd_resource_set_usage(target->offset_buf, FD_DIRTY_STREAMOUT);
fd_dirty_resource(ctx, target->offset_buf, FD_DIRTY_STREAMOUT, true);
}
if (!changed && !reset)