diff options
author | José Fonseca <[email protected]> | 2008-04-01 07:22:10 +0900 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-04-01 07:22:10 +0900 |
commit | 8a81429fa866cc1e2a14dec7e888fd2c888dc40a (patch) | |
tree | 59429059566c358157aac6a88401b858bd6e4d12 /src/gallium/include/pipe | |
parent | 6b0be38a6cfecd2babc7175b0877bed522ca9f72 (diff) |
gallium: Compute YCBCR bit depth.
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r-- | src/gallium/include/pipe/p_format.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 3238b152b65..9e0f91f202b 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -439,7 +439,8 @@ static INLINE uint pf_get_component_bits( enum pipe_format format, uint comp ) */ static INLINE uint pf_get_bits( enum pipe_format format ) { - if (pf_layout(format) == PIPE_FORMAT_LAYOUT_RGBAZS) { + switch (pf_layout(format)) { + case PIPE_FORMAT_LAYOUT_RGBAZS: return pf_get_component_bits( format, PIPE_FORMAT_COMP_R ) + pf_get_component_bits( format, PIPE_FORMAT_COMP_G ) + @@ -447,11 +448,11 @@ static INLINE uint pf_get_bits( enum pipe_format format ) pf_get_component_bits( format, PIPE_FORMAT_COMP_A ) + pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) + pf_get_component_bits( format, PIPE_FORMAT_COMP_S ); - } - else { - assert( pf_layout(format) == PIPE_FORMAT_LAYOUT_YCBCR ); - - /* TODO */ + case PIPE_FORMAT_LAYOUT_YCBCR: + assert( format == PIPE_FORMAT_YCBCR || format == PIPE_FORMAT_YCBCR_REV ); + /* return effective bits per pixel */ + return 16; + default: assert( 0 ); return 0; } |