nv: Use util_format_name().
[mesa.git] / src / gallium / drivers / nv30 / nv30_fragtex.c
index b3293ee700dc7ab023bb1939d699115b0557cbc1..9f4a104f6730c9eaa9e0e537ca61258085879a08 100644 (file)
@@ -1,3 +1,5 @@
+#include "util/u_format.h"
+
 #include "nv30_context.h"
 #include "nouveau/nouveau_util.h"
 
@@ -43,7 +45,6 @@ static struct nv30_texture_format *
 nv30_fragtex_format(uint pipe_format)
 {
        struct nv30_texture_format *tf = nv30_texture_formats;
-       char fs[128];
 
        while (tf->defined) {
                if (tf->pipe == pipe_format)
@@ -51,7 +52,7 @@ nv30_fragtex_format(uint pipe_format)
                tf++;
        }
 
-       NOUVEAU_ERR("unknown texture format %s\n", pf_name(pipe_format));
+       NOUVEAU_ERR("unknown texture format %s\n", util_format_name(pipe_format));
        return NULL;
 }
 
@@ -65,7 +66,7 @@ nv30_fragtex_build(struct nv30_context *nv30, int unit)
        struct nouveau_bo *bo = nouveau_bo(nv30mt->buffer);
        struct nv30_texture_format *tf;
        struct nouveau_stateobj *so;
-       uint32_t txf, txs , txp;
+       uint32_t txf, txs;
        unsigned tex_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD;
 
        tf = nv30_fragtex_format(pt->format);
@@ -97,16 +98,9 @@ nv30_fragtex_build(struct nv30_context *nv30, int unit)
                return NULL;
        }
 
-       if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) {
-               txp = 0;
-       } else {
-               txp  = nv30mt->level[0].pitch;
-               txf |= (1<<13) /*FIXME: NV34TCL_TX_FORMAT_LINEAR ? */;
-       }
-
        txs = tf->swizzle;
 
-       so = so_new(16, 2);
+       so = so_new(1, 8, 2);
        so_method(so, nv30->screen->rankine, 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,
@@ -135,7 +129,7 @@ nv30_fragtex_validate(struct nv30_context *nv30)
                unit = ffs(samplers) - 1;
                samplers &= ~(1 << unit);
 
-               so = so_new(2, 0);
+               so = so_new(1, 1, 0);
                so_method(so, nv30->screen->rankine, NV34TCL_TX_ENABLE(unit), 1);
                so_data  (so, 0);
                so_ref(so, &nv30->state.hw[NV30_STATE_FRAGTEX0 + unit]);