gallivm/nir: bitcast when non-float ptr type.

This matters more when opaque pointers are used.

Fixes: 203920d4c6 ("gallivm: add atomic 32-bit float support")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18835>
This commit is contained in:
Dave Airlie
2022-09-27 15:26:42 +10:00
committed by Marge Bot
parent c642fa122c
commit f292212615

View File

@@ -1224,7 +1224,7 @@ mem_access_base_pointer(struct lp_build_nir_context *bld_base,
}
/* Cast it to the pointer type of the access this instruction is doing. */
if (bit_size == 32)
if (bit_size == 32 && !mem_bld->type.floating)
return ptr;
else
return LLVMBuildBitCast(gallivm->builder, ptr, LLVMPointerType(mem_bld->elem_type, 0), "");