radeonsi/nir: call ac_lower_indirect_derefs()
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 5 Mar 2018 01:06:01 +0000 (12:06 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 5 Mar 2018 03:09:23 +0000 (14:09 +1100)
Fixes piglit tests:
tests/spec/glsl-1.50/execution/variable-indexing/gs-input-array-vec3-index-rd.shader_test
tests/spec/glsl-1.50/execution/geometry/max-input-components.shader_test

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_shader_nir.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index e9b61271151e21510010f19f1f84dd6ec26954cd..d135a09add076cd24b17512e416e5dbc1860e8e8 100644 (file)
@@ -107,7 +107,7 @@ static void si_create_compute_state_async(void *job, int thread_index)
                sel.nir = program->ir.nir;
 
                si_nir_scan_shader(sel.nir, &sel.info);
-               si_lower_nir(&sel);
+               si_lower_nir(&sel, program->compiler_ctx_state.chip_class);
        }
 
 
index 28f6e6bc4e8dc4ec48390a1450ae24ef5fd17993..23f9d20e193cd6c04d290f0c0372d586168f66a6 100644 (file)
@@ -674,7 +674,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
 void si_nir_scan_tess_ctrl(const struct nir_shader *nir,
                           const struct tgsi_shader_info *info,
                           struct tgsi_tessctrl_info *out);
-void si_lower_nir(struct si_shader_selector *sel);
+void si_lower_nir(struct si_shader_selector *sel, enum chip_class chip_class);
 
 /* Inline helpers. */
 
index 147bd9511d208410799b1104e4fa674a9c6247e8..05e00d016ebcbac25e085bff2af9f8a4510bd461 100644 (file)
@@ -623,7 +623,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
  * selector is created.
  */
 void
-si_lower_nir(struct si_shader_selector* sel)
+si_lower_nir(struct si_shader_selector* sel, enum chip_class chip_class)
 {
        /* Adjust the driver location of inputs and outputs. The state tracker
         * interprets them as slots, while the ac/nir backend interprets them
@@ -673,6 +673,8 @@ si_lower_nir(struct si_shader_selector* sel)
        };
        NIR_PASS_V(sel->nir, nir_lower_subgroups, &subgroups_options);
 
+       ac_lower_indirect_derefs(sel->nir, chip_class);
+
        bool progress;
        do {
                progress = false;
index 98a3dfe242f5e7877c79458b214238ac24edde9f..28931352425b53532ab595d4ba622050921019d0 100644 (file)
@@ -1999,7 +1999,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
                si_nir_scan_shader(sel->nir, &sel->info);
                si_nir_scan_tess_ctrl(sel->nir, &sel->info, &sel->tcs_info);
 
-               si_lower_nir(sel);
+               si_lower_nir(sel, sctx->b.chip_class);
        }
 
        sel->type = sel->info.processor;