diff options
author | Timothy Arceri <[email protected]> | 2018-02-21 10:09:18 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-02-22 09:31:00 +1100 |
commit | 6d338d757f32ba7f1cd583108c31371f2c4e25c0 (patch) | |
tree | 95dbd210092a17eb0bf2e1160786dbf94908cbd3 /src/amd/common | |
parent | eef890b7b1216443bd75382f7f602e26338a7899 (diff) |
ac/radeonsi: pass type to load_tess_varyings()
We need this to be able to load 64bit varyings.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 15 | ||||
-rw-r--r-- | src/amd/common/ac_shader_abi.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 2460e105f7a..213306322dd 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2885,6 +2885,7 @@ get_dw_address(struct radv_shader_context *ctx, static LLVMValueRef load_tcs_varyings(struct ac_shader_abi *abi, + LLVMTypeRef type, LLVMValueRef vertex_index, LLVMValueRef indir_index, unsigned const_index, @@ -3008,6 +3009,7 @@ store_tcs_output(struct ac_shader_abi *abi, static LLVMValueRef load_tes_input(struct ac_shader_abi *abi, + LLVMTypeRef type, LLVMValueRef vertex_index, LLVMValueRef param_index, unsigned const_index, @@ -3146,12 +3148,21 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx, false, NULL, is_patch ? NULL : &vertex_index, &const_index, &indir_index); - result = ctx->abi->load_tess_varyings(ctx->abi, vertex_index, indir_index, + LLVMTypeRef dest_type = get_def_type(ctx, &instr->dest.ssa); + + LLVMTypeRef src_component_type; + if (LLVMGetTypeKind(dest_type) == LLVMVectorTypeKind) + src_component_type = LLVMGetElementType(dest_type); + else + src_component_type = dest_type; + + result = ctx->abi->load_tess_varyings(ctx->abi, src_component_type, + vertex_index, indir_index, const_index, location, driver_location, instr->variables[0]->var->data.location_frac, instr->num_components, is_patch, is_compact, load_inputs); - return LLVMBuildBitCast(ctx->ac.builder, result, get_def_type(ctx, &instr->dest.ssa), ""); + return LLVMBuildBitCast(ctx->ac.builder, result, dest_type, ""); } static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h index 62b8b7a5dc4..10d41ef9971 100644 --- a/src/amd/common/ac_shader_abi.h +++ b/src/amd/common/ac_shader_abi.h @@ -96,6 +96,7 @@ struct ac_shader_abi { LLVMTypeRef type); LLVMValueRef (*load_tess_varyings)(struct ac_shader_abi *abi, + LLVMTypeRef type, LLVMValueRef vertex_index, LLVMValueRef param_index, unsigned const_index, |