mesa/format_utils: Add a function to convert a mesa_format to an array format
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 11 Jul 2014 15:52:12 +0000 (08:52 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Aug 2014 17:56:16 +0000 (10:56 -0700)
commit6b912dc12918c93fe729d3785e985132e9a81f51
treea52312b104d6fa6f875412c6c2dd39ce764542b1
parentd55f77b503ab7b59ecdd8f31c4f7dc498710e75b
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 <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/format_utils.c
src/mesa/main/format_utils.h