When the depth value was 1.0 and was being converted to Z32_UNORM
the conversion would scale it up to INT32_MAX + 1 which would
cause FPToSI to give incorrect results, changing it to use
FPToUI for the unsigned 32-bit case only fixes it.
Fixes:
GTF-GL45.gtf30.GL3Tests.depth_texture.depth_texture_fbo_clear
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
res = LLVMBuildFMul(builder, src,
lp_build_const_vec(gallivm, src_type, scale), "");
- res = LLVMBuildFPToSI(builder, res, int_vec_type, "");
+ if (!src_type.sign && src_type.width == 32)
+ res = LLVMBuildFPToUI(builder, res, int_vec_type, "");
+ else
+ res = LLVMBuildFPToSI(builder, res, int_vec_type, "");
/*
* Align the most significant bit to its final place.