diff options
author | Marek Olšák <[email protected]> | 2012-04-24 19:52:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-30 01:09:57 +0200 |
commit | 507337864fa80caf9f26602324d2c28dd0a75d61 (patch) | |
tree | 94ec3c69d93f5dc70f0f042c1dbc11fe01a8550c /src/gallium/drivers/r600/evergreen_state.c | |
parent | 1b749dc34f8d83cf3dfa863279b1fe2b356d34b2 (diff) |
gallium: change set_constant_buffer to be UBO-friendly
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 97a27d242c0..07771c17768 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1177,7 +1177,7 @@ static void evergreen_set_clip_state(struct pipe_context *ctx, { struct r600_context *rctx = (struct r600_context *)ctx; struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state); - struct pipe_resource *cbuf; + struct pipe_constant_buffer cb; if (rstate == NULL) return; @@ -1203,12 +1203,14 @@ static void evergreen_set_clip_state(struct pipe_context *ctx, rctx->states[R600_PIPE_STATE_CLIP] = rstate; r600_context_pipe_state_set(rctx, rstate); - cbuf = pipe_user_buffer_create(ctx->screen, - state->ucp, - 4*4*8, /* 8*4 floats */ - PIPE_BIND_CONSTANT_BUFFER); - r600_set_constant_buffer(ctx, PIPE_SHADER_VERTEX, 1, cbuf); - pipe_resource_reference(&cbuf, NULL); + cb.buffer = pipe_user_buffer_create(ctx->screen, + state->ucp, + 4*4*8, /* 8*4 floats */ + PIPE_BIND_CONSTANT_BUFFER); + cb.buffer_offset = 0; + cb.buffer_size = 4*4*8; + r600_set_constant_buffer(ctx, PIPE_SHADER_VERTEX, 1, &cb); + pipe_resource_reference(&cb.buffer, NULL); } static void evergreen_set_polygon_stipple(struct pipe_context *ctx, @@ -1762,7 +1764,7 @@ static void evergreen_emit_constant_buffer(struct r600_context *rctx, uint32_t dirty_mask = state->dirty_mask; while (dirty_mask) { - struct r600_constant_buffer *cb; + struct pipe_constant_buffer *cb; struct r600_resource *rbuffer; uint64_t va; unsigned buffer_index = ffs(dirty_mask) - 1; |