diff options
author | Chia-I Wu <[email protected]> | 2014-03-04 12:18:52 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-03-06 10:59:25 +0800 |
commit | 5a27491a760c64e885110605ff0e5c8021382864 (patch) | |
tree | e342b91433cf8e2396727a166c11d29b621c270f /src/mesa/main/texstore.c | |
parent | 48a9094b69db621c4b8a432adc63d6f4439ab3d1 (diff) |
mesa: add MESA_FORMAT_B8G8R8X8_SRGB
The format is needed to represent an RGB-only winsys framebuffer that is
sRGB-capable.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 3e22a0b46f7..edf7e816727 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3290,10 +3290,17 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_B8G8R8A8_SRGB); - - /* reuse normal rgba texstore code */ - newDstFormat = MESA_FORMAT_B8G8R8A8_UNORM; + switch (dstFormat) { + case MESA_FORMAT_B8G8R8A8_SRGB: + newDstFormat = MESA_FORMAT_B8G8R8A8_UNORM; + break; + case MESA_FORMAT_B8G8R8X8_SRGB: + newDstFormat = MESA_FORMAT_B8G8R8X8_UNORM; + break; + default: + ASSERT(0); + return GL_FALSE; + } k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat, newDstFormat, @@ -3859,6 +3866,8 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_G8R8_SNORM] = _mesa_texstore_snorm88; table[MESA_FORMAT_G16R16_SNORM] = _mesa_texstore_snorm1616; + table[MESA_FORMAT_B8G8R8X8_SRGB] = _mesa_texstore_sargb8; + initialized = GL_TRUE; } |