gallium: adapt drivers to pipe_constant_buffer removal
[mesa.git] / src / gallium / drivers / nv10 / nv10_state.c
index ffc6be3c401d68740f162bb86d15ab001d4d2299..150ab5029c8fc04addbe46f03e0718cfd35d49ca 100644 (file)
@@ -458,7 +458,7 @@ nv10_set_clip_state(struct pipe_context *pipe,
 
 static void
 nv10_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                        const struct pipe_constant_buffer *buf )
+                        const struct pipe_buffer *buf )
 {
        struct nv10_context *nv10 = nv10_context(pipe);
        struct pipe_screen *pscreen = pipe->screen;
@@ -468,13 +468,13 @@ nv10_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
 
        if (buf) {
                void *mapped;
-               if (buf->buffer && buf->buffer->size &&
-                    (mapped = pipe_buffer_map(pscreen, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
+               if (buf->size &&
+                    (mapped = pipe_buffer_map(pscreen, buf, PIPE_BUFFER_USAGE_CPU_READ)))
                {
-                       memcpy(nv10->constbuf[shader], mapped, buf->buffer->size);
+                       memcpy(nv10->constbuf[shader], mapped, buf->size);
                        nv10->constbuf_nr[shader] =
-                               buf->buffer->size / (4 * sizeof(float));
-                       pipe_buffer_unmap(pscreen, buf->buffer);
+                               buf->size / (4 * sizeof(float));
+                       pipe_buffer_unmap(pscreen, buf);
                }
        }
 }