mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
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 <mattst88@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
b76fa56739
commit
81978c6feb
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue