diff options
author | José Fonseca <[email protected]> | 2010-04-21 11:19:39 +0200 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-04-21 11:19:39 +0200 |
commit | 86d2383e771a4e53bbee2ce0b6f924f0438249b5 (patch) | |
tree | 663801e9de1bf66107faa4b335f14d9c576aefb6 /src/mesa/state_tracker | |
parent | a85afb91777ade2a12ba2df8f219a0294a645164 (diff) |
mesa/st: Translate a few more mesa/gallium formats.
These endup used by Xvnc.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 20 |
2 files changed, 17 insertions, 5 deletions
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: |