summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Schuchardt <mikes@lunarg.com>2022-02-09 12:07:26 -0800
committerMike Schuchardt <mikes@lunarg.com>2022-02-09 13:19:11 -0800
commit48f36ffd590bbbd57485600396f71bf3ddba8109 (patch)
tree8505f493ab983512a56c8da2e05cf32ced47eae6
parent7087fbbc85fbd5d47dd5fd4fef3c0cd35a52fdd1 (diff)
downloadVulkan-Tools-48f36ffd590bbbd57485600396f71bf3ddba8109.tar.gz
Vulkan-Tools-48f36ffd590bbbd57485600396f71bf3ddba8109.tar.bz2
Vulkan-Tools-48f36ffd590bbbd57485600396f71bf3ddba8109.zip
vulkaninfo: Enable portability extension for device groups
Expand previous change to include device group creation. Also added some VK_ENABLE_BETA_EXTENSIONS guards around the portability identifiers.
-rw-r--r--vulkaninfo/vulkaninfo.cpp4
-rw-r--r--vulkaninfo/vulkaninfo.h23
2 files changed, 19 insertions, 8 deletions
diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp
index d53f93cc..b57b0261 100644
--- a/vulkaninfo/vulkaninfo.cpp
+++ b/vulkaninfo/vulkaninfo.cpp
@@ -75,7 +75,7 @@ void DumpLayers(Printer &p, std::vector<LayerExtensionList> layers, const std::v
ArrayWrapper arr_devices(p, "Devices", gpus.size());
for (auto &gpu : gpus) {
p.PrintKeyValue("GPU id", gpu->id, gpu->props.deviceName);
- auto exts = gpu->AppGetPhysicalDeviceLayerExtensions(props.layerName);
+ auto exts = gpu->inst.AppGetPhysicalDeviceLayerExtensions(gpu->phys_device, props.layerName);
DumpExtensions(p, "Layer-Device", exts);
p.AddNewline();
}
@@ -106,7 +106,7 @@ void DumpLayers(Printer &p, std::vector<LayerExtensionList> layers, const std::v
for (auto &gpu : gpus) {
ObjectWrapper obj_gpu(p, gpu->props.deviceName);
p.PrintKeyValue("GPU id", gpu->id, gpu->props.deviceName);
- auto exts = gpu->AppGetPhysicalDeviceLayerExtensions(layer.layer_properties.layerName);
+ auto exts = gpu->inst.AppGetPhysicalDeviceLayerExtensions(gpu->phys_device, layer.layer_properties.layerName);
DumpExtensions(p, "Layer-Device", exts);
}
}
diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h
index fb4cf4f5..789e7ad7 100644
--- a/vulkaninfo/vulkaninfo.h
+++ b/vulkaninfo/vulkaninfo.h
@@ -703,6 +703,11 @@ struct AppInstance {
std::vector<VkPhysicalDevice> FindPhysicalDevices() {
return GetVector<VkPhysicalDevice>("vkEnumeratePhysicalDevices", dll.fp_vkEnumeratePhysicalDevices, instance);
}
+
+ std::vector<VkExtensionProperties> AppGetPhysicalDeviceLayerExtensions(VkPhysicalDevice phys_device, const char *layer_name) {
+ return GetVector<VkExtensionProperties>("vkEnumerateDeviceExtensionProperties", dll.fp_vkEnumerateDeviceExtensionProperties,
+ phys_device, layer_name);
+ }
};
// --------- Platform Specific Presentation Calls --------- //
@@ -1277,6 +1282,15 @@ util::vulkaninfo_optional<VkDeviceGroupPresentCapabilitiesKHR> GetGroupCapabilit
VkPhysicalDeviceGroupProperties group) {
// Build create info for logical device made from all physical devices in this group.
std::vector<std::string> extensions_list = {VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_DEVICE_GROUP_EXTENSION_NAME};
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ for (const auto &extension : inst.AppGetPhysicalDeviceLayerExtensions(group.physicalDevices[0], nullptr)) {
+ if (std::string(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == extension.extensionName) {
+ extensions_list.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
+ }
+ }
+#endif
+
VkDeviceGroupDeviceCreateInfoKHR dg_ci = {VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR, nullptr,
group.physicalDeviceCount, group.physicalDevices};
@@ -1507,18 +1521,20 @@ struct AppGpu {
}
}
- device_extensions = AppGetPhysicalDeviceLayerExtensions(nullptr);
+ device_extensions = inst.AppGetPhysicalDeviceLayerExtensions(phys_device, nullptr);
if (features.sparseBinding) {
enabled_features.sparseBinding = VK_TRUE;
}
std::vector<const char *> extensions_to_enable;
+#ifdef VK_ENABLE_BETA_EXTENSIONS
for (const auto &extension : device_extensions) {
if (std::string(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == extension.extensionName) {
extensions_to_enable.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
}
}
+#endif
const float queue_priority = 1.0f;
// pick the first queue index and hope for the best
@@ -1663,11 +1679,6 @@ struct AppGpu {
[extension_to_check](VkExtensionProperties &prop) { return prop.extensionName == extension_to_check; });
}
- std::vector<VkExtensionProperties> AppGetPhysicalDeviceLayerExtensions(const char *layer_name) {
- return GetVector<VkExtensionProperties>("vkEnumerateDeviceExtensionProperties",
- inst.dll.fp_vkEnumerateDeviceExtensionProperties, phys_device, layer_name);
- }
-
// Helper function to determine whether a format range is currently supported.
bool FormatRangeSupported(FormatRange &format_range) {
// True if standard and supported by both this instance and this GPU