diff options
author | Rob Clark <[email protected]> | 2016-06-07 14:35:09 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-06-14 11:00:59 -0400 |
commit | 26d0efa9cea3fc2bd9985a3f36264ab6aeaaee32 (patch) | |
tree | 145e8266ec9031bc2fb003332f333b62f99356ef /src/gallium/drivers/freedreno/freedreno_state.c | |
parent | fdec8f9e42cc29efa275064be3cf7ae030bfebe7 (diff) |
freedreno: use util_copy_constant_buffer() helper
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_state.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_state.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index 6c472d19815..befd496790d 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -94,21 +94,17 @@ fd_set_constant_buffer(struct pipe_context *pctx, uint shader, uint index, struct fd_context *ctx = fd_context(pctx); struct fd_constbuf_stateobj *so = &ctx->constbuf[shader]; + util_copy_constant_buffer(&so->cb[index], cb); + /* Note that the state tracker can unbind constant buffers by * passing NULL here. */ if (unlikely(!cb)) { so->enabled_mask &= ~(1 << index); so->dirty_mask &= ~(1 << index); - pipe_resource_reference(&so->cb[index].buffer, NULL); return; } - 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; - so->enabled_mask |= 1 << index; so->dirty_mask |= 1 << index; ctx->dirty |= FD_DIRTY_CONSTBUF; |