test_vulkan: Fix some VVL errors (#2486)

Fixes the following VVL errors:

```
Validation Error: [ VUID-VkExternalSemaphoreProperties-sType-sType ] | MessageID = 0x160be1e8
vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(): pExternalSemaphoreProperties->sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES.
The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES (https://docs.vulkan.org/spec/latest/chapters/capabilities.html#VUID-VkExternalSemaphoreProperties-sType-sType)
```

```
Validation Error: [ VUID-VkImportSemaphoreFdInfoKHR-handleType-07307 ] | MessageID = 0x1b609443
vkImportSemaphoreFdKHR(): pImportSemaphoreFdInfo->handleType is VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT so VK_SEMAPHORE_IMPORT_TEMPORARY_BIT must be set, but flags is VkSemaphoreImportFlags(0).
The Vulkan spec states: If handleType refers to a handle type with copy payload transference semantics, flags must contain VK_SEMAPHORE_IMPORT_TEMPORARY_BIT (https://docs.vulkan.org/spec/latest/chapters/synchronization.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-07307)
```

```
Validation Error: [ VUID-VkPhysicalDeviceExternalBufferInfo-None-09500 ] | MessageID = 0x8434cf
vkGetPhysicalDeviceExternalBufferPropertiesKHR(): pExternalBufferInfo->usage is zero.
The Vulkan spec states: If the pNext chain does not include a VkBufferUsageFlags2CreateInfo structure, usage must not be 0 (https://docs.vulkan.org/spec/latest/chapters/capabilities.html#VUID-VkPhysicalDeviceExternalBufferInfo-None-09500)
```
This commit is contained in:
Karol Herbst
2025-08-19 19:06:37 +02:00
committed by GitHub
parent e51fadbbb1
commit 909095f60a
2 changed files with 6 additions and 2 deletions

View File

@@ -1233,7 +1233,7 @@ int clExternalExportableSemaphore::signal(cl_command_queue cmd_queue)
import.fd = fd;
import.pNext = nullptr;
import.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR;
import.flags = 0;
import.flags = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT;
VkResult res =
vkImportSemaphoreFdKHR(m_deviceSemaphore.getDevice(), &import);

View File

@@ -243,6 +243,8 @@ getSupportedVulkanExternalMemoryHandleTypeList(
VkPhysicalDeviceExternalBufferInfo buffer_info = {};
buffer_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO;
buffer_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
buffer_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT
| VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
VkExternalBufferProperties buffer_properties = {};
buffer_properties.sType = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES;
@@ -307,7 +309,9 @@ getSupportedVulkanExternalSemaphoreHandleTypeList(const VulkanDevice &vkDevice)
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, nullptr,
handle_type.vk_type
};
VkExternalSemaphoreProperties query_result = {};
VkExternalSemaphoreProperties query_result = {
VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES
};
vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
vkDevice.getPhysicalDevice(), &handle_query, &query_result);
if (query_result.externalSemaphoreFeatures