Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / drivers / nv30 / nv30_state.c
index 63f530316679cb91a514dd6c1bf1f52a2a8a5dd2..b91e972c12336783abd0910564f87e011eaf7b31 100644 (file)
@@ -51,6 +51,7 @@ nv30_blend_state_create(struct pipe_context *pipe,
        so_data  (so, cso->dither ? 1 : 0);
 
        so_ref(so, &bso->so);
+       so_ref(NULL, &so);
        bso->pipe = *cso;
        return (void *)bso;
 }
@@ -404,6 +405,7 @@ nv30_rasterizer_state_create(struct pipe_context *pipe,
        }
 
        so_ref(so, &rsso->so);
+       so_ref(NULL, &so);
        rsso->pipe = *cso;
        return (void *)rsso;
 }
@@ -477,6 +479,7 @@ nv30_depth_stencil_alpha_state_create(struct pipe_context *pipe,
        }
 
        so_ref(so, &zsaso->so);
+       so_ref(NULL, &so);
        zsaso->pipe = *cso;
        return (void *)zsaso;
 }
@@ -592,7 +595,7 @@ nv30_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
        struct nv30_context *nv30 = nv30_context(pipe);
 
        nv30->constbuf[shader] = buf->buffer;
-       nv30->constbuf_nr[shader] = buf->size / (4 * sizeof(float));
+       nv30->constbuf_nr[shader] = buf->buffer->size / (4 * sizeof(float));
 
        if (shader == PIPE_SHADER_VERTEX) {
                nv30->dirty |= NV30_NEW_VERTPROG;