diff options
Diffstat (limited to 'src/gallium/drivers/nvfx/nv30_fragtex.c')
-rw-r--r-- | src/gallium/drivers/nvfx/nv30_fragtex.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/gallium/drivers/nvfx/nv30_fragtex.c b/src/gallium/drivers/nvfx/nv30_fragtex.c index e0356783ea0..dec073ac900 100644 --- a/src/gallium/drivers/nvfx/nv30_fragtex.c +++ b/src/gallium/drivers/nvfx/nv30_fragtex.c @@ -88,21 +88,21 @@ nv30_fragtex_format(uint pipe_format) } -struct nouveau_stateobj * -nv30_fragtex_build(struct nvfx_context *nvfx, int unit) +void +nv30_fragtex_set(struct nvfx_context *nvfx, int unit) { struct nvfx_sampler_state *ps = nvfx->tex_sampler[unit]; struct nvfx_miptree *nv30mt = (struct nvfx_miptree *)nvfx->fragment_sampler_views[unit]->texture; struct pipe_resource *pt = &nv30mt->base.base; struct nouveau_bo *bo = nv30mt->base.bo; struct nv30_texture_format *tf; - struct nouveau_stateobj *so; + struct nouveau_channel* chan = nvfx->screen->base.channel; uint32_t txf, txs; unsigned tex_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; tf = nv30_fragtex_format(pt->format); if (!tf) - return NULL; + return; txf = tf->format; txf |= ((pt->last_level>0) ? NV34TCL_TX_FORMAT_MIPMAP : 0); @@ -126,23 +126,24 @@ nv30_fragtex_build(struct nvfx_context *nvfx, int unit) break; default: NOUVEAU_ERR("Unknown target %d\n", pt->target); - return NULL; + return; } txs = tf->swizzle; - so = so_new(1, 8, 2); - 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, + MARK_RING(chan, 9, 2); + OUT_RING(chan, RING_3D(NV34TCL_TX_OFFSET(unit), 8)); + OUT_RELOC(chan, bo, 0, tex_flags | NOUVEAU_BO_LOW, 0, 0); + OUT_RELOC(chan, bo, txf, tex_flags | NOUVEAU_BO_OR, NV34TCL_TX_FORMAT_DMA0, NV34TCL_TX_FORMAT_DMA1); - so_data (so, ps->wrap); - so_data (so, NV34TCL_TX_ENABLE_ENABLE | ps->en); - so_data (so, txs); - so_data (so, ps->filt | 0x2000 /*voodoo*/); - so_data (so, (pt->width0 << NV34TCL_TX_NPOT_SIZE_W_SHIFT) | + OUT_RING(chan, ps->wrap); + OUT_RING(chan, NV34TCL_TX_ENABLE_ENABLE | ps->en); + OUT_RING(chan, txs); + OUT_RING(chan, ps->filt | 0x2000 /*voodoo*/); + OUT_RING(chan, (pt->width0 << NV34TCL_TX_NPOT_SIZE_W_SHIFT) | pt->height0); - so_data (so, ps->bcol); + OUT_RING(chan, ps->bcol); - return so; + nvfx->hw_txf[unit] = txf; + nvfx->hw_samplers |= (1 << unit); } |