Pass image memory requirements to allocation routine in allocateAndBindMemory.
VK_KHR_get_memory_requirements2 is a device extension (not instance).
Throw NotSupported when external handle requires dedicated allocation,
but 'suballocated' variant of test is being run.
Affects:
dEQP-VK.synchronization.cross_instance.*
Components: Vulkan
VK-GL-CTS issue: 604
Bug:
65490152
Bug:
65202260
Test: Ran tests on couple of Google devices
Change-Id: I3636779459300f5dee2e22b0a2e04762eb7b0601
if (!dedicated && dedicatedRequirements.requiresDedicatedAllocation)
TCU_THROW(NotSupportedError, "Memory requires dedicated allocation");
if (!dedicated && dedicatedRequirements.requiresDedicatedAllocation)
TCU_THROW(NotSupportedError, "Memory requires dedicated allocation");
+
+ memoryRequirements = requirements.memoryRequirements;
, m_physicalDeviceA (getPhysicalDevice(m_vkiA, *m_instanceA, context.getTestContext().getCommandLine()))
, m_queueFamiliesA (vk::getPhysicalDeviceQueueFamilyProperties(m_vkiA, m_physicalDeviceA))
, m_queueFamilyIndicesA (getFamilyIndices(m_queueFamiliesA))
, m_physicalDeviceA (getPhysicalDevice(m_vkiA, *m_instanceA, context.getTestContext().getCommandLine()))
, m_queueFamiliesA (vk::getPhysicalDeviceQueueFamilyProperties(m_vkiA, m_physicalDeviceA))
, m_queueFamilyIndicesA (getFamilyIndices(m_queueFamiliesA))
- , m_getMemReq2Supported (de::contains(context.getInstanceExtensions().begin(), context.getInstanceExtensions().end(), "VK_KHR_get_memory_requirements2"))
+ , m_getMemReq2Supported (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_get_memory_requirements2"))
, m_deviceA (createDevice(m_vkiA, m_physicalDeviceA, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported))
, m_vkdA (m_vkiA, *m_deviceA)
, m_deviceA (createDevice(m_vkiA, m_physicalDeviceA, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported))
, m_vkdA (m_vkiA, *m_deviceA)
if ((externalProperties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) == 0)
TCU_THROW(NotSupportedError, "Importing image resource not supported");
if ((externalProperties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) == 0)
TCU_THROW(NotSupportedError, "Importing image resource not supported");
+
+ if (!m_config.dedicated && (externalProperties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR) != 0)
+ {
+ TCU_THROW(NotSupportedError, "Handle requires dedicated allocation, but test uses suballocated memory");
+ }
if ((properties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR) == 0
|| (properties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) == 0)
TCU_THROW(NotSupportedError, "Exporting and importing memory type not supported");
if ((properties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR) == 0
|| (properties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) == 0)
TCU_THROW(NotSupportedError, "Exporting and importing memory type not supported");
+
+ if (!m_config.dedicated && (properties.externalMemoryProperties.externalMemoryFeatures & vk::VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR) != 0)
+ {
+ TCU_THROW(NotSupportedError, "Handle requires dedicated allocation, but test uses suballocated memory");
+ }
}
// Check semaphore support
}
// Check semaphore support