diff options
author | Ben Skeggs <[email protected]> | 2008-03-02 15:28:24 +1100 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-03-02 15:28:24 +1100 |
commit | 59d4b7cc626704dbbd9c817019ec2dd9183322ad (patch) | |
tree | 617c0be9cee583689656262697bd64bc00b8ed42 /src/gallium/drivers | |
parent | b560ed2444383b9634786fe742b8cb6f5cdfc781 (diff) |
nv40: fix segv when app "skips" texture units.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nv40/nv40_state_emit.c | 4 |
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); |