intel: Fix crashes for importing drm buffer
authorPeng Huang <shawn.p.huang@gmail.com>
Sun, 11 Dec 2022 21:07:06 +0000 (16:07 -0500)
committerEric Engestrom <eric@engestrom.ch>
Wed, 14 Dec 2022 20:47:02 +0000 (20:47 +0000)
commit3e3def9620017b83b8032d4ed20b3419cf0e6513
tree7831a5d7515f01c221c542cd1fe9988877dacece
parent0c7a3133ac6a7746ee9856a6ad4c5b7835dc858c
intel: Fix crashes for importing drm buffer

image_aspect_to_binding() converts aspect to index by subrracting
VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT, however these enum values
are bitfields, not consecutive numbers, so comparing and subtracting
them won't work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20269>
(cherry picked from commit 7642f3b99c8b17c7cfa1f140c65ce82e7dbcea2b)
.pick_status.json
src/intel/vulkan/anv_image.c