summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r--src/gallium/include/pipe/p_format.h13
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;
}