so_method(so, nv40->hw->curie, NV40TCL_TEX_ENABLE(unit), 1);
so_data (so, 0);
so_ref(so, &nv40->state.hw[NV40_STATE_FRAGTEX0 + unit]);
- so_ref(NULL, &so);
state->dirty |= (1 << (NV40_STATE_FRAGTEX0 + unit));
}
so = nv40_fragtex_build(nv40, unit);
so_ref(so, &nv40->state.hw[NV40_STATE_FRAGTEX0 + unit]);
- so_ref(NULL, &so);
state->dirty |= (1 << (NV40_STATE_FRAGTEX0 + unit));
}
{
struct nv40_context *nv40 = nv40_context(pipe);
struct nouveau_grobj *curie = nv40->hw->curie;
- struct nv40_blend_state *bso = MALLOC(sizeof(*bso));
+ struct nv40_blend_state *bso = CALLOC(1, sizeof(*bso));
struct nouveau_stateobj *so = so_new(16, 0);
if (cso->blend_enable) {
so_method(so, curie, NV40TCL_DITHER_ENABLE, 1);
so_data (so, cso->dither ? 1 : 0);
- bso->so = so;
+ so_ref(so, &bso->so);
bso->pipe = *cso;
return (void *)bso;
}
const struct pipe_rasterizer_state *cso)
{
struct nv40_context *nv40 = nv40_context(pipe);
- struct nv40_rasterizer_state *rsso = MALLOC(sizeof(*rsso));
+ struct nv40_rasterizer_state *rsso = CALLOC(1, sizeof(*rsso));
struct nouveau_stateobj *so = so_new(32, 0);
struct nouveau_grobj *curie = nv40->hw->curie;
so_data(so, 0);
}
- rsso->so = so;
+ so_ref(so, &rsso->so);
rsso->pipe = *cso;
return (void *)rsso;
}
const struct pipe_depth_stencil_alpha_state *cso)
{
struct nv40_context *nv40 = nv40_context(pipe);
- struct nv40_zsa_state *zsaso = MALLOC(sizeof(*zsaso));
+ struct nv40_zsa_state *zsaso = CALLOC(1, sizeof(*zsaso));
struct nouveau_stateobj *so = so_new(32, 0);
so_method(so, nv40->hw->curie, NV40TCL_DEPTH_FUNC, 3);
so_data (so, 0);
}
- zsaso->so = so;
+ so_ref(so, &zsaso->so);
zsaso->pipe = *cso;
return (void *)zsaso;
}