vulkan/object: Always include the type
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 8 May 2020 01:07:14 +0000 (20:07 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 8 May 2020 17:09:27 +0000 (17:09 +0000)
This was causing problems for some of the ANV unit tests when run in
release mode.  Having a public struct whose layout depends on NDEBUG
seems kind-of sketchy anyway.

Fixes: 32f20783a51 "vulkan: Add run-time object type asserts in..."
Closes: #2903
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4959>

src/vulkan/util/vk_object.c
src/vulkan/util/vk_object.h

index f84a68034b07d0e3a7ee414656eae4713397f66b..70519dbc718f3d116bed60dfee306b5b71842c0b 100644 (file)
@@ -29,9 +29,7 @@ vk_object_base_init(UNUSED struct vk_device *device,
                     UNUSED VkObjectType obj_type)
 {
    base->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
                     UNUSED VkObjectType obj_type)
 {
    base->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
-#ifndef NDEBUG
    base->type = obj_type;
    base->type = obj_type;
-#endif
 }
 
 void
 }
 
 void
index bd32f1ad68124924121266a0d65376763365e760..d28f79d4943c2f236b9953dc8b5acdd2ce17335b 100644 (file)
@@ -36,9 +36,7 @@ struct vk_device;
 
 struct vk_object_base {
    VK_LOADER_DATA _loader_data;
 
 struct vk_object_base {
    VK_LOADER_DATA _loader_data;
-#ifndef NDEBUG
    VkObjectType type;
    VkObjectType type;
-#endif
 };
 
 void vk_object_base_init(UNUSED struct vk_device *device,
 };
 
 void vk_object_base_init(UNUSED struct vk_device *device,