diff --git a/Vulkan-Headers b/Vulkan-Headers index 2565ffa..450ead1 160000 --- a/Vulkan-Headers +++ b/Vulkan-Headers @@ -1 +1 @@ -Subproject commit 2565ffa31ea67650f95f65347ed8f5917c651fac +Subproject commit 450ead13e1064584da027d91192bd7bfb724640f diff --git a/VulkanDeviceInfoExtensions.cpp b/VulkanDeviceInfoExtensions.cpp index 136386d..8a59059 100644 --- a/VulkanDeviceInfoExtensions.cpp +++ b/VulkanDeviceInfoExtensions.cpp @@ -68,6 +68,19 @@ void VulkanDeviceInfoExtensions::readPhysicalProperties_AMD() { pushProperty2(extension, "activeComputeUnitCount", QVariant(extProps.activeComputeUnitCount)); } } +void VulkanDeviceInfoExtensions::readPhysicalProperties_AMDX() { + if (extensionSupported("VK_AMDX_shader_enqueue")) { + const char* extension("VK_AMDX_shader_enqueue"); + VkPhysicalDeviceShaderEnqueuePropertiesAMDX extProps { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_PROPERTIES_AMDX }; + VkPhysicalDeviceProperties2 deviceProps2(initDeviceProperties2(&extProps)); + vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); + pushProperty2(extension, "maxExecutionGraphDepth", QVariant(extProps.maxExecutionGraphDepth)); + pushProperty2(extension, "maxExecutionGraphShaderOutputNodes", QVariant(extProps.maxExecutionGraphShaderOutputNodes)); + pushProperty2(extension, "maxExecutionGraphShaderPayloadSize", QVariant(extProps.maxExecutionGraphShaderPayloadSize)); + pushProperty2(extension, "maxExecutionGraphShaderPayloadCount", QVariant(extProps.maxExecutionGraphShaderPayloadCount)); + pushProperty2(extension, "executionGraphDispatchAddressAlignment", QVariant(extProps.executionGraphDispatchAddressAlignment)); + } +} void VulkanDeviceInfoExtensions::readPhysicalProperties_ARM() { if (extensionSupported("VK_ARM_shader_core_properties")) { const char* extension("VK_ARM_shader_core_properties"); @@ -266,6 +279,27 @@ void VulkanDeviceInfoExtensions::readPhysicalProperties_EXT() { vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); pushProperty2(extension, "lineSubPixelPrecisionBits", QVariant(extProps.lineSubPixelPrecisionBits)); } + if (extensionSupported("VK_EXT_host_image_copy")) { + // This extension needs some special handling, this code has to be adjusted manually after header generation + const char* extension("VK_EXT_host_image_copy"); + VkPhysicalDeviceHostImageCopyPropertiesEXT extProps { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT }; + VkPhysicalDeviceProperties2 deviceProps2(initDeviceProperties2(&extProps)); + // First call will return the sizes of the image format lists + vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); + pushProperty2(extension, "copySrcLayoutCount", QVariant(extProps.copySrcLayoutCount)); + pushProperty2(extension, "copyDstLayoutCount", QVariant(extProps.copyDstLayoutCount)); + pushProperty2(extension, "optimalTilingLayoutUUID", QVariant::fromValue(arrayToQVariantList(extProps.optimalTilingLayoutUUID, 16))); + pushProperty2(extension, "identicalMemoryTypeRequirements", QVariant(bool(extProps.identicalMemoryTypeRequirements))); + // Second call to get the source and destination format list + std::vector copySrcLayouts(extProps.copySrcLayoutCount); + std::vector copyDstLayouts(extProps.copyDstLayoutCount); + extProps.pCopySrcLayouts = copySrcLayouts.data(); + extProps.pCopyDstLayouts = copyDstLayouts.data(); + vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); + // Store them as serialized values + pushProperty2(extension, "pCopySrcLayouts", QVariant::fromValue(arrayToQVariantList(copySrcLayouts, copySrcLayouts.size()))); + pushProperty2(extension, "pCopyDstLayouts", QVariant::fromValue(arrayToQVariantList(copySrcLayouts, copyDstLayouts.size()))); + } if (extensionSupported("VK_EXT_texel_buffer_alignment")) { const char* extension("VK_EXT_texel_buffer_alignment"); VkPhysicalDeviceTexelBufferAlignmentProperties extProps { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES }; @@ -689,6 +723,18 @@ void VulkanDeviceInfoExtensions::readPhysicalProperties_KHR() { vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); pushProperty2(extension, "maxBufferSize", QVariant::fromValue(extProps.maxBufferSize)); } + if (extensionSupported("VK_KHR_maintenance5")) { + const char* extension("VK_KHR_maintenance5"); + VkPhysicalDeviceMaintenance5PropertiesKHR extProps { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR }; + VkPhysicalDeviceProperties2 deviceProps2(initDeviceProperties2(&extProps)); + vulkanContext.vkGetPhysicalDeviceProperties2KHR(device, &deviceProps2); + pushProperty2(extension, "earlyFragmentMultisampleCoverageAfterSampleCounting", QVariant(bool(extProps.earlyFragmentMultisampleCoverageAfterSampleCounting))); + pushProperty2(extension, "earlyFragmentSampleMaskTestBeforeSampleCounting", QVariant(bool(extProps.earlyFragmentSampleMaskTestBeforeSampleCounting))); + pushProperty2(extension, "depthStencilSwizzleOneSupport", QVariant(bool(extProps.depthStencilSwizzleOneSupport))); + pushProperty2(extension, "polygonModePointSize", QVariant(bool(extProps.polygonModePointSize))); + pushProperty2(extension, "nonStrictSinglePixelWideLinesUseParallelogram", QVariant(bool(extProps.nonStrictSinglePixelWideLinesUseParallelogram))); + pushProperty2(extension, "nonStrictWideLinesUseParallelogram", QVariant(bool(extProps.nonStrictWideLinesUseParallelogram))); + } if (extensionSupported("VK_KHR_cooperative_matrix")) { const char* extension("VK_KHR_cooperative_matrix"); VkPhysicalDeviceCooperativeMatrixPropertiesKHR extProps { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR }; @@ -856,6 +902,7 @@ void VulkanDeviceInfoExtensions::readPhysicalProperties_QCOM() { void VulkanDeviceInfoExtensions::readExtendedProperties() { readPhysicalProperties_AMD(); + readPhysicalProperties_AMDX(); readPhysicalProperties_ARM(); readPhysicalProperties_EXT(); readPhysicalProperties_HUAWEI(); @@ -892,6 +939,15 @@ void VulkanDeviceInfoExtensions::readPhysicalFeatures_AMD() { pushFeature2(extension, "shaderEarlyAndLateFragmentTests", extFeatures.shaderEarlyAndLateFragmentTests); } } +void VulkanDeviceInfoExtensions::readPhysicalFeatures_AMDX() { + if (extensionSupported("VK_AMDX_shader_enqueue")) { + const char* extension("VK_AMDX_shader_enqueue"); + VkPhysicalDeviceShaderEnqueueFeaturesAMDX extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_FEATURES_AMDX }; + VkPhysicalDeviceFeatures2 deviceFeatures2(initDeviceFeatures2(&extFeatures)); + vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); + pushFeature2(extension, "shaderEnqueue", extFeatures.shaderEnqueue); + } +} void VulkanDeviceInfoExtensions::readPhysicalFeatures_ARM() { if (extensionSupported("VK_ARM_rasterization_order_attachment_access")) { const char* extension("VK_ARM_rasterization_order_attachment_access"); @@ -1127,6 +1183,13 @@ void VulkanDeviceInfoExtensions::readPhysicalFeatures_EXT() { vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); pushFeature2(extension, "extendedDynamicState", extFeatures.extendedDynamicState); } + if (extensionSupported("VK_EXT_host_image_copy")) { + const char* extension("VK_EXT_host_image_copy"); + VkPhysicalDeviceHostImageCopyFeaturesEXT extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT }; + VkPhysicalDeviceFeatures2 deviceFeatures2(initDeviceFeatures2(&extFeatures)); + vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); + pushFeature2(extension, "hostImageCopy", extFeatures.hostImageCopy); + } if (extensionSupported("VK_EXT_shader_atomic_float2")) { const char* extension("VK_EXT_shader_atomic_float2"); VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT }; @@ -1891,6 +1954,13 @@ void VulkanDeviceInfoExtensions::readPhysicalFeatures_KHR() { vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); pushFeature2(extension, "maintenance4", extFeatures.maintenance4); } + if (extensionSupported("VK_KHR_maintenance5")) { + const char* extension("VK_KHR_maintenance5"); + VkPhysicalDeviceMaintenance5FeaturesKHR extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR }; + VkPhysicalDeviceFeatures2 deviceFeatures2(initDeviceFeatures2(&extFeatures)); + vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); + pushFeature2(extension, "maintenance5", extFeatures.maintenance5); + } if (extensionSupported("VK_KHR_ray_tracing_position_fetch")) { const char* extension("VK_KHR_ray_tracing_position_fetch"); VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR }; @@ -2069,6 +2139,15 @@ void VulkanDeviceInfoExtensions::readPhysicalFeatures_NV() { vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); pushFeature2(extension, "memoryDecompression", extFeatures.memoryDecompression); } + if (extensionSupported("VK_NV_device_generated_commands_compute")) { + const char* extension("VK_NV_device_generated_commands_compute"); + VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV }; + VkPhysicalDeviceFeatures2 deviceFeatures2(initDeviceFeatures2(&extFeatures)); + vulkanContext.vkGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2); + pushFeature2(extension, "deviceGeneratedCompute", extFeatures.deviceGeneratedCompute); + pushFeature2(extension, "deviceGeneratedComputePipelines", extFeatures.deviceGeneratedComputePipelines); + pushFeature2(extension, "deviceGeneratedComputeCaptureReplay", extFeatures.deviceGeneratedComputeCaptureReplay); + } if (extensionSupported("VK_NV_linear_color_attachment")) { const char* extension("VK_NV_linear_color_attachment"); VkPhysicalDeviceLinearColorAttachmentFeaturesNV extFeatures { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV }; @@ -2170,6 +2249,7 @@ void VulkanDeviceInfoExtensions::readPhysicalFeatures_VALVE() { void VulkanDeviceInfoExtensions::readExtendedFeatures() { readPhysicalFeatures_AMD(); + readPhysicalFeatures_AMDX(); readPhysicalFeatures_ARM(); readPhysicalFeatures_EXT(); readPhysicalFeatures_HUAWEI(); diff --git a/VulkanDeviceInfoExtensions.h b/VulkanDeviceInfoExtensions.h index eef685d..abd0e61 100644 --- a/VulkanDeviceInfoExtensions.h +++ b/VulkanDeviceInfoExtensions.h @@ -70,6 +70,8 @@ class VulkanDeviceInfoExtensions bool extensionSupported(const char* extensionName); void readPhysicalFeatures_AMD(); void readPhysicalProperties_AMD(); + void readPhysicalFeatures_AMDX(); + void readPhysicalProperties_AMDX(); void readPhysicalFeatures_ARM(); void readPhysicalProperties_ARM(); void readPhysicalFeatures_EXT(); @@ -89,7 +91,7 @@ class VulkanDeviceInfoExtensions void readPhysicalFeatures_VALVE(); public: - const uint32_t vkHeaderVersion = 257; + const uint32_t vkHeaderVersion = 261; std::vector features2; std::vector properties2; std::vector extensions; diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 9092664..3605b74 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp index 51e4a87..35f1f26 100644 --- a/vulkancapsviewer.cpp +++ b/vulkancapsviewer.cpp @@ -77,7 +77,7 @@ extern "C" const char *getWorkingFolderForiOS(void); using std::to_string; -const QString VulkanCapsViewer::version = "3.31"; +const QString VulkanCapsViewer::version = "3.32"; const QString VulkanCapsViewer::reportVersion = "3.2"; OSInfo getOperatingSystem() @@ -120,7 +120,6 @@ QString arrayToStr(QVariant value) { return "[" + imploded + "]"; } - #if defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_ANDROID_KHR) void setTouchProps(QWidget *widget) { QScroller *scroller = QScroller::scroller(widget); @@ -1162,6 +1161,51 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& parent->appendRow(item); } +void addExtensionPropertiesRow(QList item, Property2 property) +{ + QList propertyItem; + propertyItem << new QStandardItem(QString::fromStdString(property.name)); + + if (vulkanResources::uuidValueNames.contains(QString::fromStdString(property.name))) { + const QJsonArray values = property.value.toJsonArray(); + std::ostringstream ss; + ss << std::hex << std::noshowbase << std::uppercase << std::setfill('0'); + for (size_t i = 0; i < VK_UUID_SIZE; i++) { + if (i == 4 || i == 6 || i == 8 || i == 10) ss << '-'; + ss << std::setw(2) << static_cast(values[static_cast(i)].toInt()); + } + propertyItem << new QStandardItem(QString::fromStdString(ss.str())); + item.first()->appendRow(propertyItem); + return; + } + + if (property.value.canConvert(QVariant::List)) { + if ((strcmp(property.extension, VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME) == 0) && ((property.name == "pCopySrcLayouts") || (property.name == "pCopyDstLayouts"))) { + QList list = property.value.toList(); + for (auto i = 0; i < list.size(); i++) { + QStandardItem* formatItem = new QStandardItem(); + formatItem->setText(vulkanResources::imageLayoutString((VkImageLayout)list[i].toInt())); + propertyItem.first()->appendRow(formatItem); + } + } + propertyItem << new QStandardItem(arrayToStr(property.value)); + } + else { + switch (property.value.type()) { + case QVariant::Bool: { + bool boolVal = property.value.toBool(); + propertyItem << new QStandardItem(boolVal ? "true" : "false"); + propertyItem[1]->setForeground(boolVal ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0)); + break; + } + default: + propertyItem << new QStandardItem(property.value.toString()); + } + } + + item.first()->appendRow(propertyItem); +} + void VulkanCapsViewer::displayDevice(int index) { assert(index < vulkanGPUs.size()); @@ -1272,25 +1316,7 @@ void VulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device) extItem << new QStandardItem(QString::fromStdString(extension.extensionName)); extItem << new QStandardItem(); } - QList propertyItem; - propertyItem << new QStandardItem(QString::fromStdString(property.name)); - - if (property.value.canConvert(QVariant::List)) { - propertyItem << new QStandardItem(arrayToStr(property.value)); - } - else { - switch (property.value.type()) { - case QVariant::Bool: { - bool boolVal = property.value.toBool(); - propertyItem << new QStandardItem(boolVal ? "true" : "false"); - propertyItem[1]->setForeground(boolVal ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0)); - break; - } - default: - propertyItem << new QStandardItem(property.value.toString()); - } - } - extItem.first()->appendRow(propertyItem); + addExtensionPropertiesRow(extItem, property); } } if (hasProperties) { diff --git a/vulkanresources.h b/vulkanresources.h index 2ddfc45..cd820a9 100644 --- a/vulkanresources.h +++ b/vulkanresources.h @@ -4,7 +4,7 @@ * * Helpers converting Vulkan entities to strings * -* Copyright (C) 2015-2021 by Sascha Willems (www.saschawillems.de) +* Copyright (C) 2015-2023 by Sascha Willems (www.saschawillems.de) * * This code is free software, you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -401,6 +401,55 @@ namespace vulkanResources { } } + inline QString formatQString(const VkFormat format) + { + return QString::fromStdString(formatString(format)); + } + + inline QString imageLayoutString(const VkImageLayout imageLayout) + { + switch (imageLayout) + { +#define STR(r) case VK_IMAGE_LAYOUT_##r: return #r + STR(UNDEFINED); + STR(GENERAL); + STR(COLOR_ATTACHMENT_OPTIMAL); + STR(DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + STR(DEPTH_STENCIL_READ_ONLY_OPTIMAL); + STR(SHADER_READ_ONLY_OPTIMAL); + STR(TRANSFER_SRC_OPTIMAL); + STR(TRANSFER_DST_OPTIMAL); + STR(PREINITIALIZED); + STR(DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL); + STR(DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL); + STR(DEPTH_ATTACHMENT_OPTIMAL); + STR(DEPTH_READ_ONLY_OPTIMAL); + STR(STENCIL_ATTACHMENT_OPTIMAL); + STR(STENCIL_READ_ONLY_OPTIMAL); + STR(READ_ONLY_OPTIMAL); + STR(ATTACHMENT_OPTIMAL); + STR(PRESENT_SRC_KHR); + STR(VIDEO_DECODE_DST_KHR); + STR(VIDEO_DECODE_SRC_KHR); + STR(VIDEO_DECODE_DPB_KHR); + STR(SHARED_PRESENT_KHR); + STR(FRAGMENT_DENSITY_MAP_OPTIMAL_EXT); + STR(FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR); +#ifdef VK_ENABLE_BETA_EXTENSIONS + STR(VIDEO_ENCODE_DST_KHR); +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + STR(VIDEO_ENCODE_SRC_KHR); +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + STR(VIDEO_ENCODE_DPB_KHR); +#endif + STR(ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT); +#undef STR + default: return QString::fromStdString("UNKNOWN_ENUM (" + toHexString(imageLayout) + ")"); + } + } + inline std::string presentModeKHRString(const VkPresentModeKHR presentMode) { switch (presentMode) @@ -716,12 +765,16 @@ namespace vulkanResources { "deviceUUID", // Core 1.1 "driverUUID", + // Extensions + "shaderModuleIdentifierAlgorithmUUID", + "shaderBinaryUUID", + "optimalTilingLayoutUUID" }; //Values to be displayed as LUIDs const QSet luidValueNames = { - // Core 1.1 - "deviceLUID" + // Core 1.1 + "deviceLUID" }; // Values to be displayed as hex