Mesa (main): nir: print file when validation fails

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 19 14:36:43 UTC 2022


Module: Mesa
Branch: main
Commit: 0d9ead8ca24f38966490c51dfc57e237e40c7af3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d9ead8ca24f38966490c51dfc57e237e40c7af3

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Wed Aug 18 14:18:15 2021 +0100

nir: print file when validation fails

This should make it clear whether a validation failure happens in RADV or
zink.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>

---

 src/compiler/nir/nir.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 1d70f7f66f2..93b6b39065a 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -4347,7 +4347,7 @@ static inline bool should_print_nir(UNUSED nir_shader *shader) { return false; }
    if (should_print_nir(nir))                                        \
       printf("%s\n", #pass);                                         \
    if (pass(nir, ##__VA_ARGS__)) {                                   \
-      nir_validate_shader(nir, "after " #pass);                      \
+      nir_validate_shader(nir, "after " #pass " in " __FILE__);      \
       UNUSED bool _;                                                 \
       progress = true;                                               \
       if (should_print_nir(nir))                                     \
@@ -4360,7 +4360,7 @@ static inline bool should_print_nir(UNUSED nir_shader *shader) { return false; }
    if (should_print_nir(nir))                                        \
       printf("%s\n", #pass);                                         \
    pass(nir, ##__VA_ARGS__);                                         \
-   nir_validate_shader(nir, "after " #pass);                         \
+   nir_validate_shader(nir, "after " #pass " in " __FILE__);         \
    if (should_print_nir(nir))                                        \
       nir_print_shader(nir, stdout);                                 \
 )



More information about the mesa-commit mailing list