summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv40/nv40_fragprog.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-02-18 17:36:24 +1100
committerBen Skeggs <[email protected]>2008-02-18 17:36:24 +1100
commit9a5dd26fe22c37b85787130a2b724e6e8ef4f553 (patch)
treec3c8d0c735b1b24b9bbb0472318cbef671737997 /src/gallium/drivers/nv40/nv40_fragprog.c
parent4a9cb97bbf6961cc4106c4c54e59296a74e889e9 (diff)
nv40: and vertprog..
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_fragprog.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_fragprog.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv40/nv40_fragprog.c b/src/gallium/drivers/nv40/nv40_fragprog.c
index bfc75eb4620..77ac8ab2c61 100644
--- a/src/gallium/drivers/nv40/nv40_fragprog.c
+++ b/src/gallium/drivers/nv40/nv40_fragprog.c
@@ -795,7 +795,6 @@ nv40_fragprog_validate(struct nv40_context *nv40)
nv40->pipe_state.constbuf[PIPE_SHADER_FRAGMENT];
struct pipe_winsys *ws = nv40->pipe.winsys;
struct nouveau_stateobj *so;
- unsigned new_program = FALSE;
int i;
if (fp->translated)
@@ -806,7 +805,6 @@ nv40_fragprog_validate(struct nv40_context *nv40)
nv40->fallback |= NV40_FALLBACK_RAST;
return FALSE;
}
- new_program = TRUE;
fp->buffer = ws->buffer_create(ws, 0x100, 0, fp->insn_len * 4);
nv40_fragprog_upload(nv40, fp);
@@ -843,8 +841,12 @@ update_constants:
nv40_fragprog_upload(nv40, fp);
}
- so_ref(fp->so, &nv40->state.fragprog);
- return new_program;
+ if (fp->so != nv40->state.fragprog) {
+ so_ref(fp->so, &nv40->state.fragprog);
+ return TRUE;
+ }
+
+ return FALSE;
}
void