ac/nir,radeonsi: add ac_shader_abi::chip_class
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 8 Jun 2017 18:05:09 +0000 (20:05 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Jul 2017 12:55:37 +0000 (14:55 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_shader_abi.h
src/gallium/drivers/radeonsi/si_shader.c

index e6befff861c6d9b2203995a09bd1a6deb3997d83..c9f91e9453b3336fd7894139183fb196921b87ea 100644 (file)
@@ -6203,6 +6203,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
        if (nir->stage == MESA_SHADER_FRAGMENT)
                handle_fs_inputs_pre(&ctx, nir);
 
+       ctx.abi.chip_class = options->chip_class;
        ctx.abi.inputs = &ctx.inputs[0];
        ctx.abi.emit_outputs = handle_shader_outputs_post;
 
index b0161d9f22045bf47551c6629b442f891caa0b3e..1b204e9f447a1588a233b9d1b943b17a105d889c 100644 (file)
@@ -30,6 +30,8 @@
  * radv to share a compiler backend.
  */
 struct ac_shader_abi {
+       enum chip_class chip_class;
+
        LLVMValueRef base_vertex;
        LLVMValueRef start_instance;
        LLVMValueRef draw_id;
index 5fb820693defefe0f6131b6dc03cd3512ca2055a..090ec8313ed4034d24d88f42713a7c45df1f09d5 100644 (file)
@@ -5494,6 +5494,8 @@ static void si_init_shader_ctx(struct si_shader_context *ctx,
 {
        struct lp_build_tgsi_context *bld_base;
 
+       ctx->abi.chip_class = sscreen->b.chip_class;
+
        si_llvm_context_init(ctx, sscreen, tm);
 
        bld_base = &ctx->bld_base;