diff options
author | Timothy Arceri <[email protected]> | 2019-12-13 21:58:28 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-12-13 23:09:57 +0000 |
commit | 7564c5fc6d79a2ddec49a19f67183fb3be799fe5 (patch) | |
tree | 16f9c3f2c2ecfbfdd070f1ca2702c5e683a135e4 /src/mesa | |
parent | 46f0b9ecc5b75ed1c11d843d06466306b489aa66 (diff) |
st/glsl_to_nir: fix SSO validation regression
Fixes: b77907edb554 ("st/glsl_to_nir: use nir based program resource list builder")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2216
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 425af0cfb5d..e4b509ba7a7 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -31,6 +31,7 @@ #include "program/prog_statevars.h" #include "program/prog_parameter.h" #include "program/ir_to_mesa.h" +#include "main/context.h" #include "main/mtypes.h" #include "main/errors.h" #include "main/glspirv.h" @@ -368,9 +369,16 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog, st->ctx->SoftFP64 = glsl_float64_funcs_to_nir(st->ctx, options); } - nir_variable_mode mask = - (nir_variable_mode) (nir_var_shader_in | nir_var_shader_out); - nir_remove_dead_variables(nir, mask); + /* ES has strict SSO validation rules for shader IO matching so we can't + * remove dead IO until the resource list has been built. Here we skip + * removing them until later. This will potentially make the IO lowering + * calls below do a little extra work but should otherwise have no impact. + */ + if (!_mesa_is_gles(st->ctx) || !nir->info.separate_shader) { + nir_variable_mode mask = + (nir_variable_mode) (nir_var_shader_in | nir_var_shader_out); + nir_remove_dead_variables(nir, mask); + } if (options->lower_all_io_to_temps || nir->info.stage == MESA_SHADER_VERTEX || |