mesa: Handle GL_COLOR_INDEX in _mesa_format_from_format_and_type().

Just return MESA_FORMAT_NONE to avoid triggering unreachable; there's
really no sensible thing to return for this case anyway.

This prevents regressions in the next commit, which makes st/mesa
start using this function to find a reasonable format from GL format
and type enums.

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Kenneth Graunke 2019-11-12 23:12:54 -08:00 committed by Eric Anholt
parent ea232c7cfd
commit 69f109cc37

View file

@ -3566,6 +3566,9 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
bool normalized = false, is_float = false, is_signed = false;
int num_channels = 0, type_size = 0;
if (format == GL_COLOR_INDEX)
return MESA_FORMAT_NONE;
/* Extract array format type information from the OpenGL data type */
switch (type) {
case GL_UNSIGNED_BYTE: