diff options
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_state_emit.c')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_state_emit.c | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/src/gallium/drivers/nv30/nv30_state_emit.c b/src/gallium/drivers/nv30/nv30_state_emit.c index deefe7fd8d..6df93618da 100644 --- a/src/gallium/drivers/nv30/nv30_state_emit.c +++ b/src/gallium/drivers/nv30/nv30_state_emit.c @@ -1,7 +1,7 @@ #include "nv30_context.h" -#include "nv30_state.h" +#include "nvfx_state.h" -static struct nv30_state_entry *render_states[] = { +static struct nvfx_state_entry *render_states[] = { &nv30_state_framebuffer, &nv30_state_rasterizer, &nv30_state_scissor, @@ -19,49 +19,48 @@ static struct nv30_state_entry *render_states[] = { }; static void -nv30_state_do_validate(struct nv30_context *nv30, - struct nv30_state_entry **states) +nv30_state_do_validate(struct nvfx_context *nvfx, + struct nvfx_state_entry **states) { while (*states) { - struct nv30_state_entry *e = *states; + struct nvfx_state_entry *e = *states; - if (nv30->dirty & e->dirty.pipe) { - if (e->validate(nv30)) { - nv30->state.dirty |= (1ULL << e->dirty.hw); - } + if (nvfx->dirty & e->dirty.pipe) { + if (e->validate(nvfx)) + nvfx->state.dirty |= (1ULL << e->dirty.hw); } states++; } - nv30->dirty = 0; + nvfx->dirty = 0; } void -nv30_state_emit(struct nv30_context *nv30) +nv30_state_emit(struct nvfx_context *nvfx) { - struct nouveau_channel *chan = nv30->screen->base.channel; - struct nv30_state *state = &nv30->state; - struct nv30_screen *screen = nv30->screen; + struct nouveau_channel *chan = nvfx->screen->base.channel; + struct nvfx_state *state = &nvfx->state; + struct nvfx_screen *screen = nvfx->screen; unsigned i; uint64_t states; /* XXX: racy! */ - if (nv30 != screen->cur_ctx) { - for (i = 0; i < NV30_STATE_MAX; i++) { + if (nvfx != screen->cur_ctx) { + for (i = 0; i < NVFX_STATE_MAX; i++) { if (state->hw[i] && screen->state[i] != state->hw[i]) state->dirty |= (1ULL << i); } - screen->cur_ctx = nv30; + screen->cur_ctx = nvfx; } for (i = 0, states = state->dirty; states; i++) { if (!(states & (1ULL << i))) continue; - so_ref (state->hw[i], &nv30->screen->state[i]); + so_ref (state->hw[i], &nvfx->screen->state[i]); if (state->hw[i]) - so_emit(chan, nv30->screen->state[i]); + so_emit(chan, nvfx->screen->state[i]); states &= ~(1ULL << i); } @@ -71,48 +70,48 @@ nv30_state_emit(struct nv30_context *nv30) void nv30_state_flush_notify(struct nouveau_channel *chan) { - struct nv30_context *nv30 = chan->user_private; - struct nv30_state *state = &nv30->state; + struct nvfx_context *nvfx = chan->user_private; + struct nvfx_state *state = &nvfx->state; unsigned i, samplers; - so_emit_reloc_markers(chan, state->hw[NV30_STATE_FB]); + so_emit_reloc_markers(chan, state->hw[NVFX_STATE_FB]); for (i = 0, samplers = state->fp_samplers; i < 16 && samplers; i++) { if (!(samplers & (1 << i))) continue; so_emit_reloc_markers(chan, - state->hw[NV30_STATE_FRAGTEX0+i]); + state->hw[NVFX_STATE_FRAGTEX0+i]); samplers &= ~(1ULL << i); } - so_emit_reloc_markers(chan, state->hw[NV30_STATE_FRAGPROG]); - if (state->hw[NV30_STATE_VTXBUF] /*&& nv30->render_mode == HW*/) - so_emit_reloc_markers(chan, state->hw[NV30_STATE_VTXBUF]); + so_emit_reloc_markers(chan, state->hw[NVFX_STATE_FRAGPROG]); + if (state->hw[NVFX_STATE_VTXBUF] /*&& nvfx->render_mode == HW*/) + so_emit_reloc_markers(chan, state->hw[NVFX_STATE_VTXBUF]); } boolean -nv30_state_validate(struct nv30_context *nv30) +nv30_state_validate(struct nvfx_context *nvfx) { #if 0 - boolean was_sw = nv30->fallback_swtnl ? TRUE : FALSE; + boolean was_sw = nvfx->fallback_swtnl ? TRUE : FALSE; - if (nv30->render_mode != HW) { + if (nvfx->render_mode != HW) { /* Don't even bother trying to go back to hw if none * of the states that caused swtnl previously have changed. */ - if ((nv30->fallback_swtnl & nv30->dirty) - != nv30->fallback_swtnl) + if ((nvfx->fallback_swtnl & nvfx->dirty) + != nvfx->fallback_swtnl) return FALSE; /* Attempt to go to hwtnl again */ - nv30->pipe.flush(&nv30->pipe, 0, NULL); - nv30->dirty |= (NV30_NEW_VIEWPORT | - NV30_NEW_VERTPROG | - NV30_NEW_ARRAYS); - nv30->render_mode = HW; + nvfx->pipe.flush(&nvfx->pipe, 0, NULL); + nvfx->dirty |= (NVFX_NEW_VIEWPORT | + NVFX_NEW_VERTPROG | + NVFX_NEW_ARRAYS); + nvfx->render_mode = HW; } #endif - nv30_state_do_validate(nv30, render_states); + nv30_state_do_validate(nvfx, render_states); #if 0 - if (nv30->fallback_swtnl || nv30->fallback_swrast) + if (nvfx->fallback_swtnl || nvfx->fallback_swrast) return FALSE; if (was_sw) |