From aba40bd4345e36fb56817673369b275f0e9a9c43 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 13 Mar 2010 17:27:51 +0100 Subject: [PATCH] radeon: fix gl format to mesa format mapping and add GL_BGRA formats --- .../drivers/dri/radeon/radeon_pixel_read.c | 25 +++++++++++++------ 1 file 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; } -- 2.30.2