From: José Fonseca Date: Wed, 21 Apr 2010 09:19:39 +0000 (+0200) Subject: mesa/st: Translate a few more mesa/gallium formats. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86d2383e771a4e53bbee2ce0b6f924f0438249b5;p=mesa.git mesa/st: Translate a few more mesa/gallium formats. These endup used by Xvnc. --- diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index de1b8e7dc09..1ba1fe1b972 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -230,8 +230,10 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->software = sw; switch (format) { + case PIPE_FORMAT_R8G8B8A8_UNORM: case PIPE_FORMAT_B8G8R8A8_UNORM: case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_R8G8B8X8_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_X8R8G8B8_UNORM: case PIPE_FORMAT_B5G5R5A1_UNORM: diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 731ec64c139..8a366d834e7 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -126,12 +126,18 @@ enum pipe_format st_mesa_format_to_pipe_format(gl_format mesaFormat) { switch (mesaFormat) { - /* fix this */ - case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_RGBA8888: + return PIPE_FORMAT_A8B8G8R8_UNORM; + case MESA_FORMAT_RGBA8888_REV: + return PIPE_FORMAT_R8G8B8A8_UNORM; case MESA_FORMAT_ARGB8888: return PIPE_FORMAT_B8G8R8A8_UNORM; + case MESA_FORMAT_ARGB8888_REV: + return PIPE_FORMAT_A8R8G8B8_UNORM; case MESA_FORMAT_XRGB8888: return PIPE_FORMAT_B8G8R8X8_UNORM; + case MESA_FORMAT_XRGB8888_REV: + return PIPE_FORMAT_X8R8G8B8_UNORM; case MESA_FORMAT_ARGB1555: return PIPE_FORMAT_B5G5R5A1_UNORM; case MESA_FORMAT_ARGB4444: @@ -190,7 +196,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) #endif default: assert(0); - return 0; + return PIPE_FORMAT_NONE; } } @@ -202,12 +208,16 @@ gl_format st_pipe_format_to_mesa_format(enum pipe_format format) { switch (format) { + case PIPE_FORMAT_A8B8G8R8_UNORM: + return MESA_FORMAT_RGBA8888; + case PIPE_FORMAT_R8G8B8A8_UNORM: + return MESA_FORMAT_RGBA8888_REV; case PIPE_FORMAT_B8G8R8A8_UNORM: return MESA_FORMAT_ARGB8888; - case PIPE_FORMAT_B8G8R8X8_UNORM: - return MESA_FORMAT_XRGB8888; case PIPE_FORMAT_A8R8G8B8_UNORM: return MESA_FORMAT_ARGB8888_REV; + case PIPE_FORMAT_B8G8R8X8_UNORM: + return MESA_FORMAT_XRGB8888; case PIPE_FORMAT_X8R8G8B8_UNORM: return MESA_FORMAT_XRGB8888_REV; case PIPE_FORMAT_B5G5R5A1_UNORM: