extern void nv40_fragprog_destroy(struct nv40_context *,
struct nv40_fragment_program *);
+/* nv40_fragtex.c */
+extern void nv40_fragtex_bind(struct nv40_context *);
+
/* nv40_state.c and friends */
extern void nv40_emit_hw_state(struct nv40_context *nv40);
extern void nv40_state_tex_update(struct nv40_context *nv40);
};
static struct nv40_texture_format *
-nv40_tex_format(uint pipe_format)
+nv40_fragtex_format(uint pipe_format)
{
struct nv40_texture_format *tf = nv40_texture_formats;
static void
-nv40_tex_unit_enable(struct nv40_context *nv40, int unit)
+nv40_fragtex_build(struct nv40_context *nv40, int unit)
{
struct nv40_sampler_state *ps = nv40->tex_sampler[unit];
struct nv40_miptree *nv40mt = nv40->tex_miptree[unit];
uint32_t txf, txs, txp;
int swizzled = 0; /*XXX: implement in region code? */
- tf = nv40_tex_format(pt->format);
- if (!tf || !tf->defined) {
- NOUVEAU_ERR("Unsupported texture format: 0x%x\n", pt->format);
- return;
- }
+ tf = nv40_fragtex_format(pt->format);
+ if (!tf)
+ assert(0);
txf = ps->fmt;
txf |= tf->format | 0x8000;
}
void
-nv40_state_tex_update(struct nv40_context *nv40)
+nv40_fragtex_bind(struct nv40_context *nv40)
{
struct nv40_fragment_program *fp = nv40->fragprog.active;
unsigned samplers, unit;
unit = ffs(samplers) - 1;
samplers &= ~(1 << unit);
- nv40_tex_unit_enable(nv40, unit);
+ nv40_fragtex_build(nv40, unit);
}
nv40->fp_samplers = fp->samplers;
}
if (nv40->dirty_samplers || (nv40->dirty & NV40_NEW_FRAGPROG)) {
- nv40_state_tex_update(nv40);
+ nv40_fragtex_bind(nv40);
BEGIN_RING(curie, NV40TCL_TEX_CACHE_CTL, 1);
OUT_RING (2);