Mesa (master): gallium/util: added cases for SRGB formats
Brian Paul
brianp at kemper.freedesktop.org
Thu Aug 27 15:15:41 UTC 2009
Module: Mesa
Branch: master
Commit: f8ae968d2898352cd4ac649fff0ea19ac42f56b4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8ae968d2898352cd4ac649fff0ea19ac42f56b4
Author: Brian Paul <brianp at vmware.com>
Date: Thu Aug 27 09:09:56 2009 -0600
gallium/util: added cases for SRGB formats
---
src/gallium/auxiliary/util/u_gen_mipmap.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index ca79748..833c0b8 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -921,11 +921,19 @@ static void
format_to_type_comps(enum pipe_format pformat,
enum dtype *datatype, uint *comps)
{
+ /* XXX I think this could be implemented in terms of the pf_*() functions */
switch (pformat) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_X8R8G8B8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
case PIPE_FORMAT_B8G8R8X8_UNORM:
+ case PIPE_FORMAT_R8G8B8A8_SRGB:
+ case PIPE_FORMAT_R8G8B8X8_SRGB:
+ case PIPE_FORMAT_A8R8G8B8_SRGB:
+ case PIPE_FORMAT_X8R8G8B8_SRGB:
+ case PIPE_FORMAT_B8G8R8A8_SRGB:
+ case PIPE_FORMAT_B8G8R8X8_SRGB:
+ case PIPE_FORMAT_R8G8B8_SRGB:
*datatype = DTYPE_UBYTE;
*comps = 4;
return;
@@ -942,12 +950,14 @@ format_to_type_comps(enum pipe_format pformat,
*comps = 3;
return;
case PIPE_FORMAT_L8_UNORM:
+ case PIPE_FORMAT_L8_SRGB:
case PIPE_FORMAT_A8_UNORM:
case PIPE_FORMAT_I8_UNORM:
*datatype = DTYPE_UBYTE;
*comps = 1;
return;
case PIPE_FORMAT_A8L8_UNORM:
+ case PIPE_FORMAT_A8L8_SRGB:
*datatype = DTYPE_UBYTE;
*comps = 2;
return;
More information about the mesa-commit
mailing list