diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-04-09 14:03:02 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-04-09 16:32:47 +0100 |
commit | d3808b1b1f34dbb826b99102786d94e1baf9d667 (patch) | |
tree | c03be26b133dd89b1ce611c663460a97cb0e4147 /src/gallium/auxiliary/util/u_format.h | |
parent | efae8f33f2c34666c614d5b00cab618425de6f66 (diff) |
util: Add dedicated depth-stencil packing/unpacking functions.
Depth-stencil manually written given that each one is very close to
be a special case.
u_format_zs.c's still untested.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_format.h | 101 |
1 files changed, 86 insertions, 15 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index a7c24f0c00..c96a39dc09 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -192,43 +192,114 @@ struct util_format_description /** * Unpack pixel blocks to R8G8B8A8_UNORM. + * + * Only defined for non-depth-stencil formats. */ void - (*unpack_8unorm)(uint8_t *dst, unsigned dst_stride, - const uint8_t *src, unsigned src_stride, - unsigned width, unsigned height); + (*unpack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); /** * Pack pixel blocks from R8G8B8A8_UNORM. + * + * Only defined for non-depth-stencil formats. */ void - (*pack_8unorm)(uint8_t *dst, unsigned dst_stride, - const uint8_t *src, unsigned src_stride, - unsigned width, unsigned height); + (*pack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); /** * Unpack pixel blocks to R32G32B32A32_FLOAT. + * + * Only defined for non-depth-stencil formats. */ void - (*unpack_float)(float *dst, unsigned dst_stride, - const uint8_t *src, unsigned src_stride, - unsigned width, unsigned height); + (*unpack_rgba_float)(float *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); /** * Pack pixel blocks from R32G32B32A32_FLOAT. + * + * Only defined for non-depth-stencil formats. */ void - (*pack_float)(uint8_t *dst, unsigned dst_stride, - const float *src, unsigned src_stride, - unsigned width, unsigned height); + (*pack_rgba_float)(uint8_t *dst, unsigned dst_stride, + const float *src, unsigned src_stride, + unsigned width, unsigned height); /** * Fetch a single pixel (i, j) from a block. + * + * Only defined for non-depth-stencil formats. + */ + void + (*fetch_rgba_float)(float *dst, + const uint8_t *src, + unsigned i, unsigned j); + + /** + * Unpack pixels to Z32_UNORM. + * + * Only defined for depth formats. + */ + void + (*unpack_z_32unorm)(uint32_t *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); + + /** + * Pack pixels from Z32_FLOAT. + * + * Only defined for depth formats. + */ + void + (*pack_z_32unorm)(uint8_t *dst, unsigned dst_stride, + const uint32_t *src, unsigned src_stride, + unsigned width, unsigned height); + + /** + * Unpack pixels to Z32_FLOAT. + * + * Only defined for depth formats. + */ + void + (*unpack_z_float)(float *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); + + /** + * Pack pixels from Z32_FLOAT. + * + * Only defined for depth formats. + */ + void + (*pack_z_float)(uint8_t *dst, unsigned dst_stride, + const float *src, unsigned src_stride, + unsigned width, unsigned height); + + /** + * Unpack pixels to S8_USCALED. + * + * Only defined for stencil formats. + */ + void + (*unpack_s_32unorm)(uint8_t *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); + + /** + * Pack pixels from S8_USCALED. + * + * Only defined for stencil formats. */ void - (*fetch_float)(float *dst, - const uint8_t *src, - unsigned i, unsigned j); + (*pack_s_8uscaled)(uint8_t *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + unsigned width, unsigned height); + }; |