diff options
author | Kenneth Graunke <[email protected]> | 2019-11-12 23:12:54 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-11-15 20:32:17 +0000 |
commit | 69f109cc37fff6300ea9e1914779620b7a117bf9 (patch) | |
tree | 9b5af62d1e1129ec58479c98a74623b64c2428db /src/mesa | |
parent | ea232c7cfd492fffb1dcf3ba07459c159e8bc112 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/glformats.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index c450ffc8ed7..5709b983067 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -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: |