Enable hardware mipmap generation for radeon.
authorWill Dyson <will.dyson@gmail.com>
Tue, 25 May 2010 05:10:21 +0000 (01:10 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 26 May 2010 22:17:28 +0000 (18:17 -0400)
Use _mesa_meta_GenerateMipmap. It is Fast Enough(tm).

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
src/mesa/drivers/dri/radeon/radeon_texture.c

index 5cb33a4751d22ff62a8d32f0e317b504d30ea59d..bcac125baf474d9bf4b272d6a6e312d25bc8d55f 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);
+       }
 }