vulkan,anv: Move the DEFINE_HANDLE_CASTS macros to vk_object.h
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 21 Apr 2020 20:03:58 +0000 (15:03 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 14:06:27 +0000 (14:06 +0000)
commit73fb7cdbe1c8ce476f21cb6d39944a96151ec4b5
tree32610a036afe7b16be791e2c4c97eded5699a182
parent682c81bdfb7ea28efccea1e8cbfeb7cfc67d02b8
vulkan,anv: Move the DEFINE_HANDLE_CASTS macros to vk_object.h

We've already got these duplicated a bunch of places.  They should
really probably live in common code.  The new versions take two more
arguments:

 1. The struct member which gets you from __driver_type to the
    vk_object_base.  This requires drivers which use this to also use
    vk_object_base.

 2. The VkObjectType enum which represents that object type.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>
src/intel/vulkan/anv_private.h
src/vulkan/util/vk_object.h