aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorspencer-lunarg <spencer@lunarg.com>2024-03-19 18:07:36 +0900
committerSpencer Fricke <115671160+spencer-lunarg@users.noreply.github.com>2024-03-19 21:00:00 +0900
commit934b5f7c13374949527b71b9732b93b5bc0fcc3e (patch)
tree3d702b2595ed2555ac64ef31a6979918e4c6aa08 /scripts
parente5f1de89683f3e029f81189051372a3c379bd90a (diff)
downloadusermoji-934b5f7c13374949527b71b9732b93b5bc0fcc3e.tar.xz
icd: Fix DEVICE_LOST injection null check
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mock_icd_generator.py8
1 files changed, 5 insertions, 3 deletions
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<const VkBaseInStructure *>(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<const VkBaseInStructure *>(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;
''',