st/nir: call nir_opt_access before gl_nir_lower_buffers

This pass should be run with deref-based SSBO access.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6778>
This commit is contained in:
Rhys Perry
2020-09-18 17:12:29 +01:00
parent e893102bcf
commit 87f91e2014
2 changed files with 2 additions and 2 deletions

View File

@@ -752,6 +752,8 @@ st_link_nir(struct gl_context *ctx,
struct gl_linked_shader *shader = linked_shader[i];
nir_shader *nir = shader->Program->nir;
NIR_PASS_V(nir, nir_opt_access);
/* This needs to run after the initial pass of nir_lower_vars_to_ssa, so
* that the buffer indices are constants in nir where they where
* constants in GLSL. */

View File

@@ -354,8 +354,6 @@ st_release_program(struct st_context *st, struct st_program **p)
void
st_finalize_nir_before_variants(struct nir_shader *nir)
{
NIR_PASS_V(nir, nir_opt_access);
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);
if (nir->options->lower_all_io_to_temps ||