summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-03-06 18:30:06 -0500
committerMarek Olšák <[email protected]>2018-03-08 14:58:16 -0500
commit9b7db1281521b95acb04db624bf93193fd3d4f56 (patch)
tree93aa39c9f14414cb59deae35856366af538daccd
parent78ef16e2f921355280c6ec92fc28753e6dd4d541 (diff)
radeonsi: remove chip_class parameter from si_lower_nir
We can get it from si_screen. Reviewed-by: Timothy Arceri <[email protected]> Acked-by: Alex Deucher <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c3
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h4
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c6
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c3
4 files changed, 6 insertions, 10 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 92d45140719..46873ccce77 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 23f9d20e193..f58978989d4 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -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. */
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 54ab0afca66..e5377358dc1 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -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 {
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 8e02a04898a..8fe4c04ae79 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -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;