From 73c7e92d3a28c4c2b7931d981744b2a5d10478b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 8 Jun 2017 18:23:34 +0200 Subject: [PATCH] ac/nir: add ac_shader_abi::inputs 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 | 2 ++ src/amd/common/ac_shader_abi.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index e21e17de95c..1024101e67f 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -6156,6 +6156,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, if (nir->stage == MESA_SHADER_FRAGMENT) handle_fs_inputs_pre(&ctx, nir); + ctx.abi.inputs = &ctx.inputs[0]; + ac_nir_translate(&ctx.ac, &ctx.abi, nir, &ctx); LLVMBuildRetVoid(ctx.builder); diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h index e10550b8eb2..a872948dd01 100644 --- a/src/amd/common/ac_shader_abi.h +++ b/src/amd/common/ac_shader_abi.h @@ -35,6 +35,13 @@ struct ac_shader_abi { LLVMValueRef draw_id; LLVMValueRef vertex_id; LLVMValueRef instance_id; + + /* For VS and PS: pre-loaded shader inputs. + * + * Currently only used for NIR shaders; indexed by variables' + * driver_location. + */ + LLVMValueRef *inputs; }; #endif /* AC_SHADER_ABI_H */ -- 2.30.2