gallium: adapt state trackers etc. to pipe_constant_buffer removal

This commit is contained in:
Roland Scheidegger
2009-12-23 20:44:06 +01:00
parent beb712ee9a
commit f44b0ff843
19 changed files with 105 additions and 108 deletions

View File

@@ -57,7 +57,7 @@ void st_upload_constants( struct st_context *st,
unsigned shader_type)
{
struct pipe_context *pipe = st->pipe;
struct pipe_constant_buffer *cbuf = &st->state.constants[shader_type];
struct pipe_buffer **cbuf = &st->state.constants[shader_type];
assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_FRAGMENT);
@@ -71,8 +71,8 @@ void st_upload_constants( struct st_context *st,
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization.
*/
pipe_buffer_reference(&cbuf->buffer, NULL );
cbuf->buffer = pipe_buffer_create(pipe->screen, 16,
pipe_buffer_reference(cbuf, NULL );
*cbuf = pipe_buffer_create(pipe->screen, 16,
PIPE_BUFFER_USAGE_CONSTANT,
paramBytes );
@@ -84,12 +84,12 @@ void st_upload_constants( struct st_context *st,
}
/* load Mesa constants into the constant buffer */
if (cbuf->buffer)
st_no_flush_pipe_buffer_write(st, cbuf->buffer,
if (cbuf)
st_no_flush_pipe_buffer_write(st, *cbuf,
0, paramBytes,
params->ParameterValues);
st->pipe->set_constant_buffer(st->pipe, shader_type, 0, cbuf);
st->pipe->set_constant_buffer(st->pipe, shader_type, 0, *cbuf);
}
else {
st->constants.tracked_state[shader_type].dirty.mesa = 0x0;