summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe/p_format.h
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-16 14:10:35 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-16 14:13:09 +0900
commitfbf0f6bd4d6ec20ead2797042866e6e910cd0f77 (patch)
tree44cfdf3bf5d06fe5528b9ea0040488b31093bd7b /src/gallium/include/pipe/p_format.h
parent0c2c0a862c40c0ed39a9ac52344d22c8a7c8b100 (diff)
gallium: Add pf_is_compressed utility function.
Diffstat (limited to 'src/gallium/include/pipe/p_format.h')
-rw-r--r--src/gallium/include/pipe/p_format.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index a2c6155d01..fefb8fdf1b 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -519,27 +519,18 @@ pf_get_nblocks(const struct pipe_format_block *block, unsigned width, unsigned h
return pf_get_nblocksx(block, width)*pf_get_nblocksy(block, height);
}
-static INLINE void
-pipe_rect_to_blocks(const struct pipe_format_block *block,
- unsigned *width, unsigned *height,
- unsigned *src_x, unsigned *src_y,
- unsigned *dst_x, unsigned *dst_y)
+static INLINE boolean
+pf_is_compressed( enum pipe_format format )
{
- assert(block->size > 0);
- assert(block->width > 0);
- assert(block->height > 0);
- if(width)
- *width = pf_get_nblocksx(block, *width);
- if(height)
- *height = pf_get_nblocksy(block, *height);
- if(src_x)
- *src_x /= block->width;
- if(src_y)
- *src_y /= block->height;
- if(dst_x)
- *dst_x /= block->width;
- if(dst_y)
- *dst_y /= block->height;
+ switch (format) {
+ case PIPE_FORMAT_DXT1_RGB:
+ case PIPE_FORMAT_DXT1_RGBA:
+ case PIPE_FORMAT_DXT3_RGBA:
+ case PIPE_FORMAT_DXT5_RGBA:
+ return TRUE;
+ default:
+ return FALSE;
+ }
}
#ifdef __cplusplus