From c674a7eb7fb2fd170df7ff5e3cefdddabda1a03f Mon Sep 17 00:00:00 2001 From: Will Dyson Date: Sat, 19 Jun 2010 22:04:45 +0200 Subject: Revert "Fix image_matches_texture_obj() MaxLevel check" This reverts commit a9ee95651131e27d5acf3d10909b5b7e5c8d3e92. It was based on a failure to understand how ther driver allocates memory, and causes a regression with Celestia. Set MaxLevel to dstLevel before allocating new mipmap level. The radeon driver will fail to allocate space for a new level that is outside of BaseLevel..MaxLevel. Set MaxLevel before allocating. Signed-off-by: Maciej Cencora --- src/mesa/drivers/common/meta.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/drivers/common/meta.c') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index fc286851663..35255833821 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2400,6 +2400,9 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, break; } + /* Set MaxLevel large enough to hold the new level when we allocate it */ + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, dstLevel); + /* Create empty dest image */ if (target == GL_TEXTURE_1D) { _mesa_TexImage1D(target, dstLevel, srcImage->InternalFormat, -- cgit v1.2.3