From 98ba6cfb4cc7440f0fb4f101ff714143720e175e Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 30 Jul 2009 12:39:26 +0200 Subject: [PATCH] mesa st: Change the preferred internal format for some RGB formats. For GL_RGB5, GL_RGB4 and GL_R3_G3_B2, prefer PIPE_FORMAT_R5G6B5_UNORM over PIPE_FORMAT_A1R5G5B5_UNORM, since hardware is more likely to support the previous format for rendering. Signed-off-by: Thomas Hellstrom --- src/mesa/state_tracker/st_format.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index b243c249e37..dcb90a31076 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -435,10 +435,10 @@ st_choose_format(struct pipe_context *pipe, GLenum internalFormat, case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A1R5G5B5_UNORM; if (screen->is_format_supported( screen, PIPE_FORMAT_R5G6B5_UNORM, target, tex_usage, geom_flags )) return PIPE_FORMAT_R5G6B5_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_A1R5G5B5_UNORM; return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_ALPHA: -- 2.30.2