summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_state.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-02-07 15:22:19 +0000
committerEric Anholt <[email protected]>2018-03-09 09:59:54 -0800
commit46a32e3d2e84bd4dfff9e76f0f1f21613e1bc5a9 (patch)
tree3df62f8ee9140c1bda3d1e8dfc69ed12267eeccf /src/gallium/drivers/vc4/vc4_state.c
parent2725ab2b12385eccfbdafe6f158661aca6bf778e (diff)
broadcom/vc4: Allow binding non-zero constant buffers.
We're going to use UBO loads for implementing YUV linear-to-T-format blits.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_state.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_state.c7
1 files changed, 4 insertions, 3 deletions
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;