radeonsi: remove chip_class parameter from si_lower_nir
authorMarek Olšák <marek.olsak@amd.com>
Tue, 6 Mar 2018 23:30:06 +0000 (18:30 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 8 Mar 2018 19:58:16 +0000 (14:58 -0500)
We can get it from si_screen.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
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 92d45140719e790c114248fbc9d164c0ee27270d..46873ccce77f994cc7c551db847358c47e7415ce 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, program->compiler_ctx_state.chip_class);
+               si_lower_nir(&sel);
        }
 
 
@@ -186,7 +186,6 @@ static void *si_create_compute_state(
                        program->ir.nir = (struct nir_shader *) cso->prog;
                }
 
-               program->compiler_ctx_state.chip_class = sctx->b.chip_class;
                program->compiler_ctx_state.debug = sctx->debug;
                program->compiler_ctx_state.is_debug_context = sctx->is_debug;
                p_atomic_inc(&sscreen->num_shaders_created);
index 23f9d20e193cd6c04d290f0c0372d586168f66a6..f58978989d4dac84ac081495ed8701973e8d910f 100644 (file)
@@ -307,8 +307,6 @@ struct si_shader;
 
 /* State of the context creating the shader object. */
 struct si_compiler_ctx_state {
-       enum chip_class                 chip_class;
-
        /* Should only be used by si_init_shader_selector_async and
         * si_build_shader_variant if thread_index == -1 (non-threaded). */
        LLVMTargetMachineRef            tm;
@@ -674,7 +672,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, enum chip_class chip_class);
+void si_lower_nir(struct si_shader_selector *sel);
 
 /* Inline helpers. */
 
index 54ab0afca6697ae5b1e4f53749cf579f7db12878..e5377358dc1a890188e8cae833310e8def2ee9fc 100644 (file)
@@ -21,8 +21,8 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "si_shader.h"
 #include "si_shader_internal.h"
+#include "si_pipe.h"
 
 #include "ac_nir_to_llvm.h"
 
@@ -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, enum chip_class chip_class)
+si_lower_nir(struct si_shader_selector* sel)
 {
        /* Adjust the driver location of inputs and outputs. The state tracker
         * interprets them as slots, while the ac/nir backend interprets them
@@ -673,7 +673,7 @@ si_lower_nir(struct si_shader_selector* sel, enum chip_class chip_class)
        };
        NIR_PASS_V(sel->nir, nir_lower_subgroups, &subgroups_options);
 
-       ac_lower_indirect_derefs(sel->nir, chip_class);
+       ac_lower_indirect_derefs(sel->nir, sel->screen->info.chip_class);
 
        bool progress;
        do {
index 8e02a04898a9274d3bb7d4336bc84646b5bb8065..8fe4c04ae79c37b2d723f2ca894032494fa8a800 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, sctx->b.chip_class);
+               si_lower_nir(sel);
        }
 
        sel->type = sel->info.processor;
@@ -3121,7 +3121,6 @@ bool si_update_shaders(struct si_context *sctx)
                old_ps ? old_ps->key.part.ps.epilog.spi_shader_col_format : 0;
        int r;
 
-       compiler_state.chip_class = sctx->b.chip_class;
        compiler_state.tm = sctx->tm;
        compiler_state.debug = sctx->debug;
        compiler_state.is_debug_context = sctx->is_debug;