Bug 27055 - r600: software fallback for readpixels
Summary: r600: software fallback for readpixels
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R600 (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-13 00:54 UTC by Török Edwin
Modified: 2010-03-13 08:51 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Török Edwin 2010-03-13 00:54:08 UTC
RADEON_DEBUG=fall has shown me this while running wine 1.1.40, glsl disabled, orm=backbuffer:

Falling back to sw for ReadPixels (format GL_BGRA, type GL_UNSIGNED_INT_8_8_8_8_REV)

Using latest mesa git.

glxinfo|grep OpenGL
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: Mesa DRI R600 (RV730 9498) 20090101  TCL DRI2
OpenGL version string: 2.0 Mesa 7.9-devel
OpenGL shading language version string: 1.10
Comment 1 Török Edwin 2010-03-13 04:15:55 UTC
This patch appears to solve this case, and piglit doesn't complain. The switch should probably contain more formats though.

diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
index b180c1d..943c034 100644
--- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
+++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
@@ -68,6 +68,12 @@ static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
                     return MESA_FORMAT_ARGB8888_REV;
             }
             break;
+       case GL_BGRA:
+           switch (type) {
+                case GL_UNSIGNED_INT_8_8_8_8_REV:
+                    return MESA_FORMAT_ARGB8888;
+           }
+           break;
     }

     return MESA_FORMAT_NONE;
Comment 2 Maciej Cencora 2010-03-13 05:11:45 UTC
What app are you hitting this fallback with?
Comment 3 Török Edwin 2010-03-13 06:03:14 UTC
(In reply to comment #2)
> What app are you hitting this fallback with?
> 

World of Warcraft running under wine 1.1.40, glsl disabled, orm=backbuffer.
Comment 4 Maciej Cencora 2010-03-13 08:39:19 UTC
I've pushed extended version of your patch that handles also other formats.
Comment 5 Török Edwin 2010-03-13 08:51:50 UTC
(In reply to comment #4)
> I've pushed extended version of your patch that handles also other formats.
> 

Thanks, it works!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.