summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv40/nv40_fragtex.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-02-20 18:37:43 +0100
committerYounes Manton <[email protected]>2010-03-15 00:03:01 -0400
commitb8e56d4cddbd9c491b940e3ce5974c526802c752 (patch)
tree6ae0a1030c6a43c6596393b787cea3d7b7e23352 /src/gallium/drivers/nv40/nv40_fragtex.c
parentd673c92810636dcc6de33d3618d494ce9f5717c1 (diff)
nv30, nv40: unify all structures and headers, except shaders
This patch unifies nv[34]0_screen.h, nv[34]0_context.h and nv[34]0_state.h The unified files are put in a new "nvfx" directory. nv30_context.h and nv40_context.h still exist to hold the function prototypes and include nvfx_context.h nv[34]0_screen.h and nv[34]0_state.h are deleted, replaced by the unified versions. nv40 includes some extra fields for swtnl and user clip planes support. These fields will be unused on nv30 until that functionality gets added to it too (by unification with nv40).
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_fragtex.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_fragtex.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gallium/drivers/nv40/nv40_fragtex.c b/src/gallium/drivers/nv40/nv40_fragtex.c
index 4c26f3cb123..0b46a5313bd 100644
--- a/src/gallium/drivers/nv40/nv40_fragtex.c
+++ b/src/gallium/drivers/nv40/nv40_fragtex.c
@@ -61,10 +61,10 @@ nv40_fragtex_format(uint pipe_format)
static struct nouveau_stateobj *
-nv40_fragtex_build(struct nv40_context *nv40, int unit)
+nv40_fragtex_build(struct nvfx_context *nvfx, int unit)
{
- struct nv40_sampler_state *ps = nv40->tex_sampler[unit];
- struct nv40_miptree *nv40mt = nv40->tex_miptree[unit];
+ struct nvfx_sampler_state *ps = nvfx->tex_sampler[unit];
+ struct nvfx_miptree *nv40mt = nvfx->tex_miptree[unit];
struct nouveau_bo *bo = nouveau_bo(nv40mt->buffer);
struct pipe_texture *pt = &nv40mt->base;
struct nv40_texture_format *tf;
@@ -111,7 +111,7 @@ nv40_fragtex_build(struct nv40_context *nv40, int unit)
txs = tf->swizzle;
so = so_new(2, 9, 2);
- so_method(so, nv40->screen->eng3d, NV34TCL_TX_OFFSET(unit), 8);
+ so_method(so, nvfx->screen->eng3d, NV34TCL_TX_OFFSET(unit), 8);
so_reloc (so, bo, 0, tex_flags | NOUVEAU_BO_LOW, 0, 0);
so_reloc (so, bo, txf, tex_flags | NOUVEAU_BO_OR,
NV34TCL_TX_FORMAT_DMA0, NV34TCL_TX_FORMAT_DMA1);
@@ -122,17 +122,17 @@ nv40_fragtex_build(struct nv40_context *nv40, int unit)
so_data (so, (pt->width0 << NV34TCL_TX_NPOT_SIZE_W_SHIFT) |
pt->height0);
so_data (so, ps->bcol);
- so_method(so, nv40->screen->eng3d, NV40TCL_TEX_SIZE1(unit), 1);
+ so_method(so, nvfx->screen->eng3d, NV40TCL_TEX_SIZE1(unit), 1);
so_data (so, (pt->depth0 << NV40TCL_TEX_SIZE1_DEPTH_SHIFT) | txp);
return so;
}
static boolean
-nv40_fragtex_validate(struct nv40_context *nv40)
+nv40_fragtex_validate(struct nvfx_context *nvfx)
{
- struct nv40_fragment_program *fp = nv40->fragprog;
- struct nv40_state *state = &nv40->state;
+ struct nvfx_fragment_program *fp = nvfx->fragprog;
+ struct nvfx_state *state = &nvfx->state;
struct nouveau_stateobj *so;
unsigned samplers, unit;
@@ -142,31 +142,31 @@ nv40_fragtex_validate(struct nv40_context *nv40)
samplers &= ~(1 << unit);
so = so_new(1, 1, 0);
- so_method(so, nv40->screen->eng3d, NV34TCL_TX_ENABLE(unit), 1);
+ so_method(so, nvfx->screen->eng3d, NV34TCL_TX_ENABLE(unit), 1);
so_data (so, 0);
- so_ref(so, &nv40->state.hw[NV40_STATE_FRAGTEX0 + unit]);
- state->dirty |= (1ULL << (NV40_STATE_FRAGTEX0 + unit));
+ so_ref(so, &nvfx->state.hw[NVFX_STATE_FRAGTEX0 + unit]);
+ state->dirty |= (1ULL << (NVFX_STATE_FRAGTEX0 + unit));
}
- samplers = nv40->dirty_samplers & fp->samplers;
+ samplers = nvfx->dirty_samplers & fp->samplers;
while (samplers) {
unit = ffs(samplers) - 1;
samplers &= ~(1 << unit);
- so = nv40_fragtex_build(nv40, unit);
- so_ref(so, &nv40->state.hw[NV40_STATE_FRAGTEX0 + unit]);
+ so = nv40_fragtex_build(nvfx, unit);
+ so_ref(so, &nvfx->state.hw[NVFX_STATE_FRAGTEX0 + unit]);
so_ref(NULL, &so);
- state->dirty |= (1ULL << (NV40_STATE_FRAGTEX0 + unit));
+ state->dirty |= (1ULL << (NVFX_STATE_FRAGTEX0 + unit));
}
- nv40->state.fp_samplers = fp->samplers;
+ nvfx->state.fp_samplers = fp->samplers;
return FALSE;
}
-struct nv40_state_entry nv40_state_fragtex = {
+struct nvfx_state_entry nv40_state_fragtex = {
.validate = nv40_fragtex_validate,
.dirty = {
- .pipe = NV40_NEW_SAMPLER | NV40_NEW_FRAGPROG,
+ .pipe = NVFX_NEW_SAMPLER | NVFX_NEW_FRAGPROG,
.hw = 0
}
};