From: Timothy Arceri Date: Thu, 2 Nov 2017 02:02:54 +0000 (+1100) Subject: ac: add v3i32 to the common code and make use of it X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee376ac6f4cbcb3f3938b1a73bc4fc7d269eca6f;p=mesa.git ac: add v3i32 to the common code and make use of it Reviewed-by: Marek Olšák --- diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 1a0d44bcdd3..1519262b3dd 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -67,6 +67,7 @@ ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context, ctx->f32 = LLVMFloatTypeInContext(ctx->context); ctx->f64 = LLVMDoubleTypeInContext(ctx->context); ctx->v2i32 = LLVMVectorType(ctx->i32, 2); + ctx->v3i32 = LLVMVectorType(ctx->i32, 3); ctx->v4i32 = LLVMVectorType(ctx->i32, 4); ctx->v4f32 = LLVMVectorType(ctx->f32, 4); ctx->v8i32 = LLVMVectorType(ctx->i32, 8); diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index 7fc336c3f98..f662cc4dd89 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -53,6 +53,7 @@ struct ac_llvm_context { LLVMTypeRef f32; LLVMTypeRef f64; LLVMTypeRef v2i32; + LLVMTypeRef v3i32; LLVMTypeRef v4i32; LLVMTypeRef v4f32; LLVMTypeRef v8i32; diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 0bcb0b0525c..6a638e3f166 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -134,7 +134,6 @@ struct nir_to_llvm_context { LLVMValueRef persp_sample, persp_center, persp_centroid; LLVMValueRef linear_sample, linear_center, linear_centroid; - LLVMTypeRef v3i32; LLVMTypeRef v4i32; LLVMTypeRef v8i32; LLVMTypeRef f64; @@ -734,9 +733,9 @@ static void create_function(struct nir_to_llvm_context *ctx, radv_define_common_user_sgprs_phase1(ctx, stage, has_previous_stage, previous_stage, &user_sgpr_info, &args, &desc_sets); if (ctx->shader_info->info.cs.grid_components_used) add_user_sgpr_argument(&args, LLVMVectorType(ctx->ac.i32, ctx->shader_info->info.cs.grid_components_used), &ctx->num_work_groups); /* grid size */ - add_sgpr_argument(&args, LLVMVectorType(ctx->ac.i32, 3), &ctx->workgroup_ids); + add_sgpr_argument(&args, ctx->ac.v3i32, &ctx->workgroup_ids); add_sgpr_argument(&args, ctx->ac.i32, &ctx->tg_size); - add_vgpr_argument(&args, LLVMVectorType(ctx->ac.i32, 3), &ctx->local_invocation_ids); + add_vgpr_argument(&args, ctx->ac.v3i32, &ctx->local_invocation_ids); break; case MESA_SHADER_VERTEX: radv_define_common_user_sgprs_phase1(ctx, stage, has_previous_stage, previous_stage, &user_sgpr_info, &args, &desc_sets); @@ -879,7 +878,7 @@ static void create_function(struct nir_to_llvm_context *ctx, add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->persp_sample); /* persp sample */ add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->persp_center); /* persp center */ add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->persp_centroid); /* persp centroid */ - add_vgpr_argument(&args, ctx->v3i32, NULL); /* persp pull model */ + add_vgpr_argument(&args, ctx->ac.v3i32, NULL); /* persp pull model */ add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->linear_sample); /* linear sample */ add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->linear_center); /* linear center */ add_vgpr_argument(&args, ctx->ac.v2i32, &ctx->linear_centroid); /* linear centroid */ @@ -991,7 +990,6 @@ static void create_function(struct nir_to_llvm_context *ctx, static void setup_types(struct nir_to_llvm_context *ctx) { - ctx->v3i32 = LLVMVectorType(ctx->ac.i32, 3); ctx->v4i32 = LLVMVectorType(ctx->ac.i32, 4); ctx->v8i32 = LLVMVectorType(ctx->ac.i32, 8); ctx->f32 = LLVMFloatTypeInContext(ctx->context);