Mesa (master): mesa: Add debug info to _mesa_format_from_format_and_type() error path.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 17 21:40:00 UTC 2019


Module: Mesa
Branch: master
Commit: df5fe86232039b4179105c92fbccd6a809388a15
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=df5fe86232039b4179105c92fbccd6a809388a15

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Sep 18 14:46:49 2019 -0700

mesa: Add debug info to _mesa_format_from_format_and_type() error path.

The unreachable() that follows isn't very useful for debug, and by adding
this here we get a nice description of the failure in debug builds.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/glformats.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 3e493cd5c2d..7df26189359 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3747,6 +3747,10 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
       break;
    }
 
+   fprintf(stderr, "Unsupported format/type: %s/%s\n",
+           _mesa_enum_to_string(format),
+           _mesa_enum_to_string(type));
+
    /* If we got here it means that we could not find a Mesa format that
     * matches the GL format/type provided. We may need to add a new Mesa
     * format in that case.




More information about the mesa-commit mailing list