Mesa (master): radeonsi: add chip class to compiler_ctx_state

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Mar 5 03:14:27 UTC 2018


Module: Mesa
Branch: master
Commit: 561503e3bd9fb800765b694092fecb97de92e192
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=561503e3bd9fb800765b694092fecb97de92e192

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Mar  5 12:04:47 2018 +1100

radeonsi: add chip class to compiler_ctx_state

This will be used in the following patch.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/gallium/drivers/radeonsi/si_compute.c       | 1 +
 src/gallium/drivers/radeonsi/si_shader.h        | 2 ++
 src/gallium/drivers/radeonsi/si_state_shaders.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 41927988cf..e9b6127115 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -186,6 +186,7 @@ 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 f58978989d..28f6e6bc4e 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -307,6 +307,8 @@ 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;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index b28352951a..98a3dfe242 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -3121,6 +3121,7 @@ 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;




More information about the mesa-commit mailing list