Skip to contentSkip to conversation

NV40 Cubic Texture HW Mip Map Generation

DISCUSSION jb17bsome 2 participants 4 messages Apr 17, 2009 – Apr 19, 2009 3 messages not in the archive

lore
Share & tools
lore

jb17bsome

author
#0 lore raw

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

A message that is not in the archive (sent off-list or not yet received): 20090417015904.6c4b9d20-bEIzoA7YQWm4miubQJdzGGS2/mPcPMSI/[email protected]

#2 lore raw
Quoted 7 lines · On Fri, Apr 17, 2009 at 1:59 AM, jb17bsome…

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.

Quoted 7 lines

       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.

A message that is not in the archive (sent off-list or not yet received): 586c2acd0904181813s6703409eibbf19abe0b994842-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#4 lore raw
Quoted 17 lines · On Sat, 18 Apr 2009 21:13:23 -0400 Younes Manton <[email protected]> wrote:
Quoted 7 lines · On Fri, Apr 17, 2009 at 1:59 AM, jb17bsome <[email protected]> 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.

Quoted 7 lines

       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

Quoted 10 lines

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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

Try progs/demos/cubemap.c. You just have to enable hw gen of mipmaps:

progs/demos/cubemap.c +4 -2
@@ -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);
 }

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 20090418212927.7a922c29-bEIzoA7YQWm4miubQJdzGGS2/mPcPMSI/[email protected]

#6 lore raw
Quoted 2 lines · On Sat, Apr 18, 2009 at 9:29 PM, jb17bsome…

Try progs/demos/cubemap.c.  You just have to enable hw gen of mipmaps:

Ok I gave it a try, I get strange pink corruption on the sphere with both gluBuildMipmaps and HW mipmap gen. It seems to happen around the seems of the cube map faces and is related to the shading of the individual tris that make up the sphere, since I can kind of see them when they're pink. Is that what you're seeing too? Couldn't check what the software renderer does because it brought down the server when I ran the demo.

I would say that cubemap+mipmap rendering is broken, not specifically HW mipmap gen, at least for me. No clue what the problem is though, probably need to look at what the blob does.