From 7763c7b2bad153e1d7527cf361f85f7c8ccfdae6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 8 Jun 2017 20:05:09 +0200 Subject: [PATCH] ac/nir,radeonsi: add ac_shader_abi::chip_class MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/amd/common/ac_nir_to_llvm.c | 1 + src/amd/common/ac_shader_abi.h | 2 ++ src/gallium/drivers/radeonsi/si_shader.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index e6befff861c..c9f91e9453b 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -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; diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h index b0161d9f220..1b204e9f447 100644 --- a/src/amd/common/ac_shader_abi.h +++ b/src/amd/common/ac_shader_abi.h @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 5fb820693de..090ec8313ed 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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; -- 2.30.2