aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mock_icd_generator.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py
index 0a0e8adc..22b7d1ff 100644
--- a/scripts/mock_icd_generator.py
+++ b/scripts/mock_icd_generator.py
@@ -1016,10 +1016,19 @@ CUSTOM_C_INTERCEPTS = {
GetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
''',
'vkGetPhysicalDeviceExternalBufferProperties':'''
- // Hard-code support for all handle types and features
- pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures = 0x7;
- pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes = 0x1FF;
- pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes = 0x1FF;
+ constexpr VkExternalMemoryHandleTypeFlags supported_flags = 0x1FF;
+ if (pExternalBufferInfo->handleType & supported_flags) {
+ pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures = 0x7;
+ pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes = supported_flags;
+ pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes = supported_flags;
+ } else {
+ pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures = 0;
+ pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes = 0;
+ // According to spec, handle type is always compatible with itself. Even if export/import
+ // not supported, it's important to properly implement self-compatibility property since
+ // application's control flow can rely on this.
+ pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes = pExternalBufferInfo->handleType;
+ }
''',
'vkGetPhysicalDeviceExternalBufferPropertiesKHR':'''
GetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
@@ -1210,6 +1219,14 @@ CUSTOM_C_INTERCEPTS = {
}
return VK_SUCCESS;
''',
+'vkGetFenceWin32HandleKHR': '''
+ *pHandle = (HANDLE)0x12345678;
+ return VK_SUCCESS;
+''',
+'vkGetFenceFdKHR': '''
+ *pFd = 0x42;
+ return VK_SUCCESS;
+''',
'vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR': '''
if (!pCounters) {
*pCounterCount = 3;