From: Jason Ekstrand Date: Thu, 23 Jun 2016 21:22:03 +0000 (-0700) Subject: nir: Add a NIR_VALIDATE environment variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81978c6febd43b8a88a4db09133f9659e15b492c;p=mesa.git nir: Add a NIR_VALIDATE environment variable It defaults to true so default behavior doesn't change but it allows you to do NIR_VALIDATE=false if you don't want validation. Disabling validation can substantially speed up shader compiles so you frequently want to turn it off if compiler invariants aren't in question. Reviewed-by: Matt Turner Reviewed-by: Matt Turner Signed-off-by: Rob Clark --- diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index e5f5b8acc60..63e85cf6037 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -1124,6 +1124,12 @@ dump_errors(validate_state *state) void nir_validate_shader(nir_shader *shader) { + static int should_validate = -1; + if (should_validate < 0) + should_validate = env_var_as_boolean("NIR_VALIDATE", true); + if (!should_validate) + return; + validate_state state; init_validate_state(&state);