From 8505cee5dea3c40f21bfdd7417b061ef8231e441 Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Tue, 18 Feb 2025 09:46:52 -0700 Subject: [PATCH] chassis: Fix ReleaseValidationObject() GPU-AV can detect problems and remove itself from object_dispatch and intercept_vectors. Make these lists rather than vectors so that removal doesn't invalidate iterators. Removal can happen during the FinishDeviceSetup() loop or possibly any other vulkan call. GPU-AV is not the last entry in these lists and calls still need to happen for anything after it (currently only syncval), so playing games with vector indexing will not work. Fixes #9412 --- layers/chassis/dispatch_object.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/layers/chassis/dispatch_object.h b/layers/chassis/dispatch_object.h index 298c15275d7..9e10660ffb6 100644 --- a/layers/chassis/dispatch_object.h +++ b/layers/chassis/dispatch_object.h @@ -21,6 +21,7 @@ #pragma once #include +#include #include #include @@ -232,7 +233,7 @@ class Instance : public HandleWrapper { APIVersion api_version; DeviceExtensions extensions{}; - mutable std::vector> object_dispatch; + mutable std::list> object_dispatch; VkInstance instance = VK_NULL_HANDLE; VkLayerInstanceDispatchTable instance_dispatch_table; @@ -293,9 +294,9 @@ class Device : public HandleWrapper { VkDevice device = VK_NULL_HANDLE; VkLayerDispatchTable device_dispatch_table; - mutable std::vector> object_dispatch; - mutable std::vector> aborted_object_dispatch; - mutable std::vector> intercept_vectors; + mutable std::list> object_dispatch; + mutable std::list> aborted_object_dispatch; + mutable std::vector> intercept_vectors; // Handle Wrapping Data // Wrapping Descriptor Template Update structures requires access to the template createinfo structs vvl::unordered_map> desc_template_createinfo_map;