diff options
author | Jason Ekstrand <[email protected]> | 2014-07-11 08:52:12 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2014-08-05 10:56:16 -0700 |
commit | 6b912dc12918c93fe729d3785e985132e9a81f51 (patch) | |
tree | a52312b104d6fa6f875412c6c2dd39ce764542b1 /src/mesa/main/format_utils.h | |
parent | d55f77b503ab7b59ecdd8f31c4f7dc498710e75b (diff) |
mesa/format_utils: Add a function to convert a mesa_format to an array format
This commits adds the _mesa_format_to_array function that determines if the
given format can be represented as an array format and computes the array
format parameters. This is a direct helper function for using
_mesa_swizzle_and_convert
v2: Better documentation and commit message
v3: Fixed a potential segfault from an invalid endianness swizzle
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/format_utils.h')
-rw-r--r-- | src/mesa/main/format_utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/format_utils.h b/src/mesa/main/format_utils.h index 11546aaf04b..9f778e37734 100644 --- a/src/mesa/main/format_utils.h +++ b/src/mesa/main/format_utils.h @@ -33,6 +33,10 @@ #include "imports.h" +bool +_mesa_format_to_array(mesa_format, GLenum *type, int *num_components, + uint8_t swizzle[4], bool *normalized); + void _mesa_swizzle_and_convert(void *dst, GLenum dst_type, int num_dst_channels, const void *src, GLenum src_type, int num_src_channels, |