From 46a32e3d2e84bd4dfff9e76f0f1f21613e1bc5a9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 7 Feb 2018 15:22:19 +0000 Subject: broadcom/vc4: Allow binding non-zero constant buffers. We're going to use UBO loads for implementing YUV linear-to-T-format blits. --- src/gallium/drivers/vc4/vc4_state.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/vc4/vc4_state.c') diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index c85618789a6..f8c37818499 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -386,8 +386,6 @@ vc4_set_constant_buffer(struct pipe_context *pctx, struct vc4_context *vc4 = vc4_context(pctx); struct vc4_constbuf_stateobj *so = &vc4->constbuf[shader]; - assert(index == 0); - /* Note that the state tracker can unbind constant buffers by * passing NULL here. */ @@ -397,7 +395,10 @@ vc4_set_constant_buffer(struct pipe_context *pctx, return; } - assert(!cb->buffer); + if (index == 1 && so->cb[index].buffer_size != cb->buffer_size) + vc4->dirty |= VC4_DIRTY_UBO_1_SIZE; + + pipe_resource_reference(&so->cb[index].buffer, cb->buffer); so->cb[index].buffer_offset = cb->buffer_offset; so->cb[index].buffer_size = cb->buffer_size; so->cb[index].user_buffer = cb->user_buffer; -- cgit v1.2.3