util/pack_color: clamp depth values outside range for unorm formats.
authorDave Airlie <airlied@redhat.com>
Mon, 18 Jul 2022 01:30:31 +0000 (11:30 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 28 Jul 2022 00:35:04 +0000 (10:35 +1000)
commit189755a9ac25b887765a920e6faeac4095254315
treef33a939f16316651724f64f8d0b378e6e49e14e6
parent171e35de9191bc66de63e068b7bf2006ae024523
util/pack_color: clamp depth values outside range for unorm formats.

For unrestricted depth ranges, depth clear values for unorm buffers
need to be explicitly clamped. However this has to happen in the
driver when we know the depth buffer format, not at the API level.

Just add clamps to the non-f32 cases and separate it out.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
src/gallium/auxiliary/util/u_pack_color.h