diff options
author | Daniel Schürmann <[email protected]> | 2018-05-15 17:09:03 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-07-23 23:16:25 +0200 |
commit | b722b29f10d4816e93f5a9c090ee6e7a82c88bd3 (patch) | |
tree | 4e60a65dae5b6b26411b852bcd41c012f617af90 /src/amd/common | |
parent | 87989339a0d350b19b23b916af7886d3dd689ad3 (diff) |
radv: add support for 16bit input/output
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 7b9acfc286a..d3168d08ebb 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1817,6 +1817,10 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx, var->data.location_frac, instr->num_components, is_patch, is_compact, load_inputs); + if (instr->dest.ssa.bit_size == 16) { + result = ac_to_integer(&ctx->ac, result); + result = LLVMBuildTrunc(ctx->ac.builder, result, dest_type, ""); + } return LLVMBuildBitCast(ctx->ac.builder, result, dest_type, ""); } @@ -3817,10 +3821,12 @@ ac_handle_shader_output_decl(struct ac_llvm_context *ctx, } } + bool is_16bit = glsl_type_is_16bit(variable->type); + LLVMTypeRef type = is_16bit ? ctx->f16 : ctx->f32; for (unsigned i = 0; i < attrib_count; ++i) { for (unsigned chan = 0; chan < 4; chan++) { abi->outputs[ac_llvm_reg_index_soa(output_loc + i, chan)] = - ac_build_alloca_undef(ctx, ctx->f32, ""); + ac_build_alloca_undef(ctx, type, ""); } } } |