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

Author: Rhys Perry <pendingchao...@gmail.com>
Date:   Wed Aug 18 13:50:58 2021 +0100

nir: allow NIR_PASS(_, )

If a user wants to skip printing the shader if no changes were made
without declaring a dummy variable for the progress.

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

---

 src/compiler/nir/nir.h | 1 +
 1 file changed, 1 insertion(+)

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

Reply via email to