radeonsi: add chip class to compiler_ctx_state
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 5 Mar 2018 01:04:47 +0000 (12:04 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 5 Mar 2018 03:09:23 +0000 (14:09 +1100)
This will be used in the following patch.

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_state_shaders.c

index 41927988cf0f5d8b2191a55f6da1f9401d4d893b..e9b61271151e21510010f19f1f84dd6ec26954cd 100644 (file)
@@ -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);
index f58978989d4dac84ac081495ed8701973e8d910f..28f6e6bc4e8dc4ec48390a1450ae24ef5fd17993 100644 (file)
@@ -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;
index b28352951a50d5f5e43bf328c5fa6a9e3b05e3e6..98a3dfe242f5e7877c79458b214238ac24edde9f 100644 (file)
@@ -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;