dzn: Provide a helper to check if 2 formats are compatible
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 30 Jun 2022 11:12:45 +0000 (04:12 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 6 Jul 2022 06:15:46 +0000 (06:15 +0000)
commit53a352e1cfd38226634f857773899ef2d356b213
tree83173868d015735579cf96cac57504d888084895
parentaf294d9ba04b412b924cb7dbe4b9effb998750ec
dzn: Provide a helper to check if 2 formats are compatible

D3D12 supports fomat casting through optional features. Let's
add a helper to query whether 2 formats are compatible or not.
The compatibility depends on the formats+usage pair
(CopyTextureRegion() is less strict than the texture sampling
logic).

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17368>
src/microsoft/vulkan/dzn_image.c
src/microsoft/vulkan/dzn_private.h
src/microsoft/vulkan/dzn_util.c