zink: emulate optional depth-formats
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 23 Oct 2019 09:59:03 +0000 (11:59 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 17:57:49 +0000 (17:57 +0000)
commit810fc75dabafd69e9db4621d2acca8cb6ecfcddf
tree51e9d58265ba7ddb10d6389d0bcb1f850874f120
parente6ea350fb0f02753f367ced0a32d4fb4e49b4456
zink: emulate optional depth-formats

The Vulkan spec says that an implementation has to support one of
VK_FORMAT_X8_D24_UNORM_PACK32 and VK_FORMAT_D32_SFLOAT, as well of
one of VK_FORMAT_D24_UNORM_S8_UINT and VK_FORMAT_D32_SFLOAT_S8_UINT.

So let's keep track which one is supported of earch pair, and emulate
one on top of the other one.

This won't give the exact result for comparisons, or when mapping and
unmapping the resources. But it's better than flat out failing to create
the resource, and we can fix the map/unmap issue later if needed.

Tested-by: Duncan Hopkins <duncan@thefoundry.co.uk>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_resource.c
src/gallium/drivers/zink/zink_screen.c
src/gallium/drivers/zink/zink_screen.h
src/gallium/drivers/zink/zink_state.c
src/gallium/drivers/zink/zink_surface.c