amd/common: pass the family to ac_llvm_context_init()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Dec 2017 16:53:14 +0000 (17:53 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 22 Dec 2017 09:38:44 +0000 (10:38 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index b407678c3b0bd2d498ac9b6231919256f9fd63b8..c74a47a79984737178f29dcc21c9b3d84b84835d 100644 (file)
  */
 void
 ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
-                    enum chip_class chip_class)
+                    enum chip_class chip_class, enum radeon_family family)
 {
        LLVMValueRef args[1];
 
        ctx->chip_class = chip_class;
+       ctx->family = family;
 
        ctx->context = context;
        ctx->module = NULL;
index 4a570c41bc5d53cc58a864b812217c0f487fd6fc..6427d5315ae615695989ea5cc4ad50d551ba9f3c 100644 (file)
@@ -74,13 +74,14 @@ struct ac_llvm_context {
        LLVMValueRef empty_md;
 
        enum chip_class chip_class;
+       enum radeon_family family;
 
        LLVMValueRef lds;
 };
 
 void
 ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
-                    enum chip_class chip_class);
+                    enum chip_class chip_class, enum radeon_family family);
 
 unsigned ac_get_type_size(LLVMTypeRef type);
 
index cbc6d1b61b197b7f908e5bc24ae890d81496f96e..65865371058a3a0528b715dfdbb4ecca4ddd6d77 100644 (file)
@@ -6561,7 +6561,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
        ctx.context = LLVMContextCreate();
        ctx.module = LLVMModuleCreateWithNameInContext("shader", ctx.context);
 
-       ac_llvm_context_init(&ctx.ac, ctx.context, options->chip_class);
+       ac_llvm_context_init(&ctx.ac, ctx.context, options->chip_class,
+                            options->family);
        ctx.ac.module = ctx.module;
        LLVMSetTarget(ctx.module, options->supports_spill ? "amdgcn-mesa-mesa3d" : "amdgcn--");
 
@@ -6943,7 +6944,8 @@ void ac_create_gs_copy_shader(LLVMTargetMachineRef tm,
        ctx.options = options;
        ctx.shader_info = shader_info;
 
-       ac_llvm_context_init(&ctx.ac, ctx.context, options->chip_class);
+       ac_llvm_context_init(&ctx.ac, ctx.context, options->chip_class,
+                            options->family);
        ctx.ac.module = ctx.module;
 
        ctx.is_gs_copy_shader = true;
index 0843b3c63c00a981e086eeb89ea55bfc788ef921..2ca036e67d366c90c8a25f4b8ce32659a0c4fd15 100644 (file)
@@ -1167,7 +1167,8 @@ void si_llvm_context_init(struct si_shader_context *ctx,
        ctx->gallivm.builder = lp_create_builder(ctx->gallivm.context,
                                                 float_mode);
 
-       ac_llvm_context_init(&ctx->ac, ctx->gallivm.context, sscreen->info.chip_class);
+       ac_llvm_context_init(&ctx->ac, ctx->gallivm.context,
+                            sscreen->info.chip_class, sscreen->info.family);
        ctx->ac.module = ctx->gallivm.module;
        ctx->ac.builder = ctx->gallivm.builder;