[Nouveau] NV40 Cubic Texture HW Mip Map Generation

jb17bsome jedynamic at bellsouth.net
Sat Apr 18 18:29:27 PDT 2009


On Sat, 18 Apr 2009 21:13:23 -0400
Younes Manton <younes.m at gmail.com> wrote:

> On Fri, Apr 17, 2009 at 1:59 AM, jb17bsome <jedynamic at bellsouth.net>
> wrote:
> > Hello,
> >        I have been looking at cubic texture mapping for a bit, and I
> >        have found that hw mipmap generation doesn't work at all or
> >        the textures are all messed up (normal 2d work fine). This is
> >        with linear textures.  Also of note is that software mipmap
> >        generation works fine.
> >
> >        I have done sanity checks for the miptree pitches, offsets,
> > etc and everything seems to match up fine for both the hw and sw
> >        paths.
> >
> >        Any thoughts on what could be wrong?
> >
> > jb17bsome
> 
> I was going to take a look, but apparently we don't have the cube_map
> extensions hooked up, and I'm not sure how to do that with Mesa and
> Gallium, and also there are no cube map tests in progs. Do you have a
> patch and some test code? I don't know why it wouldn't work, cube maps
> should work with the auto mipmap generation method they're using in
> Mesa currently.
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau

Try progs/demos/cubemap.c.  You just have to enable hw gen of
mipmaps: 
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -50,7 +50,7 @@ static GLboolean use_vertex_arrays = GL_FALSE;
 static GLboolean anim = GL_TRUE;
 static GLboolean NoClear = GL_FALSE;
 static GLint FrameParity = 0;
-static GLenum FilterIndex = 0;
+static GLenum FilterIndex = 11;
 static GLint ClampIndex = 0;


@@ -477,7 +477,9 @@ static void load(GLenum target, const char *filename,
       }
    }

-   gluBuild2DMipmaps(target, GL_RGB, w, h, format, GL_UNSIGNED_BYTE, img);
+   //gluBuild2DMipmaps(target, GL_RGB, w, h, format, GL_UNSIGNED_BYTE, img);
+   glTexImage2D(target, 0, GL_RGB, w, h, 0, format, GL_UNSIGNED_BYTE, img);
+   glGenerateMipmapEXT(GL_TEXTURE_CUBE_MAP_ARB); 
    free(img);
 }


More information about the Nouveau mailing list