mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
nv40: stateobj start out with 0 refcount
This commit is contained in:
parent
c2e36bdd1a
commit
7b938431d0
11 changed files with 7 additions and 17 deletions
|
|
@ -32,7 +32,7 @@ so_new(unsigned push, unsigned reloc)
|
|||
struct nouveau_stateobj *so;
|
||||
|
||||
so = MALLOC(sizeof(struct nouveau_stateobj));
|
||||
so->refcount = 1;
|
||||
so->refcount = 0;
|
||||
so->push = MALLOC(sizeof(unsigned) * push);
|
||||
so->reloc = MALLOC(sizeof(struct nouveau_stateobj_reloc) * reloc);
|
||||
|
||||
|
|
|
|||
|
|
@ -817,7 +817,6 @@ nv40_fragprog_validate(struct nv40_context *nv40)
|
|||
so_method(so, nv40->hw->curie, NV40TCL_FP_CONTROL, 1);
|
||||
so_data (so, fp->fp_control);
|
||||
so_ref(so, &fp->so);
|
||||
so_ref(NULL, &so);
|
||||
|
||||
update_constants:
|
||||
if (fp->nr_consts) {
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ nv40_fragtex_validate(struct nv40_context *nv40)
|
|||
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));
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +147,6 @@ nv40_fragtex_validate(struct nv40_context *nv40)
|
|||
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ nv40_blend_state_create(struct pipe_context *pipe,
|
|||
{
|
||||
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) {
|
||||
|
|
@ -47,7 +47,7 @@ nv40_blend_state_create(struct pipe_context *pipe,
|
|||
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;
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
|
|||
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;
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
|
|||
so_data(so, 0);
|
||||
}
|
||||
|
||||
rsso->so = so;
|
||||
so_ref(so, &rsso->so);
|
||||
rsso->pipe = *cso;
|
||||
return (void *)rsso;
|
||||
}
|
||||
|
|
@ -417,7 +417,7 @@ nv40_depth_stencil_alpha_state_create(struct pipe_context *pipe,
|
|||
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);
|
||||
|
|
@ -460,7 +460,7 @@ nv40_depth_stencil_alpha_state_create(struct pipe_context *pipe,
|
|||
so_data (so, 0);
|
||||
}
|
||||
|
||||
zsaso->so = so;
|
||||
so_ref(so, &zsaso->so);
|
||||
zsaso->pipe = *cso;
|
||||
return (void *)zsaso;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40)
|
|||
so_data (so, ((h - 1) << 16) | 0);
|
||||
|
||||
so_ref(so, &nv40->state.hw[NV40_STATE_FB]);
|
||||
so_ref(NULL, &so);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ nv40_state_scissor_validate(struct nv40_context *nv40)
|
|||
}
|
||||
|
||||
so_ref(so, &nv40->state.hw[NV40_STATE_SCISSOR]);
|
||||
so_ref(NULL, &so);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ nv40_state_stipple_validate(struct nv40_context *nv40)
|
|||
}
|
||||
|
||||
so_ref(so, &nv40->state.hw[NV40_STATE_STIPPLE]);
|
||||
so_ref(NULL, &so);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ nv40_state_viewport_validate(struct nv40_context *nv40)
|
|||
so_data (so, fui(vpt->scale[3]));
|
||||
|
||||
so_ref(so, &nv40->state.hw[NV40_STATE_VIEWPORT]);
|
||||
so_ref(NULL, &so);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@ nv40_vbo_arrays_update(struct nv40_context *nv40, struct pipe_buffer *ib,
|
|||
so_emit(nv40->nvws, vtxfmt);
|
||||
so_emit(nv40->nvws, vtxbuf);
|
||||
so_ref (vtxbuf, &nv40->so_vtxbuf);
|
||||
so_ref (NULL, &vtxbuf);
|
||||
so_ref (NULL, &vtxfmt);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -678,7 +678,6 @@ check_gpu_resources:
|
|||
so_data (so, vp->ir);
|
||||
so_data (so, vp->or);
|
||||
so_ref(so, &vp->so);
|
||||
so_ref(NULL, &so);
|
||||
|
||||
upload_code = TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue