summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorMaciej Cencora <[email protected]>2010-03-13 17:27:51 +0100
committerMaciej Cencora <[email protected]>2010-03-13 17:30:19 +0100
commitaba40bd4345e36fb56817673369b275f0e9a9c43 (patch)
tree0b0f1b464e45a1f64eaa39eaa87f2d1a899b6ee4 /src/mesa/drivers
parent1a8a230a61289392e8300901dfabd7911799cbc3 (diff)
radeon: fix gl format to mesa format mapping and add GL_BGRA formats
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_pixel_read.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
index b180c1d9a5c..dadb8002c7d 100644
--- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
+++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
@@ -50,22 +50,33 @@ static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
break;
case GL_RGBA:
switch (type) {
- case GL_UNSIGNED_BYTE:
- return MESA_FORMAT_RGBA8888_REV;
case GL_FLOAT:
return MESA_FORMAT_RGBA_FLOAT32;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ return MESA_FORMAT_RGBA5551;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ return MESA_FORMAT_RGBA8888;
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return MESA_FORMAT_RGBA8888_REV;
+ }
+ break;
+ case GL_BGRA:
+ switch (type) {
case GL_UNSIGNED_SHORT_4_4_4_4:
- return MESA_FORMAT_ARGB4444;
+ return MESA_FORMAT_ARGB4444_REV;
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
return MESA_FORMAT_ARGB4444;
case GL_UNSIGNED_SHORT_5_5_5_1:
- return MESA_FORMAT_RGBA5551;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
return MESA_FORMAT_ARGB1555_REV;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return MESA_FORMAT_ARGB1555;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_ARGB8888;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
return MESA_FORMAT_ARGB8888_REV;
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return MESA_FORMAT_ARGB8888;
+
}
break;
}