summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_constbuf.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-04-04 09:06:13 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2008-04-04 09:06:13 +0100
commitc07d3f6a9e62bd88e05d4ebf72430139b0531be8 (patch)
treeb3123a8ee60a1a0a946ddbdab9ac19a600f7398f /src/mesa/state_tracker/st_atom_constbuf.c
parenta7504ad587ee8cbfa9958ad23321a691ce0823d3 (diff)
gallium: Always allocate new const buffers instead of modifying existing ones.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_constbuf.c')
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index cd7372902b..03093579e1 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -71,13 +71,12 @@ void st_upload_constants( struct st_context *st,
_mesa_load_state_parameters(st->ctx, params);
- if (cbuf->buffer && cbuf->size != paramBytes)
- pipe_buffer_reference( ws, &cbuf->buffer, NULL );
-
- if (!cbuf->buffer) {
- cbuf->buffer = ws->buffer_create(ws, 1, PIPE_BUFFER_USAGE_CONSTANT,
- paramBytes);
- }
+ /* We always need to get a new buffer, to keep the drivers simple and
+ * avoid gratuitous rendering synchronization.
+ */
+ pipe_buffer_reference( ws, &cbuf->buffer, NULL );
+ cbuf->buffer = ws->buffer_create( ws, 1, PIPE_BUFFER_USAGE_CONSTANT,
+ paramBytes );
if (0)
{