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 <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>
This commit is contained in:
Rhys Perry
2021-08-18 13:50:58 +01:00
committed by Marge Bot
parent cf9ee6d432
commit 836470d433

View File

@@ -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); \