mesa/formats: only do type and component lookup for uncompressed formats

Only uncompressed formats have a non-void type and actual
components per pixel. Rename _mesa_format_to_type_and_comps
to _mesa_uncompressed_format_to_type_and_comps and require
callers to check if the format is not compressed.

v2. include compressed format cases to avoid gcc warnings (Chad).

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
Nanley Chery
2015-07-31 09:25:56 -07:00
parent 000e225360
commit 9f00af672b
4 changed files with 46 additions and 49 deletions

View File

@@ -602,7 +602,7 @@ _mesa_format_to_array(mesa_format format, GLenum *type, int *num_components,
*normalized = !_mesa_is_format_integer(format);
_mesa_format_to_type_and_comps(format, type, &format_components);
_mesa_uncompressed_format_to_type_and_comps(format, type, &format_components);
switch (_mesa_get_format_layout(format)) {
case MESA_FORMAT_LAYOUT_ARRAY: