mesa: (more) correctly handle incomplete depth textures
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 20 Jan 2023 19:53:32 +0000 (14:53 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 24 Jan 2023 09:13:48 +0000 (09:13 +0000)
commit0c6e56c391a262bef2d20037b4ca77d60948f3e7
treea8bf967e07e970bdce4c00988ef8fc535b504e22
parent818cc3085261e905c436ab2fcd7d6ac4ad1dc0c8
mesa: (more) correctly handle incomplete depth textures

according to GL spec, incomplete shadow samplers should return 0

this is technically possible for drivers to do using a RGBA texture in
the sense that somehow it's been working, but it's broken at the gallium-level
for what drivers should be expecting to see in such circumstances given
that such scenarios have been binding a RGBA texture to use with shadow samplers

instead, we can give drivers a fallback Z32 texture to avoid format/sampler
mismatches and complying with expected behavior

see also KHR-GL46.incomplete_texture_access.sampler for driver-specific testing

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
src/mesa/main/mtypes.h
src/mesa/main/shared.c
src/mesa/main/texobj.c
src/mesa/main/texobj.h
src/mesa/main/texstate.c
src/mesa/state_tracker/st_context.c