nouveau: rewrite nouveau_stateobj to use BEGIN_RING properly
[mesa.git] / src / gallium / drivers / nv40 / nv40_state_blend.c
index 95e6d7394f466330452b988b6d73878b78528603..3ff00a37f66b7067093a6b5202e08b34a6f26eee 100644 (file)
@@ -18,7 +18,7 @@ struct nv40_state_entry nv40_state_blend = {
 static boolean
 nv40_state_blend_colour_validate(struct nv40_context *nv40)
 {
-       struct nouveau_stateobj *so = so_new(2, 0);
+       struct nouveau_stateobj *so = so_new(1, 1, 0);
        struct pipe_blend_color *bcol = &nv40->blend_colour;
 
        so_method(so, nv40->screen->curie, NV40TCL_BLEND_COLOR, 1);
@@ -28,6 +28,7 @@ nv40_state_blend_colour_validate(struct nv40_context *nv40)
                       (float_to_ubyte(bcol->color[2]) <<  0)));
 
        so_ref(so, &nv40->state.hw[NV40_STATE_BCOL]);
+       so_ref(NULL, &so);
        return TRUE;
 }