diff options
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 60ea4fbc7ff..a0ae9a4430e 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2664,7 +2664,7 @@ nir_variable *nir_variable_clone(const nir_variable *c, nir_shader *shader); nir_shader *nir_shader_serialize_deserialize(void *mem_ctx, nir_shader *s); #ifndef NDEBUG -void nir_validate_shader(nir_shader *shader); +void nir_validate_shader(nir_shader *shader, const char *when); void nir_metadata_set_validation_flag(nir_shader *shader); void nir_metadata_check_validation_flag(nir_shader *shader); @@ -2698,7 +2698,7 @@ should_print_nir(void) return should_print; } #else -static inline void nir_validate_shader(nir_shader *shader) { (void) shader; } +static inline void nir_validate_shader(nir_shader *shader, const char *when) { (void) shader; (void)when; } static inline void nir_metadata_set_validation_flag(nir_shader *shader) { (void) shader; } static inline void nir_metadata_check_validation_flag(nir_shader *shader) { (void) shader; } static inline bool should_clone_nir(void) { return false; } @@ -2706,9 +2706,9 @@ static inline bool should_serialize_deserialize_nir(void) { return false; } static inline bool should_print_nir(void) { return false; } #endif /* NDEBUG */ -#define _PASS(nir, do_pass) do { \ +#define _PASS(pass, nir, do_pass) do { \ do_pass \ - nir_validate_shader(nir); \ + nir_validate_shader(nir, "after " #pass); \ if (should_clone_nir()) { \ nir_shader *clone = nir_shader_clone(ralloc_parent(nir), nir); \ ralloc_free(nir); \ @@ -2720,7 +2720,7 @@ static inline bool should_print_nir(void) { return false; } } \ } while (0) -#define NIR_PASS(progress, nir, pass, ...) _PASS(nir, \ +#define NIR_PASS(progress, nir, pass, ...) _PASS(pass, nir, \ nir_metadata_set_validation_flag(nir); \ if (should_print_nir()) \ printf("%s\n", #pass); \ @@ -2732,7 +2732,7 @@ static inline bool should_print_nir(void) { return false; } } \ ) -#define NIR_PASS_V(nir, pass, ...) _PASS(nir, \ +#define NIR_PASS_V(nir, pass, ...) _PASS(pass, nir, \ if (should_print_nir()) \ printf("%s\n", #pass); \ pass(nir, ##__VA_ARGS__); \ |