Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the same information being queried for different extension supports? #195

Open
bigPillowOMG opened this issue Dec 20, 2023 · 6 comments
Labels

Comments

@bigPillowOMG
Copy link

Is there an issue with the code here?
file:VulkanDeviceInfoExtensions.cpp

if (extensionSupported("VK_KHR_external_memory_capabilities")) {
const char* extension("VK_KHR_external_memory_capabilities");
VkPhysicalDeviceIDProperties* extProps = new VkPhysicalDeviceIDProperties{};
extProps->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
deviceProps2 = initDeviceProperties2(extProps);
vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
pushProperty2(extension, "deviceUUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceUUID, 16)));
pushProperty2(extension, "driverUUID", QVariant::fromValue(arrayToQVariantList(extProps->driverUUID, 16)));
pushProperty2(extension, "deviceLUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceLUID, 8)));
pushProperty2(extension, "deviceNodeMask", QVariant(extProps->deviceNodeMask));
pushProperty2(extension, "deviceLUIDValid", QVariant(bool(extProps->deviceLUIDValid)));
delete extProps;
}
if (extensionSupported("VK_KHR_external_semaphore_capabilities")) {
const char* extension("VK_KHR_external_semaphore_capabilities");
VkPhysicalDeviceIDProperties* extProps = new VkPhysicalDeviceIDProperties{};
extProps->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
deviceProps2 = initDeviceProperties2(extProps);
vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
pushProperty2(extension, "deviceUUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceUUID, 16)));
pushProperty2(extension, "driverUUID", QVariant::fromValue(arrayToQVariantList(extProps->driverUUID, 16)));
pushProperty2(extension, "deviceLUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceLUID, 8)));
pushProperty2(extension, "deviceNodeMask", QVariant(extProps->deviceNodeMask));
pushProperty2(extension, "deviceLUIDValid", QVariant(bool(extProps->deviceLUIDValid)));
delete extProps;
}

if (extensionSupported("VK_KHR_external_fence_capabilities")) {
const char* extension("VK_KHR_external_fence_capabilities");
VkPhysicalDeviceIDProperties* extProps = new VkPhysicalDeviceIDProperties{};
extProps->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
deviceProps2 = initDeviceProperties2(extProps);
vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
pushProperty2(extension, "deviceUUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceUUID, 16)));
pushProperty2(extension, "driverUUID", QVariant::fromValue(arrayToQVariantList(extProps->driverUUID, 16)));
pushProperty2(extension, "deviceLUID", QVariant::fromValue(arrayToQVariantList(extProps->deviceLUID, 8)));
pushProperty2(extension, "deviceNodeMask", QVariant(extProps->deviceNodeMask));
pushProperty2(extension, "deviceLUIDValid", QVariant(bool(extProps->deviceLUIDValid)));
delete extProps;
}

@bigPillowOMG
Copy link
Author

Do you want to obtain the VkExternalMemoryProperties, VkExternalSemaphoreProperties, and VkExternalFenceProperties for these three extensions?

@SaschaWillems
Copy link
Owner

SaschaWillems commented Dec 20, 2023

Thanks for bringing this up. That code is auto-generated from the spec and I'll have to check if this is actually correct or not.

@bigPillowOMG
Copy link
Author

Thanks for bringing this up. That code is auto-generated from the spec and I'll have to check if this is actually correct or not.

The aforementioned code is from the VulkanDeviceInfoExtensions::readPhysicalProperties_KHR() function within VulkanDeviceInfoExtensions.cpp. The function aims to acquire the corresponding properties based on the extensions supported by the device. However, I have noticed that within the function, for the three extensions - VK_KHR_external_memory_capabilities, VK_KHR_external_semaphore_capabilities, and VK_KHR_external_fence_capabilities - it seems to query the VkPhysicalDeviceIDProperties. Therefore, I suspect there might be an issue with the code, as it appears that these extensions should respectively be querying the VkExternalMemoryProperties, VkExternalSemaphoreProperties, and VkExternalFenceProperties structures.

@SaschaWillems
Copy link
Owner

Yeah, I changed my comment. That code is auto-generated from the spec, so I need to check if and why it looks like that first.

@SaschaWillems
Copy link
Owner

Just took a look at this. The current code doesn't make much sense, so I'll probably remove it. Adding in the VkExternal*Properties queries won't work here either, due to how that information needs to be queried which is kinda complex and would also require some additions to the database itself.

@bigPillowOMG
Copy link
Author

Just took a look at this. The current code doesn't make much sense, so I'll probably remove it. Adding in the VkExternal*Properties queries won't work here either, due to how that information needs to be queried which is kinda complex and would also require some additions to the database itself.

Thank you for your reply, I am very happy that you can pay attention to this issue. I understand that your code is automatically generated according to the specification, there may be some unnecessary repetition. I also agree with what you said, adding VkExternal*Properties queries may be more complicated, and require some changes to the database itself. I wonder if you have any other ideas or plans to optimize this feature, so that each extension can display its own unique attributes. If you need my help, I am happy to provide you with some suggestions or tests. Looking forward to your next version, your project is very useful and interesting to me. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants