st/nir: call nir_opt_access before gl_nir_lower_buffers
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 18 Sep 2020 16:12:29 +0000 (17:12 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Thu, 24 Sep 2020 10:04:11 +0000 (11:04 +0100)
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>

src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_program.c

index 1a2a0f3..451ec07 100644 (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. */
index f9348fd..2a80cb0 100644 (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 ||