diff options
author | Timothy Arceri <[email protected]> | 2017-11-02 13:02:54 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-11-03 14:54:45 +1100 |
commit | ee376ac6f4cbcb3f3938b1a73bc4fc7d269eca6f (patch) | |
tree | 216a877506a4268b3f2e219b448dbe3b4307f6ce /src/amd | |
parent | 309a51411daa7219f10154ddf63bdf83f3d02d02 (diff) |
ac: add v3i32 to the common code and make use of it
Reviewed-by: Marek Olšák <[email protected]
Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 1 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_build.h | 1 | ||||
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 8 |
3 files changed, 5 insertions, 5 deletions
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); |