-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chassis: Fix ReleaseValidationObject() #9470
chassis: Fix ReleaseValidationObject() #9470
Conversation
CI Vulkan-ValidationLayers build queued with queue ID 374349. |
CI Vulkan-ValidationLayers build # 19097 running. |
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 KhronosGroup#9412
ea2d53f
to
8505cee
Compare
CI Vulkan-ValidationLayers build queued with queue ID 374399. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -232,7 +233,7 @@ class Instance : public HandleWrapper { | |||
APIVersion api_version; | |||
DeviceExtensions extensions{}; | |||
|
|||
mutable std::vector<std::unique_ptr<base::Instance>> object_dispatch; | |||
mutable std::list<std::unique_ptr<base::Instance>> object_dispatch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::list is a rare guest, maybe a comment why we use it.
CI Vulkan-ValidationLayers build # 19098 running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix from my PR now updated to manage the issues Artem should work, but the for loop update needs to be propagated to every functions -_- auto& object_dispatches = vvl::dispatch::GetData(*pDevice)->object_dispatch;
for (int32_t i = 0; i < object_dispatches.size(); ++i) {
auto& vo = object_dispatches[i];
vo->FinishDeviceSetup(modified_create_info.ptr(), record_obj.location);
if (!object_dispatches[i]) {
--i;
}
} But that assumes that GPU-AV unique pointers only gets nulled, not actually removed. So maybe we need to go: auto& object_dispatches = vvl::dispatch::GetData(*pDevice)->object_dispatch;
for (int32_t i = 0; i < object_dispatches.size(); ++i) {
auto& vo = object_dispatches[i];
const size_t tmp_size = object_dispatches.size();
vo->FinishDeviceSetup(modified_create_info.ptr(), record_obj.location);
if ( tmp_size != object_dispatches.size()) {
--i;
}
} |
CI Vulkan-ValidationLayers build # 19098 failed. |
yes this approach won't work either. :( |
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