From 934b5f7c13374949527b71b9732b93b5bc0fcc3e Mon Sep 17 00:00:00 2001 From: spencer-lunarg Date: Tue, 19 Mar 2024 18:07:36 +0900 Subject: icd: Fix DEVICE_LOST injection null check --- scripts/mock_icd_generator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index bc8cef92..5f333f72 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -1659,9 +1659,11 @@ CUSTOM_C_INTERCEPTS = { // Picked VkExportFenceCreateInfo because needed some struct that wouldn't get cleared by validation Safe Struct // ... TODO - It would be MUCH nicer to have a layer or other setting control when this occured // For now this is used to allow Validation Layers test reacting to device losts - auto pNext = reinterpret_cast(pSubmits[0].pNext); - if (pNext && pNext->sType == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO && pNext->pNext == nullptr) { - return VK_ERROR_DEVICE_LOST; + if (submitCount > 0 && pSubmits) { + auto pNext = reinterpret_cast(pSubmits[0].pNext); + if (pNext && pNext->sType == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO && pNext->pNext == nullptr) { + return VK_ERROR_DEVICE_LOST; + } } return VK_SUCCESS; ''', -- cgit v1.2.3