From e5f1de89683f3e029f81189051372a3c379bd90a Mon Sep 17 00:00:00 2001 From: spencer-lunarg Date: Tue, 19 Mar 2024 15:49:46 +0900 Subject: icd: Add special fault injection logic --- scripts/mock_icd_generator.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index bb04edb7..bc8cef92 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -1654,6 +1654,17 @@ CUSTOM_C_INTERCEPTS = { *pFence = (VkFence)global_unique_handle++; return VK_SUCCESS; ''', +'vkQueueSubmit': ''' + // Special way to cause DEVICE_LOST + // 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; + } + return VK_SUCCESS; +''', } # MockICDGeneratorOptions - subclass of GeneratorOptions. -- cgit v1.2.3