crocus: support rebinding streamout target buffers

Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
This commit is contained in:
Dave Airlie
2021-07-06 13:21:58 +10:00
parent e2e9dd44f4
commit db6042ea14
2 changed files with 10 additions and 5 deletions

View File

@@ -1113,10 +1113,6 @@ crocus_invalidate_resource(struct pipe_context *ctx,
if (res->bo->userptr) if (res->bo->userptr)
return; return;
// XXX: We should support this.
if (res->bind_history & PIPE_BIND_STREAM_OUTPUT)
return;
struct crocus_bo *old_bo = res->bo; struct crocus_bo *old_bo = res->bo;
struct crocus_bo *new_bo = struct crocus_bo *new_bo =
crocus_bo_alloc(screen->bufmgr, res->bo->name, resource->width0); crocus_bo_alloc(screen->bufmgr, res->bo->name, resource->width0);

View File

@@ -8289,7 +8289,16 @@ crocus_rebind_buffer(struct crocus_context *ice,
if (res->bind_history & PIPE_BIND_STREAM_OUTPUT) { if (res->bind_history & PIPE_BIND_STREAM_OUTPUT) {
/* XXX: be careful about resetting vs appending... */ /* XXX: be careful about resetting vs appending... */
assert(false); for (int i = 0; i < 4; i++) {
if (ice->state.so_target[i] &&
(ice->state.so_target[i]->buffer == &res->base.b)) {
#if GFX_VER == 6
ice->state.stage_dirty |= CROCUS_STAGE_DIRTY_BINDINGS_GS;
#else
ice->state.dirty |= CROCUS_DIRTY_GEN7_SO_BUFFERS;
#endif
}
}
} }
for (int s = MESA_SHADER_VERTEX; s < MESA_SHADER_STAGES; s++) { for (int s = MESA_SHADER_VERTEX; s < MESA_SHADER_STAGES; s++) {