diff options
author | Dave Airlie <airlied@redhat.com> | 2016-10-25 06:53:03 +1000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-10-27 11:29:49 +0100 |
commit | d35c4d15121c9bd8d5d8ea4a10356e6be91798c4 (patch) | |
tree | f6f47b25ad57d6a371d8231cee2a804a69b8c8da | |
parent | 5c004253543eb1ebc492be127f21cc8cd335384a (diff) | |
download | external_mesa3d-d35c4d15121c9bd8d5d8ea4a10356e6be91798c4.zip external_mesa3d-d35c4d15121c9bd8d5d8ea4a10356e6be91798c4.tar.gz external_mesa3d-d35c4d15121c9bd8d5d8ea4a10356e6be91798c4.tar.bz2 |
radv/ac/llvm: trim texture return values
The intrinsic engine asserts in llvm due to this,
as we put a vec4 into a vec1, and the next instruction
isn't expecting it.
So trim the vector at the end before inserting it.
Reported-by: Christoph Haag <haagch+mesadev@frickel.club>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d548fa882b865b8e5052954b872e392312c38ab8)
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 08dac80..b757e8c 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3520,7 +3520,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr) LLVMValueRef z = LLVMBuildExtractElement(ctx->builder, result, two, ""); z = LLVMBuildSDiv(ctx->builder, z, six, ""); result = LLVMBuildInsertElement(ctx->builder, result, z, two, ""); - } + } else if (instr->dest.ssa.num_components != 4) + result = trim_vector(ctx, result, instr->dest.ssa.num_components); write_result: if (result) { |