ac/nir: Use correct cast for readfirstlane and ptrs.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 28 Jul 2019 20:32:33 +0000 (22:32 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 6 Aug 2019 15:48:50 +0000 (15:48 +0000)
Fixes: 028ce527 "radv: Add non-uniform indexing lowering."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_llvm_build.c

index a666ecd1ea18805f971ac4a2e301700fa0f1b09f..0943d0364ddabc33bd041be5f5a049551f00c873 100644 (file)
@@ -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, "");
 }