static INLINE void
so_ref(struct nouveau_stateobj *ref, struct nouveau_stateobj **pso)
{
- struct nouveau_stateobj *so;
-
- so = *pso;
- if (so) {
- if (--so->refcount <= 0) {
- free(so->push);
- free(so->reloc);
- free(so);
- }
- *pso = NULL;
- }
+ struct nouveau_stateobj *so = *pso;
if (ref) {
ref->refcount++;
- *pso = ref;
}
+
+ if (so && --so->refcount <= 0) {
+ free(so->push);
+ free(so->reloc);
+ free(so);
+ }
+
+ *pso = ref;
}
static INLINE void
nv40->hw_dirty &= ~NV40_NEW_STIPPLE;
}
- if (nv40->hw_dirty & NV40_NEW_FRAGPROG)
+ if (nv40->hw_dirty & NV40_NEW_FRAGPROG) {
so_emit(nv40->nvws, nv40->state.fragprog);
+ nv40->hw_dirty &= ~NV40_NEW_FRAGPROG;
+ }
if (nv40->dirty_samplers || (nv40->dirty & NV40_NEW_FRAGPROG)) {
nv40_fragtex_bind(nv40);
nv40->dirty &= ~NV40_NEW_FRAGPROG;
}
- if (nv40->dirty & NV40_NEW_VERTPROG) {
+ if (nv40->hw_dirty & NV40_NEW_VERTPROG) {
so_emit(nv40->nvws, nv40->state.vertprog);
- nv40->dirty &= ~NV40_NEW_VERTPROG;
+ nv40->hw_dirty &= ~NV40_NEW_VERTPROG;
}
nv40->dirty_samplers = 0;