summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-07-15 10:44:53 +0200
committerSamuel Pitoiset <[email protected]>2019-07-16 08:12:34 +0200
commit994253b40003a31df87fd60a06fa18d0aebaa33f (patch)
tree7beb79b1255b8e2627a8d393e1ef83ac77259264 /src/amd
parentd8844533af8534277e126125aa25783b43e7101c (diff)
radv/gfx10: add missing conversions for 16-bit exports
This fixes dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.input_output_* Found with RADV_DEBUG=checkir Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 5ab0d557819..7573292f5c8 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -3677,6 +3677,13 @@ static void gfx10_ngg_gs_emit_epilogue_2(struct radv_shader_context *ctx)
gep_idx[2] = LLVMConstInt(ctx->ac.i32, out_idx, false);
tmp = LLVMBuildGEP(builder, vertexptr, gep_idx, 3, "");
tmp = LLVMBuildLoad(builder, tmp, "");
+
+ LLVMTypeRef type = LLVMGetAllocatedType(ctx->abi.outputs[ac_llvm_reg_index_soa(i, j)]);
+ if (ac_get_type_size(type) == 2) {
+ tmp = ac_to_integer(&ctx->ac, tmp);
+ tmp = LLVMBuildTrunc(ctx->ac.builder, tmp, ctx->ac.i16, "");
+ }
+
outputs[noutput].values[j] = ac_to_float(&ctx->ac, tmp);
}
@@ -3757,6 +3764,8 @@ static void gfx10_ngg_gs_emit_vertex(struct radv_shader_context *ctx,
LLVMValueRef ptr = LLVMBuildGEP(builder, vertexptr, gep_idx, 3, "");
out_val = ac_to_integer(&ctx->ac, out_val);
+ out_val = LLVMBuildZExtOrBitCast(ctx->ac.builder, out_val, ctx->ac.i32, "");
+
LLVMBuildStore(builder, out_val, ptr);
}
}