With Matt's suggested commit message, Reviewed-by: Connor Abbott <[email protected]>
On Tue, Jan 6, 2015 at 7:34 PM, Jason Ekstrand <[email protected]> wrote: > --- > src/glsl/nir/nir.h | 4 ++++ > src/glsl/nir/nir_validate.c | 7 +++++++ > 2 files changed, 11 insertions(+) > > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h > index ab9383e..e681d85 100644 > --- a/src/glsl/nir/nir.h > +++ b/src/glsl/nir/nir.h > @@ -1438,7 +1438,11 @@ void nir_index_blocks(nir_function_impl *impl); > > void nir_print_shader(nir_shader *shader, FILE *fp); > > +#ifdef DEBUG > void nir_validate_shader(nir_shader *shader); > +#else > +static inline void nir_validate_shader(nir_shader *shader) { } > +#endif /* DEBUG */ > > void nir_calc_dominance_impl(nir_function_impl *impl); > void nir_calc_dominance(nir_shader *shader); > diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c > index 496f0a6..a4f4fb0 100644 > --- a/src/glsl/nir/nir_validate.c > +++ b/src/glsl/nir/nir_validate.c > @@ -32,6 +32,11 @@ > * This file checks for invalid IR indicating a bug somewhere in the > compiler. > */ > > +/* Since this file is just a pile of asserts, don't bother compiling it if > + * we're not building a debug build. > + */ > +#ifdef DEBUG > + > /* > * Per-register validation state. > */ > @@ -893,3 +898,5 @@ nir_validate_shader(nir_shader *shader) > > destroy_validate_state(&state); > } > + > +#endif /* NDEBUG */ > -- > 2.2.0 > > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
