nouveau: interface updates
authorBen Skeggs <skeggsb@gmail.com>
Sat, 9 Feb 2008 05:25:29 +0000 (16:25 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Sat, 9 Feb 2008 05:33:32 +0000 (16:33 +1100)
src/mesa/pipe/nouveau/nouveau_gldefs.h
src/mesa/pipe/nv40/nv40_context.c
src/mesa/pipe/nv40/nv40_fragprog.c
src/mesa/pipe/nv40/nv40_fragtex.c
src/mesa/pipe/nv40/nv40_miptree.c
src/mesa/pipe/nv50/nv50_miptree.c

index 8ba3bdef64976801f4e95c7b84ee4a30daaaafb2..e1015c93a2757c7209f4f8d55451d20ef19cb403 100644 (file)
@@ -189,7 +189,7 @@ nvgl_primitive(unsigned prim) {
        case PIPE_PRIM_POLYGON:
                return 0x000a;
        default:
-               assert(0);
+               return 0x0001;
        }
 }
 
index d0d9583e32eb6a1e67182f5527e32835f3fcb534..2754429c5b95156dabb5f2227c0b98041df3b7d5 100644 (file)
@@ -71,6 +71,8 @@ nv40_get_paramf(struct pipe_context *pipe, int param)
                return 16.0;
        case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
                return 4.0;
+       case PIPE_CAP_BITMAP_TEXCOORD_BIAS:
+               return 0.0;
        default:
                NOUVEAU_ERR("Unknown PIPE_CAP %d\n", param);
                return 0.0;
index b351c853866affcc61dc65da0f370da8ee413e24..86cf74835e1fd6e8a7b1fc2a13278869fa250cc8 100644 (file)
@@ -826,6 +826,7 @@ nv40_fragprog_bind(struct nv40_context *nv40, struct nv40_fragment_program *fp)
 
        so_emit(nv40->nvws, so);
        so_ref(so, &fp->so);
+       so_ref(NULL, &so);
 
        nv40->fragprog.active = fp;
 }
index 283d49704af91d06aa7994efab462a06540e28d0..c87e3618317dc6c0b09244a6e867d404e14bfb16 100644 (file)
@@ -121,6 +121,7 @@ nv40_fragtex_build(struct nv40_context *nv40, int unit)
 
        so_emit(nv40->nvws, so);
        so_ref (so, &nv40->so_fragtex[unit]);
+       so_ref (NULL, &so);
 }
 
 void
index 48062d1ae8a506610dc24ea108f94ab4945535d2..df70feaa05793cff664f709cff254977c37603e3 100644 (file)
@@ -53,27 +53,26 @@ nv40_miptree_layout(struct nv40_miptree *nv40mt)
        nv40mt->total_size = offset;
 }
 
-static void
-nv40_miptree_create(struct pipe_context *pipe, struct pipe_texture **pt)
+static struct pipe_texture *
+nv40_miptree_create(struct pipe_context *pipe, const struct pipe_texture *pt)
 {
        struct pipe_winsys *ws = pipe->winsys;
-       struct nv40_miptree *nv40mt;
-
-       nv40mt = realloc(*pt, sizeof(struct nv40_miptree));
-       if (!nv40mt)
-               return;
-       *pt = NULL;
-
-       nv40_miptree_layout(nv40mt);
-
-       nv40mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
-                                          nv40mt->total_size);
-       if (!nv40mt->buffer) {
-               free(nv40mt);
-               return;
+       struct nv40_miptree *mt;
+
+       mt = malloc(sizeof(struct nv40_miptree));
+       if (!mt)
+               return NULL;
+       mt->base = *pt;
+       nv40_miptree_layout(mt);
+
+       mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+                                      mt->total_size);
+       if (!mt->buffer) {
+               free(mt);
+               return NULL;
        }
-       
-       *pt = &nv40mt->base;
+
+       return &mt->base;
 }
 
 static void
index 51442d64f3ead7ad584b1428d3f1581ca109fb6e..0c034ed4387a791a0c3d00615f5dba726d0c53e2 100644 (file)
@@ -4,10 +4,11 @@
 
 #include "nv50_context.h"
 
-static void
-nv50_miptree_create(struct pipe_context *pipe, struct pipe_texture **pt)
+static struct pipe_texture *
+nv50_miptree_create(struct pipe_context *pipe, const struct pipe_texture *pt)
 {
        NOUVEAU_ERR("unimplemented\n");
+       return NULL;
 }
 
 static void