diff options
author | Eric Anholt <[email protected]> | 2019-09-06 14:09:37 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-11-07 19:43:41 +0000 |
commit | d27dda907aca8d7b92b7330c498958e01eb962ae (patch) | |
tree | 50ad3fd44eac9aaa455a6ee5043ed2b7df76c606 /src/mesa/main/tests/mesa_formats.cpp | |
parent | 6b1c250245e4e29ea42e853ee094a8d6e9d1b665 (diff) |
mesa: Prepare for the MESA_FORMAT_* enum to be sparse.
To redefine MESA_FORMAT in terms of PIPE_FORMAT enums, we need to fix
places where we iterated up to MESA_FORMAT_COUNT. I use
_mesa_get_format_name(f) == NULL as the signal that it's not an enum
value with a MESA_FORMAT.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/tests/mesa_formats.cpp')
-rw-r--r-- | src/mesa/main/tests/mesa_formats.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/tests/mesa_formats.cpp b/src/mesa/main/tests/mesa_formats.cpp index b7f036bb3c2..6842d82e9cf 100644 --- a/src/mesa/main/tests/mesa_formats.cpp +++ b/src/mesa/main/tests/mesa_formats.cpp @@ -45,6 +45,9 @@ TEST(MesaFormatsTest, FormatTypeAndComps) mesa_format f = (mesa_format) fi; SCOPED_TRACE(_mesa_get_format_name(f)); + if (!_mesa_get_format_name(f)) + continue; + /* This function will emit a problem/warning if the format is * not handled. */ @@ -68,6 +71,9 @@ TEST(MesaFormatsTest, FormatSanity) for (int fi = 0; fi < MESA_FORMAT_COUNT; ++fi) { mesa_format f = (mesa_format) fi; SCOPED_TRACE(_mesa_get_format_name(f)); + if (!_mesa_get_format_name(f)) + continue; + GLenum datatype = _mesa_get_format_datatype(f); GLint r = _mesa_get_format_bits(f, GL_RED_BITS); GLint g = _mesa_get_format_bits(f, GL_GREEN_BITS); |