pvr: fix calculation for textures z position fractional part

The fractional part of the z position will only be used with linear or bi-linear
filtering. Otherwise it is safe to discard the original fractional value and
reset it to 0.5.

Fixes: 480bdff4b5 ("pvr: Add support to process transfer and blit cmds")
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31679>
This commit is contained in:
Luigi Santivetti 2024-05-02 14:49:37 +01:00 committed by Marge Bot
parent c1bd0deb97
commit 1b67637fa0

View file

@ -3128,7 +3128,7 @@ pvr_isp_prim_block_tsp_vertex_block(const struct pvr_device_info *dev_info,
[Z] = z_present ? 1.0f / (float)src->surface.depth : 0.0f,
};
float z_pos = (src->filter < PVR_FILTER_LINEAR)
? floor(src->surface.z_position + 0.5f)
? floor(src->surface.z_position) + 0.5f
: src->surface.z_position;
pvr_tsp_floats(dev_info,