summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-12-06 21:14:56 -0800
committerEric Anholt <[email protected]>2008-12-06 22:41:52 -0800
commitf849d364c22e702e3dda664fa65601d4cf2b55a5 (patch)
tree1487a73188a58969468afcd811e20e078cc18948 /src/mesa/main/fbobject.c
parent8b661a5d33604fd3706cb1825236d72ae2949598 (diff)
mesa: Fix GenerateMipmapEXT(GL_TEXTURE_CUBE_MAP_ARB).
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.
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4c92d1fb5a8..876d691c652 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);
}