dri/radeon: test for FEATURE defines
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_texture.c
index 2b655fbd953f8ebcc73c57d0fe18b7845f48fa36..8c6a50d2f0df824da5dff8c7cc16a41c6a3d40bd 100644 (file)
@@ -39,6 +39,7 @@
 #include "main/texstore.h"
 #include "main/teximage.h"
 #include "main/texobj.h"
+#include "drivers/common/meta.h"
 
 #include "xmlpool.h"           /* for symbolic values of enum-type options */
 
@@ -294,9 +295,13 @@ void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_objec
                radeon_firevertices(rmesa);
        }
 
-       radeon_teximage_map(baseimage, GL_FALSE);
-       radeon_generate_mipmap(ctx, target, texObj);
-       radeon_teximage_unmap(baseimage);
+       if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
+               radeon_teximage_map(baseimage, GL_FALSE);
+               radeon_generate_mipmap(ctx, target, texObj);
+               radeon_teximage_unmap(baseimage);
+       } else {
+               _mesa_meta_GenerateMipmap(ctx, target, texObj);
+       }
 }
 
 
@@ -546,7 +551,7 @@ gl_format radeonChooseTextureFormat(GLcontext * ctx,
        case GL_SRGB8_ALPHA8:
        case GL_COMPRESSED_SRGB:
        case GL_COMPRESSED_SRGB_ALPHA:
-               return MESA_FORMAT_SRGBA8;
+               return MESA_FORMAT_SARGB8;
 
        case GL_SLUMINANCE:
        case GL_SLUMINANCE8: