gallium: Always allocate new const buffers instead of modifying existing ones.
authorMichel Dänzer <michel@tungstengraphics.com>
Fri, 4 Apr 2008 08:06:13 +0000 (09:06 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Fri, 4 Apr 2008 08:06:13 +0000 (09:06 +0100)
src/mesa/state_tracker/st_atom_constbuf.c

index cd7372902b8ed76e10765b21d04ff58952693dbb..03093579e15344f9b0ec28ee93d490756f769a5b 100644 (file)
@@ -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)
       {