summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-03-02 15:28:24 +1100
committerBen Skeggs <[email protected]>2008-03-02 15:28:24 +1100
commit59d4b7cc626704dbbd9c817019ec2dd9183322ad (patch)
tree617c0be9cee583689656262697bd64bc00b8ed42
parentb560ed2444383b9634786fe742b8cb6f5cdfc781 (diff)
nv40: fix segv when app "skips" texture units.
-rw-r--r--src/gallium/drivers/nv40/nv40_state_emit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv40/nv40_state_emit.c b/src/gallium/drivers/nv40/nv40_state_emit.c
index a95e2472e2b..9f268640e00 100644
--- a/src/gallium/drivers/nv40/nv40_state_emit.c
+++ b/src/gallium/drivers/nv40/nv40_state_emit.c
@@ -67,7 +67,7 @@ nv40_state_emit(struct nv40_context *nv40)
if (nv40->pctx_id != screen->cur_pctx) {
for (i = 0; i < NV40_STATE_MAX; i++) {
- if (screen->state[i] != state->hw[i] && state->hw[i])
+ if (state->hw[i] && screen->state[i] != state->hw[i])
state->dirty |= (1ULL << i);
}
@@ -84,6 +84,8 @@ nv40_state_emit(struct nv40_context *nv40)
so_emit_reloc_markers(nv40->nvws, state->hw[NV40_STATE_FB]);
for (i = 0, samplers = state->fp_samplers; i < 16 && samplers; i++) {
+ if (!(samplers & (1 << i)))
+ continue;
so_emit_reloc_markers(nv40->nvws,
state->hw[NV40_STATE_FRAGTEX0+i]);
samplers &= ~(1ULL << i);