From: Bas Nieuwenhuizen Date: Sun, 28 Jul 2019 20:32:33 +0000 (+0200) Subject: ac/nir: Use correct cast for readfirstlane and ptrs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2af00b1fdd9ce58b9e953540e447fdce4d3b9502;p=mesa.git ac/nir: Use correct cast for readfirstlane and ptrs. Fixes: 028ce527 "radv: Add non-uniform indexing lowering." Reviewed-by: Dave Airlie Reviewed-by: Samuel Pitoiset --- diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index a666ecd1ea1..0943d0364dd 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -3840,6 +3840,8 @@ ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef la LLVMConstInt(ctx->i32, i, 0), ""); } } + if (LLVMGetTypeKind(src_type) == LLVMPointerTypeKind) + return LLVMBuildIntToPtr(ctx->builder, ret, src_type, ""); return LLVMBuildBitCast(ctx->builder, ret, src_type, ""); }