radv: Add asserts to vk_format_depth/stencil_only
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 30 Jul 2021 17:40:09 +0000 (12:40 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 17 Aug 2021 21:29:35 +0000 (21:29 +0000)
commit7878d516c67a8b64607bc38e1f42fe584fcf021e
tree6765fcc267ee02de99d2d60612bf60ac3f5b69ec
parent3b006961178bdb6579219226edd10635779082be
radv: Add asserts to vk_format_depth/stencil_only

It doesn't make sense to ask for the depth-only or stencil-only format
if there is no depth or stencil.  One bit of radv_image.c did seem to
take advantage of the default case in vk_format_depth_only so throw an
`if (vk_format_has_depth(format))` around it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
src/amd/vulkan/radv_image.c
src/amd/vulkan/vk_format.h