The ctx->Driver.GenerateMipmap() hook only expects cubemap face enums, not
CUBE_MAP_ARB, so walk all faces when we encounter that.  Fixes oglconform
fbo.c segfault with both swrast and i965 drivers.
---
 src/mesa/main/fbobject.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4c92d1f..876d691 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1574,9 +1574,17 @@ _mesa_GenerateMipmapEXT(GLenum target)
    texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
    texObj = _mesa_select_tex_object(ctx, texUnit, target);
 
-   /* XXX this might not handle cube maps correctly */
    _mesa_lock_texture(ctx, texObj);
-   ctx->Driver.GenerateMipmap(ctx, target, texObj);
+   if (target == GL_TEXTURE_CUBE_MAP) {
+      int face;
+
+      for (face = 0; face < 6; face++)
+        ctx->Driver.GenerateMipmap(ctx,
+                                   GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face,
+                                   texObj);
+   } else {
+      ctx->Driver.GenerateMipmap(ctx, target, texObj);
+   }
    _mesa_unlock_texture(ctx, texObj);
 }
 
-- 
1.5.6.5


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to