From a2ce81eb996878cfe12aaccd5b8f5c1bf8633477 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Tue, 13 Oct 2020 20:45:45 +0200
Subject: [PATCH 01/38] Read and store Vulkan 1.1 and 1.2 core features and
properties structures
---
vulkanDeviceInfo.cpp | 214 ++++++++++++++++++++++++++++++++++++++++++-
vulkanDeviceInfo.h | 5 +
2 files changed, 214 insertions(+), 5 deletions(-)
diff --git a/vulkanDeviceInfo.cpp b/vulkanDeviceInfo.cpp
index 075f715..f5c910e 100644
--- a/vulkanDeviceInfo.cpp
+++ b/vulkanDeviceInfo.cpp
@@ -34,6 +34,13 @@ bool VulkanDeviceInfo::vulkan_1_1()
return ((major > 1) || ((major == 1) && (minor >= 1)));
}
+bool VulkanDeviceInfo::vulkan_1_2()
+{
+ uint32_t major = VK_VERSION_MAJOR(props.apiVersion);
+ uint32_t minor = VK_VERSION_MINOR(props.apiVersion);
+ return ((major > 1) || ((major == 1) && (minor >= 2)));
+}
+
void VulkanDeviceInfo::readExtensions()
{
assert(device != NULL);
@@ -188,6 +195,15 @@ std::string VulkanDeviceInfo::getDriverVersion()
}
}
+QJsonArray UUIDToJson(uint8_t* UUID)
+{
+ QJsonArray jsonArray;
+ for (uint32_t i = 0; i < VK_UUID_SIZE; i++) {
+ jsonArray.append(UUID[i]);
+ }
+ return jsonArray;
+}
+
void VulkanDeviceInfo::readPhysicalProperties()
{
assert(device != NULL);
@@ -221,9 +237,34 @@ void VulkanDeviceInfo::readPhysicalProperties()
// VK 1.1 core
if (vulkan_1_1()) {
VkPhysicalDeviceProperties2KHR deviceProps2{};
+ deviceProps2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
+
+ // Core
+ VkPhysicalDeviceVulkan11Properties coreProps{};
+ coreProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES;
+ deviceProps2.pNext = &coreProps;
+ pfnGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
+
+ core11Properties.clear();
+ core11Properties["deviceUUID"] = UUIDToJson(coreProps.deviceUUID);
+ core11Properties["driverUUID"] = UUIDToJson(coreProps.driverUUID);
+ core11Properties["deviceLUID"] = UUIDToJson(coreProps.deviceLUID);
+ core11Properties["deviceNodeMask"] = coreProps.deviceNodeMask;
+ core11Properties["deviceLUIDValid"] = coreProps.deviceLUIDValid;
+ core11Properties["subgroupSize"] = coreProps.subgroupSize;
+ core11Properties["subgroupSupportedStages"] = coreProps.subgroupSupportedStages;
+ core11Properties["subgroupSupportedOperations"] = coreProps.subgroupSupportedOperations;
+ core11Properties["subgroupQuadOperationsInAllStages"] = coreProps.subgroupQuadOperationsInAllStages;
+ core11Properties["pointClippingBehavior"] = coreProps.pointClippingBehavior;
+ core11Properties["maxMultiviewViewCount"] = coreProps.maxMultiviewViewCount;
+ core11Properties["maxMultiviewInstanceIndex"] = coreProps.maxMultiviewInstanceIndex;
+ core11Properties["protectedNoFault"] = coreProps.protectedNoFault;
+ core11Properties["maxPerSetDescriptors"] = coreProps.maxPerSetDescriptors;
+ core11Properties["maxMemoryAllocationSize"] = coreProps.maxMemoryAllocationSize;
+
+ // Subgroup props (@todo: Still required?)
VkPhysicalDeviceSubgroupProperties extProps{};
extProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
- deviceProps2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
deviceProps2.pNext = &extProps;
pfnGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
hasSubgroupProperties = true;
@@ -245,6 +286,73 @@ void VulkanDeviceInfo::readPhysicalProperties()
properties2.push_back(Property2("maxMemoryAllocationSize", QVariant::fromValue(extProps.maxMemoryAllocationSize), extName));
}
}
+
+ // VK 1.2 core
+ if (vulkan_1_2()) {
+ VkPhysicalDeviceProperties2KHR deviceProps2{};
+ deviceProps2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
+
+ // Core
+ VkPhysicalDeviceVulkan12Properties coreProps{};
+ coreProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES;
+ deviceProps2.pNext = &coreProps;
+ pfnGetPhysicalDeviceProperties2KHR(device, &deviceProps2);
+
+ core12Properties.clear();
+ core12Properties["driverID"] = coreProps.driverID;
+ core12Properties["driverName"] = QString(coreProps.driverName);
+ core12Properties["driverInfo"] = QString(coreProps.driverInfo);
+ core12Properties["conformanceVersion"] = QString::fromStdString(vulkanResources::conformanceVersionKHRString(coreProps.conformanceVersion));
+ core12Properties["denormBehaviorIndependence"] = coreProps.denormBehaviorIndependence;
+ core12Properties["roundingModeIndependence"] = coreProps.roundingModeIndependence;
+ core12Properties["shaderSignedZeroInfNanPreserveFloat16"] = coreProps.shaderSignedZeroInfNanPreserveFloat16;
+ core12Properties["shaderSignedZeroInfNanPreserveFloat32"] = coreProps.shaderSignedZeroInfNanPreserveFloat32;
+ core12Properties["shaderSignedZeroInfNanPreserveFloat64"] = coreProps.shaderSignedZeroInfNanPreserveFloat64;
+ core12Properties["shaderDenormPreserveFloat16"] = coreProps.shaderDenormPreserveFloat16;
+ core12Properties["shaderDenormPreserveFloat32"] = coreProps.shaderDenormPreserveFloat32;
+ core12Properties["shaderDenormPreserveFloat64"] = coreProps.shaderDenormPreserveFloat64;
+ core12Properties["shaderDenormFlushToZeroFloat16"] = coreProps.shaderDenormFlushToZeroFloat16;
+ core12Properties["shaderDenormFlushToZeroFloat32"] = coreProps.shaderDenormFlushToZeroFloat32;
+ core12Properties["shaderDenormFlushToZeroFloat64"] = coreProps.shaderDenormFlushToZeroFloat64;
+ core12Properties["shaderRoundingModeRTEFloat16"] = coreProps.shaderRoundingModeRTEFloat16;
+ core12Properties["shaderRoundingModeRTEFloat32"] = coreProps.shaderRoundingModeRTEFloat32;
+ core12Properties["shaderRoundingModeRTEFloat64"] = coreProps.shaderRoundingModeRTEFloat64;
+ core12Properties["shaderRoundingModeRTZFloat16"] = coreProps.shaderRoundingModeRTZFloat16;
+ core12Properties["shaderRoundingModeRTZFloat32"] = coreProps.shaderRoundingModeRTZFloat32;
+ core12Properties["shaderRoundingModeRTZFloat64"] = coreProps.shaderRoundingModeRTZFloat64;
+ core12Properties["maxUpdateAfterBindDescriptorsInAllPools"] = coreProps.maxUpdateAfterBindDescriptorsInAllPools;
+ core12Properties["shaderUniformBufferArrayNonUniformIndexingNative"] = coreProps.shaderUniformBufferArrayNonUniformIndexingNative;
+ core12Properties["shaderSampledImageArrayNonUniformIndexingNative"] = coreProps.shaderSampledImageArrayNonUniformIndexingNative;
+ core12Properties["shaderStorageBufferArrayNonUniformIndexingNative"] = coreProps.shaderStorageBufferArrayNonUniformIndexingNative;
+ core12Properties["shaderStorageImageArrayNonUniformIndexingNative"] = coreProps.shaderStorageImageArrayNonUniformIndexingNative;
+ core12Properties["shaderInputAttachmentArrayNonUniformIndexingNative"] = coreProps.shaderInputAttachmentArrayNonUniformIndexingNative;
+ core12Properties["robustBufferAccessUpdateAfterBind"] = coreProps.robustBufferAccessUpdateAfterBind;
+ core12Properties["quadDivergentImplicitLod"] = coreProps.quadDivergentImplicitLod;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindSamplers"] = coreProps.maxPerStageDescriptorUpdateAfterBindSamplers;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindUniformBuffers"] = coreProps.maxPerStageDescriptorUpdateAfterBindUniformBuffers;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindStorageBuffers"] = coreProps.maxPerStageDescriptorUpdateAfterBindStorageBuffers;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindSampledImages"] = coreProps.maxPerStageDescriptorUpdateAfterBindSampledImages;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindStorageImages"] = coreProps.maxPerStageDescriptorUpdateAfterBindStorageImages;
+ core12Properties["maxPerStageDescriptorUpdateAfterBindInputAttachments"] = coreProps.maxPerStageDescriptorUpdateAfterBindInputAttachments;
+ core12Properties["maxPerStageUpdateAfterBindResources"] = coreProps.maxPerStageUpdateAfterBindResources;
+ core12Properties["maxDescriptorSetUpdateAfterBindSamplers"] = coreProps.maxDescriptorSetUpdateAfterBindSamplers;
+ core12Properties["maxDescriptorSetUpdateAfterBindUniformBuffers"] = coreProps.maxDescriptorSetUpdateAfterBindUniformBuffers;
+ core12Properties["maxDescriptorSetUpdateAfterBindUniformBuffersDynamic"] = coreProps.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic;
+ core12Properties["maxDescriptorSetUpdateAfterBindStorageBuffers"] = coreProps.maxDescriptorSetUpdateAfterBindStorageBuffers;
+ core12Properties["maxDescriptorSetUpdateAfterBindStorageBuffersDynamic"] = coreProps.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic;
+ core12Properties["maxDescriptorSetUpdateAfterBindSampledImages"] = coreProps.maxDescriptorSetUpdateAfterBindSampledImages;
+ core12Properties["maxDescriptorSetUpdateAfterBindStorageImages"] = coreProps.maxDescriptorSetUpdateAfterBindStorageImages;
+ core12Properties["maxDescriptorSetUpdateAfterBindInputAttachments"] = coreProps.maxDescriptorSetUpdateAfterBindInputAttachments;
+ core12Properties["supportedDepthResolveModes"] = coreProps.supportedDepthResolveModes;
+ core12Properties["supportedStencilResolveModes"] = coreProps.supportedStencilResolveModes;
+ core12Properties["independentResolveNone"] = coreProps.independentResolveNone;
+ core12Properties["independentResolve"] = coreProps.independentResolve;
+ core12Properties["filterMinmaxSingleComponentFormats"] = coreProps.filterMinmaxSingleComponentFormats;
+ core12Properties["filterMinmaxImageComponentMapping"] = coreProps.filterMinmaxImageComponentMapping;
+ core12Properties["maxTimelineSemaphoreValueDifference"] = coreProps.maxTimelineSemaphoreValueDifference;
+ core12Properties["framebufferIntegerColorSampleCounts"] = coreProps.framebufferIntegerColorSampleCounts;
+
+ }
}
}
@@ -315,20 +423,102 @@ void VulkanDeviceInfo::readPhysicalFeatures()
readExtendedFeatures();
- // VK 1.1 Core
+ // Vulkan 1.1
if (vulkan_1_1()) {
+ VkPhysicalDeviceFeatures2KHR deviceFeatures2{};
+ deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
+
+ // Core
+ VkPhysicalDeviceVulkan11Features coreFeatures{};
+ coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
+ deviceFeatures2.pNext = &coreFeatures;
+ pfnGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2);
+
+ core11Features.clear();
+ core11Features["storageBuffer16BitAccess"] = coreFeatures.storageBuffer16BitAccess;
+ core11Features["uniformAndStorageBuffer16BitAcces"] = coreFeatures.uniformAndStorageBuffer16BitAccess;
+ core11Features["storagePushConstant16"] = coreFeatures.storagePushConstant16;
+ core11Features["storageInputOutput16"] = coreFeatures.storageInputOutput16;
+ core11Features["multiview"] = coreFeatures.multiview;
+ core11Features["multiviewGeometryShader"] = coreFeatures.multiviewGeometryShader;
+ core11Features["multiviewTessellationShader"] = coreFeatures.multiviewTessellationShader;
+ core11Features["variablePointersStorageBuffer"] = coreFeatures.variablePointersStorageBuffer;
+ core11Features["variablePointers"] = coreFeatures.variablePointers;
+ core11Features["protectedMemory"] = coreFeatures.protectedMemory;
+ core11Features["samplerYcbcrConversion"] = coreFeatures.samplerYcbcrConversion;
+ core11Features["shaderDrawParameters"] = coreFeatures.shaderDrawParameters;
+
// VK_KHR_shader_draw_parameters
if (extensionSupported(VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME)) {
- VkPhysicalDeviceFeatures2KHR deviceFeatures2{};
VkPhysicalDeviceShaderDrawParameterFeatures extFeatures{};
extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES;
- deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
deviceFeatures2.pNext = &extFeatures;
pfnGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2);
features2.push_back(Feature2("shaderDrawParameters", extFeatures.shaderDrawParameters, VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME));
}
}
+ // Vulkan 1.2
+ if (vulkan_1_2()) {
+ VkPhysicalDeviceFeatures2KHR deviceFeatures2{};
+ deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
+
+ // Core
+ VkPhysicalDeviceVulkan12Features coreFeatures{};
+ coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
+ deviceFeatures2.pNext = &coreFeatures;
+ pfnGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2);
+
+ core12Features.clear();
+ core12Features["samplerMirrorClampToEdge"] = coreFeatures.samplerMirrorClampToEdge;
+ core12Features["drawIndirectCount"] = coreFeatures.drawIndirectCount;
+ core12Features["storageBuffer8BitAccess"] = coreFeatures.storageBuffer8BitAccess;
+ core12Features["uniformAndStorageBuffer8BitAccess"] = coreFeatures.uniformAndStorageBuffer8BitAccess;
+ core12Features["storagePushConstant8"] = coreFeatures.storagePushConstant8;
+ core12Features["shaderBufferInt64Atomics"] = coreFeatures.shaderBufferInt64Atomics;
+ core12Features["shaderSharedInt64Atomics"] = coreFeatures.shaderSharedInt64Atomics;
+ core12Features["shaderFloat16"] = coreFeatures.shaderFloat16;
+ core12Features["shaderInt8"] = coreFeatures.shaderInt8;
+ core12Features["descriptorIndexing"] = coreFeatures.descriptorIndexing;
+ core12Features["shaderInputAttachmentArrayDynamicIndexing"] = coreFeatures.shaderInputAttachmentArrayDynamicIndexing;
+ core12Features["shaderUniformTexelBufferArrayDynamicIndexing"] = coreFeatures.shaderUniformTexelBufferArrayDynamicIndexing;
+ core12Features["shaderStorageTexelBufferArrayDynamicIndexing"] = coreFeatures.shaderStorageTexelBufferArrayDynamicIndexing;
+ core12Features["shaderUniformBufferArrayNonUniformIndexing"] = coreFeatures.shaderUniformBufferArrayNonUniformIndexing;
+ core12Features["shaderSampledImageArrayNonUniformIndexing"] = coreFeatures.shaderSampledImageArrayNonUniformIndexing;
+ core12Features["shaderStorageBufferArrayNonUniformIndexing"] = coreFeatures.shaderStorageBufferArrayNonUniformIndexing;
+ core12Features["shaderStorageImageArrayNonUniformIndexing"] = coreFeatures.shaderStorageImageArrayNonUniformIndexing;
+ core12Features["shaderInputAttachmentArrayNonUniformIndexing"] = coreFeatures.shaderInputAttachmentArrayNonUniformIndexing;
+ core12Features["shaderUniformTexelBufferArrayNonUniformIndexing"] = coreFeatures.shaderUniformTexelBufferArrayNonUniformIndexing;
+ core12Features["shaderStorageTexelBufferArrayNonUniformIndexing"] = coreFeatures.shaderStorageTexelBufferArrayNonUniformIndexing;
+ core12Features["descriptorBindingUniformBufferUpdateAfterBind"] = coreFeatures.descriptorBindingUniformBufferUpdateAfterBind;
+ core12Features["descriptorBindingSampledImageUpdateAfterBind"] = coreFeatures.descriptorBindingSampledImageUpdateAfterBind;
+ core12Features["descriptorBindingStorageImageUpdateAfterBind"] = coreFeatures.descriptorBindingStorageImageUpdateAfterBind;
+ core12Features["descriptorBindingStorageBufferUpdateAfterBind"] = coreFeatures.descriptorBindingStorageBufferUpdateAfterBind;
+ core12Features["descriptorBindingUniformTexelBufferUpdateAfterBind"] = coreFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind;
+ core12Features["descriptorBindingStorageTexelBufferUpdateAfterBind"] = coreFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind;
+ core12Features["descriptorBindingUpdateUnusedWhilePending"] = coreFeatures.descriptorBindingUpdateUnusedWhilePending;
+ core12Features["descriptorBindingPartiallyBound"] = coreFeatures.descriptorBindingPartiallyBound;
+ core12Features["descriptorBindingVariableDescriptorCount"] = coreFeatures.descriptorBindingVariableDescriptorCount;
+ core12Features["runtimeDescriptorArray"] = coreFeatures.runtimeDescriptorArray;
+ core12Features["samplerFilterMinmax"] = coreFeatures.samplerFilterMinmax;
+ core12Features["scalarBlockLayout"] = coreFeatures.scalarBlockLayout;
+ core12Features["imagelessFramebuffer"] = coreFeatures.imagelessFramebuffer;
+ core12Features["uniformBufferStandardLayout"] = coreFeatures.uniformBufferStandardLayout;
+ core12Features["shaderSubgroupExtendedTypes"] = coreFeatures.shaderSubgroupExtendedTypes;
+ core12Features["separateDepthStencilLayouts"] = coreFeatures.separateDepthStencilLayouts;
+ core12Features["hostQueryReset"] = coreFeatures.hostQueryReset;
+ core12Features["timelineSemaphore"] = coreFeatures.timelineSemaphore;
+ core12Features["bufferDeviceAddress"] = coreFeatures.bufferDeviceAddress;
+ core12Features["bufferDeviceAddressCaptureReplay"] = coreFeatures.bufferDeviceAddressCaptureReplay;
+ core12Features["bufferDeviceAddressMultiDevice"] = coreFeatures.bufferDeviceAddressMultiDevice;
+ core12Features["vulkanMemoryModel"] = coreFeatures.vulkanMemoryModel;
+ core12Features["vulkanMemoryModelDeviceScope"] = coreFeatures.vulkanMemoryModelDeviceScope;
+ core12Features["vulkanMemoryModelAvailabilityVisibilityChains"] = coreFeatures.vulkanMemoryModelAvailabilityVisibilityChains;
+ core12Features["shaderOutputViewportIndex"] = coreFeatures.shaderOutputViewportIndex;
+ core12Features["shaderOutputLayer"] = coreFeatures.shaderOutputLayer;
+ core12Features["subgroupBroadcastDynamicId"] = coreFeatures.subgroupBroadcastDynamicId;
+ }
+
}
}
@@ -493,6 +683,12 @@ QJsonObject VulkanDeviceInfo::toJson(std::string submitter, std::string comment)
jsonProperties["sparseProperties"] = QJsonObject::fromVariantMap(sparseProperties);
jsonProperties["subgroupProperties"] = QJsonObject::fromVariantMap(subgroupProperties);
jsonProperties["limits"] = QJsonObject::fromVariantMap(limits);
+ if (!core11Properties.empty()) {
+ jsonProperties["core11"] = QJsonObject::fromVariantMap(core11Properties);
+ }
+ if (!core12Properties.empty()) {
+ jsonProperties["core12"] = QJsonObject::fromVariantMap(core12Properties);
+ }
// Pipeline cache UUID
QJsonArray jsonPipelineCache;
for (uint32_t i = 0; i < VK_UUID_SIZE; i++) {
@@ -505,7 +701,15 @@ QJsonObject VulkanDeviceInfo::toJson(std::string submitter, std::string comment)
root["properties"] = jsonProperties;
// Device features
- root["features"] = QJsonObject::fromVariantMap(features);
+ QJsonObject jsonFeatures;
+ jsonFeatures = QJsonObject::fromVariantMap(features);
+ if (!core11Properties.empty()) {
+ jsonFeatures["core11"] = QJsonObject::fromVariantMap(core11Features);
+ }
+ if (!core12Properties.empty()) {
+ jsonFeatures["core12"] = QJsonObject::fromVariantMap(core12Features);
+ }
+ root["features"] = jsonFeatures;
// Extensions
QJsonArray jsonExtensions;
diff --git a/vulkanDeviceInfo.h b/vulkanDeviceInfo.h
index eb0ad3f..0ff1dfd 100644
--- a/vulkanDeviceInfo.h
+++ b/vulkanDeviceInfo.h
@@ -75,6 +75,7 @@ class VulkanDeviceInfo: public VulkanDeviceInfoExtensions
private:
std::vector layers;
bool vulkan_1_1();
+ bool vulkan_1_2();
bool extensionSupported(const char* extensionName);
#if defined(__ANDROID__)
std::string getSystemProperty(const char* propname);
@@ -90,8 +91,12 @@ class VulkanDeviceInfo: public VulkanDeviceInfoExtensions
VkPhysicalDeviceProperties props;
VkPhysicalDeviceMemoryProperties memoryProperties;
VkPhysicalDeviceFeatures deviceFeatures;
+ QVariantMap core11Features;
+ QVariantMap core12Features;
bool hasSubgroupProperties = false;
QVariantMap subgroupProperties;
+ QVariantMap core11Properties;
+ QVariantMap core12Properties;
std::vector queueFamilies;
std::vector formats;
VulkanSurfaceInfo surfaceInfo;
From 2dd98de386c07f877b07d9010f0ebda4dce97f47 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Wed, 14 Oct 2020 19:24:52 +0200
Subject: [PATCH 02/38] Value casts
---
vulkanDeviceInfo.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vulkanDeviceInfo.cpp b/vulkanDeviceInfo.cpp
index f5c910e..dde6741 100644
--- a/vulkanDeviceInfo.cpp
+++ b/vulkanDeviceInfo.cpp
@@ -260,7 +260,7 @@ void VulkanDeviceInfo::readPhysicalProperties()
core11Properties["maxMultiviewInstanceIndex"] = coreProps.maxMultiviewInstanceIndex;
core11Properties["protectedNoFault"] = coreProps.protectedNoFault;
core11Properties["maxPerSetDescriptors"] = coreProps.maxPerSetDescriptors;
- core11Properties["maxMemoryAllocationSize"] = coreProps.maxMemoryAllocationSize;
+ core11Properties["maxMemoryAllocationSize"] = QVariant::fromValue(coreProps.maxMemoryAllocationSize);
// Subgroup props (@todo: Still required?)
VkPhysicalDeviceSubgroupProperties extProps{};
@@ -349,7 +349,7 @@ void VulkanDeviceInfo::readPhysicalProperties()
core12Properties["independentResolve"] = coreProps.independentResolve;
core12Properties["filterMinmaxSingleComponentFormats"] = coreProps.filterMinmaxSingleComponentFormats;
core12Properties["filterMinmaxImageComponentMapping"] = coreProps.filterMinmaxImageComponentMapping;
- core12Properties["maxTimelineSemaphoreValueDifference"] = coreProps.maxTimelineSemaphoreValueDifference;
+ core12Properties["maxTimelineSemaphoreValueDifference"] = QVariant::fromValue(coreProps.maxTimelineSemaphoreValueDifference);
core12Properties["framebufferIntegerColorSampleCounts"] = coreProps.framebufferIntegerColorSampleCounts;
}
From 42bce8f57b74b7186e143661fd4d9c67473898a9 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 22 Oct 2020 19:58:26 +0200
Subject: [PATCH 03/38] Version bump
JSON export structure
---
vulkanDeviceInfo.cpp | 42 ++++++++++++++++++++++++++++--------------
vulkancapsviewer.cpp | 4 ++--
2 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/vulkanDeviceInfo.cpp b/vulkanDeviceInfo.cpp
index dde6741..99fb1f0 100644
--- a/vulkanDeviceInfo.cpp
+++ b/vulkanDeviceInfo.cpp
@@ -436,7 +436,7 @@ void VulkanDeviceInfo::readPhysicalFeatures()
core11Features.clear();
core11Features["storageBuffer16BitAccess"] = coreFeatures.storageBuffer16BitAccess;
- core11Features["uniformAndStorageBuffer16BitAcces"] = coreFeatures.uniformAndStorageBuffer16BitAccess;
+ core11Features["uniformAndStorageBuffer16BitAccess"] = coreFeatures.uniformAndStorageBuffer16BitAccess;
core11Features["storagePushConstant16"] = coreFeatures.storagePushConstant16;
core11Features["storageInputOutput16"] = coreFeatures.storageInputOutput16;
core11Features["multiview"] = coreFeatures.multiview;
@@ -683,12 +683,6 @@ QJsonObject VulkanDeviceInfo::toJson(std::string submitter, std::string comment)
jsonProperties["sparseProperties"] = QJsonObject::fromVariantMap(sparseProperties);
jsonProperties["subgroupProperties"] = QJsonObject::fromVariantMap(subgroupProperties);
jsonProperties["limits"] = QJsonObject::fromVariantMap(limits);
- if (!core11Properties.empty()) {
- jsonProperties["core11"] = QJsonObject::fromVariantMap(core11Properties);
- }
- if (!core12Properties.empty()) {
- jsonProperties["core12"] = QJsonObject::fromVariantMap(core12Properties);
- }
// Pipeline cache UUID
QJsonArray jsonPipelineCache;
for (uint32_t i = 0; i < VK_UUID_SIZE; i++) {
@@ -697,19 +691,39 @@ QJsonObject VulkanDeviceInfo::toJson(std::string submitter, std::string comment)
jsonPipelineCache.append(jsonVal);
}
jsonProperties["pipelineCacheUUID"] = jsonPipelineCache;
-
root["properties"] = jsonProperties;
+ if (!core12Properties.empty()) {
+ root["propertiesCore12"] = QJsonObject::fromVariantMap(core12Properties);
+ }
+
// Device features
QJsonObject jsonFeatures;
- jsonFeatures = QJsonObject::fromVariantMap(features);
- if (!core11Properties.empty()) {
- jsonFeatures["core11"] = QJsonObject::fromVariantMap(core11Features);
+ root["features"] = QJsonObject::fromVariantMap(features);
+
+ // Core 1.1
+ if ((!core11Properties.empty()) || (!core11Features.empty())) {
+ QJsonObject jsonCore11;
+ if (!core11Properties.empty()) {
+ jsonCore11["properties"] = QJsonObject::fromVariantMap(core11Properties);
+ }
+ if (!core11Features.empty()) {
+ jsonCore11["features"] = QJsonObject::fromVariantMap(core11Features);
+ }
+ root["core11"] = jsonCore11;
}
- if (!core12Properties.empty()) {
- jsonFeatures["core12"] = QJsonObject::fromVariantMap(core12Features);
+
+ // Core 1.2
+ if ((!core11Properties.empty()) || (!core11Features.empty())) {
+ QJsonObject jsonCore12;
+ if (!core12Properties.empty()) {
+ jsonCore12["properties"] = QJsonObject::fromVariantMap(core12Properties);
+ }
+ if (!core12Features.empty()) {
+ jsonCore12["features"] = QJsonObject::fromVariantMap(core12Features);
+ }
+ root["core12"] = jsonCore12;
}
- root["features"] = jsonFeatures;
// Extensions
QJsonArray jsonExtensions;
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 450be3c..2658ede 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -77,8 +77,8 @@ using std::to_string;
#define VK_API_VERSION VK_API_VERSION_1_1
-const std::string vulkanCapsViewer::version = "2.21";
-const std::string vulkanCapsViewer::reportVersion = "2.0";
+const std::string vulkanCapsViewer::version = "2.3";
+const std::string vulkanCapsViewer::reportVersion = "2.1";
///
/// Returns operating system name
From 9db051d780dc5f278c10f0bfaf25ebafa20608af Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Wed, 23 Dec 2020 20:54:56 +0100
Subject: [PATCH 04/38] Display Core 1.1 and Core 1.2 features
---
vulkancapsviewer.cpp | 57 +++++++++-
vulkancapsviewer.h | 6 +
vulkancapsviewer.ui | 261 ++++++++++++++++++++++++++++++++++---------
3 files changed, 266 insertions(+), 58 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 2658ede..42eb02c 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -192,10 +192,18 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
ui.treeViewDeviceLimits->setModel(&filterProxies.limits);
filterProxies.limits.setSourceModel(&models.limits);
connect(ui.filterLineEditLimits, SIGNAL(textChanged(QString)), this, SLOT(slotFilterLimits(QString)));
- // Features
+ // Core 1.0 features
ui.treeViewDeviceFeatures->setModel(&filterProxies.features);
filterProxies.features.setSourceModel(&models.features);
connect(ui.filterLineEditFeatures, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeatures(QString)));
+ // Core 1.1 features
+ ui.treeViewDeviceFeaturesCore11->setModel(&filterProxies.featuresCore11);
+ filterProxies.featuresCore11.setSourceModel(&models.featuresCore11);
+ connect(ui.filterLineEditFeaturesCore11, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeaturesCore11(QString)));
+ // Core 1.2 features
+ ui.treeViewDeviceFeaturesCore12->setModel(&filterProxies.featuresCore12);
+ filterProxies.featuresCore12.setSourceModel(&models.featuresCore12);
+ connect(ui.filterLineEditFeaturesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeaturesCore12(QString)));
// Extensions
ui.treeViewDeviceExtensions->setModel(&filterProxies.extensions);
filterProxies.extensions.setSourceModel(&models.extensions);
@@ -368,6 +376,18 @@ void vulkanCapsViewer::slotFilterFeatures(QString text)
filterProxies.features.setFilterRegExp(regExp);
}
+void vulkanCapsViewer::slotFilterFeaturesCore11(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.featuresCore11.setFilterRegExp(regExp);
+}
+
+void vulkanCapsViewer::slotFilterFeaturesCore12(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.featuresCore12.setFilterRegExp(regExp);
+}
+
void vulkanCapsViewer::slotFilterExtensions(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
@@ -1024,10 +1044,9 @@ void vulkanCapsViewer::displayDeviceLimits(VulkanDeviceInfo *device)
void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
{
+ // Core 1.0
models.features.clear();
QStandardItem *rootItem = models.features.invisibleRootItem();
-
- // Basic features
for(QVariantMap::const_iterator iter = device->features.begin(); iter != device->features.end(); ++iter) {
QList rowItems;
rowItems << new QStandardItem(iter.key());
@@ -1035,10 +1054,38 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
rootItem->appendRow(rowItems);
}
-
ui.treeViewDeviceFeatures->expandAll();
ui.treeViewDeviceFeatures->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
- ui.treeViewDeviceFeatures->header()->setStretchLastSection(false);
+
+ // Core 1.1
+ if (!(device->core11Features.empty())) {
+ models.featuresCore11.clear();
+ QStandardItem *rootItem = models.featuresCore11.invisibleRootItem();
+ for(QVariantMap::const_iterator iter = device->core11Features.begin(); iter != device->core11Features.end(); ++iter) {
+ QList rowItems;
+ rowItems << new QStandardItem(iter.key());
+ rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
+ rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
+ rootItem->appendRow(rowItems);
+ }
+ ui.treeViewDeviceFeaturesCore11->expandAll();
+ ui.treeViewDeviceFeaturesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
+
+ // Core 1.2
+ if (!(device->core12Features.empty())) {
+ models.featuresCore12.clear();
+ QStandardItem *rootItem = models.featuresCore12.invisibleRootItem();
+ for(QVariantMap::const_iterator iter = device->core12Features.begin(); iter != device->core12Features.end(); ++iter) {
+ QList rowItems;
+ rowItems << new QStandardItem(iter.key());
+ rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
+ rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
+ rootItem->appendRow(rowItems);
+ }
+ ui.treeViewDeviceFeaturesCore12->expandAll();
+ ui.treeViewDeviceFeaturesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
}
void vulkanCapsViewer::displayGlobalLayers(QTreeWidget *tree)
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index b4e3d3b..c6f05fd 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -58,12 +58,16 @@ class vulkanCapsViewer : public QMainWindow
struct {
TreeProxyFilter limits;
TreeProxyFilter features;
+ TreeProxyFilter featuresCore11;
+ TreeProxyFilter featuresCore12;
TreeProxyFilter formats;
TreeProxyFilter extensions;
} filterProxies;
struct {
QStandardItemModel limits;
QStandardItemModel features;
+ QStandardItemModel featuresCore11;
+ QStandardItemModel featuresCore12;
QStandardItemModel formats;
QStandardItemModel extensions;
} models;
@@ -97,6 +101,8 @@ private Q_SLOTS:
void slotSettings();
void slotFilterLimits(QString text);
void slotFilterFeatures(QString text);
+ void slotFilterFeaturesCore11(QString text);
+ void slotFilterFeaturesCore12(QString text);
void slotFilterExtensions(QString text);
void slotFilterFormats(QString text);
void slotComboTabChanged(int index);
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 4da6481..39bc3e0 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -82,6 +82,10 @@ QTreeView::item {
QTreeView {
font-size: 12px;
+}
+
+QTreeView {
+ alternate-background-color: #F6F6F6;
}
@@ -623,63 +627,214 @@ height: 24px;
-
+
Features
-
- -
-
-
-
- 0
-
-
- 2
-
-
- 0
-
-
- 2
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Filter :
-
-
-
-
-
-
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
-
-
- QTreeView::item { height: 1.25em; }
-
-
- QAbstractItemView::NoEditTriggers
-
-
- true
+
+
+ 0
-
- false
-
-
- 200
-
+
+
+ Core 1.0
+
+
+
-
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
+
+
+ Core 1.1
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
+
+
+ Core 1.2
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
@@ -1046,7 +1201,7 @@ height: 24px;
0
- 5
+ 0
0
From 55476f7b537bf7b4e73038a803c0481aa589396e Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 11:19:44 +0100
Subject: [PATCH 05/38] Display Core 1.1 and Core 1.2 properties
---
vulkancapsviewer.cpp | 71 +++++++++++++++++++++++++++++++++++++++++---
vulkancapsviewer.h | 37 ++++++++++++++++++++---
2 files changed, 100 insertions(+), 8 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 42eb02c..b7ef8f4 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -2,7 +2,7 @@
*
* Vulkan hardware capability viewer
*
-* Copyright (C) 2016 by Sascha Willems (www.saschawillems.de)
+* Copyright (C) 2016-2020 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
@@ -192,6 +192,18 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
ui.treeViewDeviceLimits->setModel(&filterProxies.limits);
filterProxies.limits.setSourceModel(&models.limits);
connect(ui.filterLineEditLimits, SIGNAL(textChanged(QString)), this, SLOT(slotFilterLimits(QString)));
+ // Core 1.0 properties
+ ui.treeViewDeviceProperties->setModel(&filterProxies.propertiesCore10);
+ filterProxies.features.setSourceModel(&models.propertiesCore10);
+ connect(ui.filterLineEditProperties, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties10(QString)));
+ // Core 1.1 properties
+ ui.treeViewDevicePropertiesCore11->setModel(&filterProxies.propertiesCore11);
+ filterProxies.propertiesCore11.setSourceModel(&models.propertiesCore11);
+ connect(ui.filterLineEditPropertiesCore11, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties11(QString)));
+ // Core 1.2 properties
+ ui.treeViewDevicePropertiesCore12->setModel(&filterProxies.propertiesCore12);
+ filterProxies.propertiesCore12.setSourceModel(&models.propertiesCore12);
+ connect(ui.filterLineEditPropertiesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties11(QString)));
// Core 1.0 features
ui.treeViewDeviceFeatures->setModel(&filterProxies.features);
filterProxies.features.setSourceModel(&models.features);
@@ -370,6 +382,24 @@ void vulkanCapsViewer::slotFilterLimits(QString text)
filterProxies.limits.setFilterRegExp(regExp);
}
+void vulkanCapsViewer::slotFilterPropertiesCore10(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.propertiesCore10.setFilterRegExp(regExp);
+}
+
+void vulkanCapsViewer::slotFilterPropertiesCore11(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.propertiesCore11.setFilterRegExp(regExp);
+}
+
+void vulkanCapsViewer::slotFilterPropertiesCore12(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.propertiesCore12.setFilterRegExp(regExp);
+}
+
void vulkanCapsViewer::slotFilterFeatures(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
@@ -966,6 +996,36 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
for (int i = 0; i < treeWidget->columnCount(); i++)
treeWidget->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
+
+ // Core 1.1
+ if (!(device->core11Properties.empty())) {
+ models.propertiesCore11.clear();
+ QStandardItem* rootItem = models.propertiesCore11.invisibleRootItem();
+ for (QVariantMap::const_iterator iter = device->core11Properties.begin(); iter != device->core11Properties.end(); ++iter) {
+ QList rowItems;
+ // @todo: Special treatment for values like UUIDs
+ rowItems << new QStandardItem(iter.key());
+ rowItems << new QStandardItem(iter.value().toString());
+ rootItem->appendRow(rowItems);
+ }
+ ui.treeViewDevicePropertiesCore11->expandAll();
+ ui.treeViewDevicePropertiesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
+
+ // Core 1.2
+ if (!(device->core12Properties.empty())) {
+ models.propertiesCore12.clear();
+ QStandardItem* rootItem = models.propertiesCore12.invisibleRootItem();
+ for (QVariantMap::const_iterator iter = device->core12Properties.begin(); iter != device->core12Properties.end(); ++iter) {
+ QList rowItems;
+ // @todo: Special treatment for values like UUIDs
+ rowItems << new QStandardItem(iter.key());
+ rowItems << new QStandardItem(iter.value().toString());
+ rootItem->appendRow(rowItems);
+ }
+ ui.treeViewDevicePropertiesCore12->expandAll();
+ ui.treeViewDevicePropertiesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
}
void vulkanCapsViewer::displayDeviceMemoryProperites(VulkanDeviceInfo *device)
@@ -1114,7 +1174,8 @@ void vulkanCapsViewer::displayDeviceLayers(VulkanDeviceInfo *device)
QTreeWidget *treeWidget = ui.treeWidgetDeviceLayers;
treeWidget->clear();
- ui.tabWidgetDevice->setTabText(5, "Layers (" + QString::number(device->getLayers().size()) + ")");
+ // @todo: adjust to new structure
+// ui.tabWidgetDevice->setTabText(5, "Layers (" + QString::number(device->getLayers().size()) + ")");
for (auto& layer : device->getLayers())
{
QTreeWidgetItem *treeItem = new QTreeWidgetItem(treeWidget);
@@ -1268,7 +1329,8 @@ QString arrayToStr(QVariant value) {
*/
void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
{
- ui.tabWidgetDevice->setTabText(3, "Extensions (" + QString::number(device->extensions.size()) + ")");
+ // @todo: adjust to new structure
+ //ui.tabWidgetDevice->setTabText(3, "Extensions (" + QString::number(device->extensions.size()) + ")");
models.extensions.clear();
QStandardItem *rootItem = models.extensions.invisibleRootItem();
@@ -1338,7 +1400,8 @@ void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
void vulkanCapsViewer::displayDeviceQueues(VulkanDeviceInfo *device)
{
- ui.tabWidgetDevice->setTabText(6, "Queues Families (" + QString::number(device->queueFamilies.size()) + ")");
+ // @todo: adjust to new structure
+ //ui.tabWidgetDevice->setTabText(6, "Queues Families (" + QString::number(device->queueFamilies.size()) + ")");
QTreeWidget* treeWidget = ui.treeWidgetQueues;
treeWidget->clear();
for (auto& queueFamily : device->queueFamilies)
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index c6f05fd..04ccd0f 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -1,3 +1,23 @@
+/*
+*
+* Vulkan hardware capability viewer
+*
+* Copyright (C) 2016-2020 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
+* License version 3 as published by the Free Software Foundation.
+*
+* Please review the following information to ensure the GNU Lesser
+* General Public License version 3 requirements will be met:
+* http://opensource.org/licenses/lgpl-3.0.html
+*
+* The code is distributed WITHOUT ANY WARRANTY; without even the
+* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+* PURPOSE. See the GNU LGPL 3.0 for more details.
+*
+*/
+
#ifndef VULKANCAPSVIEWER_H
#define VULKANCAPSVIEWER_H
@@ -56,8 +76,11 @@ class vulkanCapsViewer : public QMainWindow
Ui::vulkanCapsViewerClass ui;
settings appSettings;
struct {
- TreeProxyFilter limits;
- TreeProxyFilter features;
+ TreeProxyFilter limits;
+ TreeProxyFilter propertiesCore10;
+ TreeProxyFilter propertiesCore11;
+ TreeProxyFilter propertiesCore12;
+ TreeProxyFilter features;
TreeProxyFilter featuresCore11;
TreeProxyFilter featuresCore12;
TreeProxyFilter formats;
@@ -65,7 +88,10 @@ class vulkanCapsViewer : public QMainWindow
} filterProxies;
struct {
QStandardItemModel limits;
- QStandardItemModel features;
+ QStandardItemModel propertiesCore10;
+ QStandardItemModel propertiesCore11;
+ QStandardItemModel propertiesCore12;
+ QStandardItemModel features;
QStandardItemModel featuresCore11;
QStandardItemModel featuresCore12;
QStandardItemModel formats;
@@ -100,7 +126,10 @@ private Q_SLOTS:
void slotUploadReport();
void slotSettings();
void slotFilterLimits(QString text);
- void slotFilterFeatures(QString text);
+ void slotFilterPropertiesCore10(QString text);
+ void slotFilterPropertiesCore11(QString text);
+ void slotFilterPropertiesCore12(QString text);
+ void slotFilterFeatures(QString text);
void slotFilterFeaturesCore11(QString text);
void slotFilterFeaturesCore12(QString text);
void slotFilterExtensions(QString text);
From 61f3d0e2562179f3ef25f31ca3141ac6bc0e6032 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 11:31:46 +0100
Subject: [PATCH 06/38] Display Core 1.1 and Core 1.2 properties
---
vulkancapsviewer.cpp | 6 +-
vulkancapsviewer.ui | 214 ++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 216 insertions(+), 4 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index b7ef8f4..8af5495 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -195,15 +195,15 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
// Core 1.0 properties
ui.treeViewDeviceProperties->setModel(&filterProxies.propertiesCore10);
filterProxies.features.setSourceModel(&models.propertiesCore10);
- connect(ui.filterLineEditProperties, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties10(QString)));
+ connect(ui.filterLineEditProperties, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore10(QString)));
// Core 1.1 properties
ui.treeViewDevicePropertiesCore11->setModel(&filterProxies.propertiesCore11);
filterProxies.propertiesCore11.setSourceModel(&models.propertiesCore11);
- connect(ui.filterLineEditPropertiesCore11, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties11(QString)));
+ connect(ui.filterLineEditPropertiesCore11, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore11(QString)));
// Core 1.2 properties
ui.treeViewDevicePropertiesCore12->setModel(&filterProxies.propertiesCore12);
filterProxies.propertiesCore12.setSourceModel(&models.propertiesCore12);
- connect(ui.filterLineEditPropertiesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterProperties11(QString)));
+ connect(ui.filterLineEditPropertiesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore12(QString)));
// Core 1.0 features
ui.treeViewDeviceFeatures->setModel(&filterProxies.features);
filterProxies.features.setSourceModel(&models.features);
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 39bc3e0..724aa47 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -580,7 +580,7 @@ height: 24px;
QTabWidget::Rounded
- 0
+ 1
false
@@ -627,6 +627,218 @@ height: 24px;
+
+
+ Properties
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ 0
+
+
+
+ Core 1.0
+
+
+
-
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
+
+
+ Core 1.1
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
+
+
+ Core 1.2
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
+
+
+
+
Features
From ab80b9f30c3e4bd5905b0ff9dc5c1d8d1874131a Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:12:28 +0100
Subject: [PATCH 07/38] Refactoring
---
vulkancapsviewer.cpp | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 8af5495..380b10d 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -883,6 +883,15 @@ QTreeWidgetItem *addTreeItemFlags(QTreeWidgetItem *parent, const std::string& fl
return flagsItem;
}
+void addVkBool32Item(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ QList item;
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(iterator.value().toBool() ? "true" : "false");
+ item[1]->setForeground(iterator.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
+ parent->appendRow(item);
+}
+
///
/// Display information on given device
///
@@ -1108,11 +1117,7 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
models.features.clear();
QStandardItem *rootItem = models.features.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->features.begin(); iter != device->features.end(); ++iter) {
- QList rowItems;
- rowItems << new QStandardItem(iter.key());
- rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
- rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
- rootItem->appendRow(rowItems);
+ addVkBool32Item(rootItem, iter);
}
ui.treeViewDeviceFeatures->expandAll();
ui.treeViewDeviceFeatures->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -1122,11 +1127,7 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
models.featuresCore11.clear();
QStandardItem *rootItem = models.featuresCore11.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core11Features.begin(); iter != device->core11Features.end(); ++iter) {
- QList rowItems;
- rowItems << new QStandardItem(iter.key());
- rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
- rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
- rootItem->appendRow(rowItems);
+ addVkBool32Item(rootItem, iter);
}
ui.treeViewDeviceFeaturesCore11->expandAll();
ui.treeViewDeviceFeaturesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -1137,11 +1138,7 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
models.featuresCore12.clear();
QStandardItem *rootItem = models.featuresCore12.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core12Features.begin(); iter != device->core12Features.end(); ++iter) {
- QList rowItems;
- rowItems << new QStandardItem(iter.key());
- rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
- rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
- rootItem->appendRow(rowItems);
+ addVkBool32Item(rootItem, iter);
}
ui.treeViewDeviceFeaturesCore12->expandAll();
ui.treeViewDeviceFeaturesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
From de6684851c972adcc3a8da0960737ba5843d0899 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:23:21 +0100
Subject: [PATCH 08/38] Added visualization mapping tables
---
vulkanresources.h | 58 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 56 insertions(+), 2 deletions(-)
diff --git a/vulkanresources.h b/vulkanresources.h
index 7c0e89b..a73b44f 100644
--- a/vulkanresources.h
+++ b/vulkanresources.h
@@ -4,7 +4,7 @@
*
* Helpers converting Vulkan entities to strings
*
-* Copyright (C) 2015 by Sascha Willems (www.saschawillems.de)
+* Copyright (C) 2015-2020 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
@@ -31,9 +31,9 @@
#include
#include
+#include
#include "vulkan/vulkan.h"
-
namespace vulkanResources {
template
inline std::string toHexString(const Number number)
@@ -615,4 +615,58 @@ namespace vulkanResources {
return joinString('.', versionAsStringList);
}
+
+ // Values that are treated as sample counts
+ const QSet sampleFlagsValueNames = {
+ "framebufferColorSampleCounts",
+ "framebufferDepthSampleCounts",
+ "framebufferStencilSampleCounts",
+ "framebufferNoAttachmentsSampleCounts",
+ "sampledImageColorSampleCounts",
+ "sampledImageIntegerSampleCounts",
+ "sampledImageDepthSampleCounts",
+ "sampledImageStencilSampleCounts",
+ "storageImageSampleCounts",
+ // Core 1.2
+ "framebufferIntegerColorSampleCounts"
+ };
+
+ // Values that are treated as booleans
+ const QSet boolValueNames = {
+ "timestampComputeAndGraphics",
+ "strictLines",
+ "standardSampleLocations",
+ // Core 1.1
+ "deviceLUIDValid",
+ "subgroupQuadOperationsInAllStages",
+ "protectedNoFault",
+ // Core 1.2
+ "shaderSignedZeroInfNanPreserveFloat16",
+ "shaderSignedZeroInfNanPreserveFloat32",
+ "shaderSignedZeroInfNanPreserveFloat64",
+ "shaderDenormPreserveFloat16",
+ "shaderDenormPreserveFloat32",
+ "shaderDenormPreserveFloat64",
+ "shaderDenormFlushToZeroFloat16",
+ "shaderDenormFlushToZeroFloat32",
+ "shaderDenormFlushToZeroFloat64",
+ "shaderRoundingModeRTEFloat16",
+ "shaderRoundingModeRTEFloat32",
+ "shaderRoundingModeRTEFloat64",
+ "shaderRoundingModeRTZFloat16",
+ "shaderRoundingModeRTZFloat32",
+ "shaderRoundingModeRTZFloat64",
+ "shaderUniformBufferArrayNonUniformIndexingNative",
+ "shaderSampledImageArrayNonUniformIndexingNative",
+ "shaderStorageBufferArrayNonUniformIndexingNative",
+ "shaderStorageImageArrayNonUniformIndexingNative",
+ "shaderInputAttachmentArrayNonUniformIndexingNative",
+ "robustBufferAccessUpdateAfterBind",
+ "quadDivergentImplicitLod",
+ "independentResolveNone",
+ "independentResolve",
+ "filterMinmaxSingleComponentFormats",
+ "filterMinmaxImageComponentMapping"
+ };
+
};
From a09682bc7b9f377c13d1678cf4f9015fb06b5010 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:23:52 +0100
Subject: [PATCH 09/38] Property visualization
---
vulkancapsviewer.cpp | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 380b10d..17a15bb 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -892,6 +892,19 @@ void addVkBool32Item(QStandardItem* parent, const QVariantMap::const_iterator& i
parent->appendRow(item);
}
+void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ if (vulkanResources::boolValueNames.contains(iterator.key())) {
+ addVkBool32Item(parent, iterator);
+ return;
+ };
+ QList item;
+ // @todo: Special treatment for values like UUIDs
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(iterator.value().toString());
+ parent->appendRow(item);
+}
+
///
/// Display information on given device
///
@@ -1011,11 +1024,7 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
models.propertiesCore11.clear();
QStandardItem* rootItem = models.propertiesCore11.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core11Properties.begin(); iter != device->core11Properties.end(); ++iter) {
- QList rowItems;
- // @todo: Special treatment for values like UUIDs
- rowItems << new QStandardItem(iter.key());
- rowItems << new QStandardItem(iter.value().toString());
- rootItem->appendRow(rowItems);
+ addPropertiesRow(rootItem, iter);
}
ui.treeViewDevicePropertiesCore11->expandAll();
ui.treeViewDevicePropertiesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -1026,11 +1035,7 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
models.propertiesCore12.clear();
QStandardItem* rootItem = models.propertiesCore12.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core12Properties.begin(); iter != device->core12Properties.end(); ++iter) {
- QList rowItems;
- // @todo: Special treatment for values like UUIDs
- rowItems << new QStandardItem(iter.key());
- rowItems << new QStandardItem(iter.value().toString());
- rootItem->appendRow(rowItems);
+ addPropertiesRow(rootItem, iter);
}
ui.treeViewDevicePropertiesCore12->expandAll();
ui.treeViewDevicePropertiesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
From 3786e3e58082a5a53f3e19aa284c63d1f12829e8 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:24:03 +0100
Subject: [PATCH 10/38] Fixed filter
---
vulkancapsviewer.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 17a15bb..fcccf0f 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -194,7 +194,7 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
connect(ui.filterLineEditLimits, SIGNAL(textChanged(QString)), this, SLOT(slotFilterLimits(QString)));
// Core 1.0 properties
ui.treeViewDeviceProperties->setModel(&filterProxies.propertiesCore10);
- filterProxies.features.setSourceModel(&models.propertiesCore10);
+ filterProxies.propertiesCore10.setSourceModel(&models.propertiesCore10);
connect(ui.filterLineEditProperties, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore10(QString)));
// Core 1.1 properties
ui.treeViewDevicePropertiesCore11->setModel(&filterProxies.propertiesCore11);
From 916d0a8371cc77b4b6b97600d4a185355403b2be Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:27:25 +0100
Subject: [PATCH 11/38] Property visualization
Sample count flags
---
vulkancapsviewer.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index fcccf0f..60edc95 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -892,12 +892,26 @@ void addVkBool32Item(QStandardItem* parent, const QVariantMap::const_iterator& i
parent->appendRow(item);
}
+void addVkSampleCountFlagsItem(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ const auto samples = static_cast(iterator.value().toUInt());
+ QList item;
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(vulkanResources::toQStringList(samples));
+ parent->appendRow(item);
+}
+
void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
if (vulkanResources::boolValueNames.contains(iterator.key())) {
addVkBool32Item(parent, iterator);
return;
};
+ if (vulkanResources::sampleFlagsValueNames.contains(iterator.key())) {
+ addVkSampleCountFlagsItem(parent, iterator);
+ return;
+ }
+
QList item;
// @todo: Special treatment for values like UUIDs
item << new QStandardItem(iterator.key());
From 4c735a6813f24b5949bc0a982a0b857cfa085810 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 12:51:28 +0100
Subject: [PATCH 12/38] Property visualization
UUIDs
---
vulkancapsviewer.cpp | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 60edc95..f56fbd8 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -901,6 +901,21 @@ void addVkSampleCountFlagsItem(QStandardItem* parent, const QVariantMap::const_i
parent->appendRow(item);
}
+void addUUIDItem(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ const QJsonArray values = iterator.value().toJsonArray();
+ std::ostringstream uuidSs;
+ uuidSs << std::hex << std::noshowbase << std::uppercase;
+ for (uint32_t i = 0; i < values.size(); i++) {
+ uuidSs << std::right << std::setw(2) << std::setfill('0') << static_cast(values[i].toInt());
+ if (i == 3 || i == 5 || i == 7 || i == 9) uuidSs << '-';
+ }
+ QList item;
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(QString::fromStdString(uuidSs.str()));
+ parent->appendRow(item);
+}
+
void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
if (vulkanResources::boolValueNames.contains(iterator.key())) {
@@ -911,6 +926,10 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator&
addVkSampleCountFlagsItem(parent, iterator);
return;
}
+ if (vulkanResources::uuidValueNames.contains(iterator.key())) {
+ addUUIDItem(parent, iterator);
+ return;
+ }
QList item;
// @todo: Special treatment for values like UUIDs
From 0582ef3e1cd3b5193a59beb56e2d337ff3c67771 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 13:30:51 +0100
Subject: [PATCH 13/38] Property visualization
hex, lists
---
vulkancapsviewer.cpp | 32 ++++++++++++++++++++++++++++++++
vulkanresources.h | 19 +++++++++++++++++--
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index f56fbd8..9f7a9b3 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -916,6 +916,30 @@ void addUUIDItem(QStandardItem* parent, const QVariantMap::const_iterator& itera
parent->appendRow(item);
}
+void addHexItem(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ QList item;
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(vulkanResources::toHexQString(iterator.value().toULongLong()));
+ parent->appendRow(item);
+}
+
+void addVariantListItem(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
+{
+ QList list = iterator.value().toList();
+ QString listStr = "[";
+ for (int i = 0; i < list.size(); i++) {
+ listStr += list[i].toString();
+ if (i < list.size() - 1)
+ listStr += ", ";
+ }
+ listStr += "]";
+ QList item;
+ item << new QStandardItem(iterator.key());
+ item << new QStandardItem(listStr);
+ parent->appendRow(item);
+}
+
void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
if (vulkanResources::boolValueNames.contains(iterator.key())) {
@@ -930,6 +954,14 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator&
addUUIDItem(parent, iterator);
return;
}
+ if (vulkanResources::hexValueNames.contains(iterator.key())) {
+ addHexItem(parent, iterator);
+ return;
+ }
+ if (iterator.value().canConvert(QVariant::List)) {
+ addVariantListItem(parent, iterator);
+ return;
+ }
QList item;
// @todo: Special treatment for values like UUIDs
diff --git a/vulkanresources.h b/vulkanresources.h
index a73b44f..633384e 100644
--- a/vulkanresources.h
+++ b/vulkanresources.h
@@ -616,7 +616,7 @@ namespace vulkanResources {
return joinString('.', versionAsStringList);
}
- // Values that are treated as sample counts
+ // Values to be displayed as sample counts
const QSet sampleFlagsValueNames = {
"framebufferColorSampleCounts",
"framebufferDepthSampleCounts",
@@ -631,7 +631,7 @@ namespace vulkanResources {
"framebufferIntegerColorSampleCounts"
};
- // Values that are treated as booleans
+ // Values to be displayed as booleans
const QSet boolValueNames = {
"timestampComputeAndGraphics",
"strictLines",
@@ -669,4 +669,19 @@ namespace vulkanResources {
"filterMinmaxImageComponentMapping"
};
+ // Values to be displayed as UUIds
+ const QSet uuidValueNames = {
+ "deviceUUID",
+ // Core 1.1
+ "driverUUID",
+ "deviceLUID"
+ };
+
+ // Values to be displayed as hex
+ const QSet hexValueNames = {
+ "vendorID",
+ "deviceID"
+ };
+
+
};
From 267569e1aa81b1eca4b5a7b716dc159501fa6dc9 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 13:40:11 +0100
Subject: [PATCH 14/38] Skip and replace certain keys
---
vulkancapsviewer.cpp | 21 ++++++++----
vulkanresources.h | 78 ++++++++++++++++++++++++++------------------
2 files changed, 61 insertions(+), 38 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 9f7a9b3..3d1191e 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -942,19 +942,25 @@ void addVariantListItem(QStandardItem* parent, const QVariantMap::const_iterator
void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
- if (vulkanResources::boolValueNames.contains(iterator.key())) {
+ QString key = iterator.key();
+
+ if (vulkanResources::skipValueNames.contains(key)) {
+ return;
+ }
+
+ if (vulkanResources::boolValueNames.contains(key)) {
addVkBool32Item(parent, iterator);
return;
};
- if (vulkanResources::sampleFlagsValueNames.contains(iterator.key())) {
+ if (vulkanResources::sampleFlagsValueNames.contains(key)) {
addVkSampleCountFlagsItem(parent, iterator);
return;
}
- if (vulkanResources::uuidValueNames.contains(iterator.key())) {
+ if (vulkanResources::uuidValueNames.contains(key)) {
addUUIDItem(parent, iterator);
return;
}
- if (vulkanResources::hexValueNames.contains(iterator.key())) {
+ if (vulkanResources::hexValueNames.contains(key)) {
addHexItem(parent, iterator);
return;
}
@@ -963,9 +969,12 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator&
return;
}
+ if (vulkanResources::replaceKeyNames.contains(key)) {
+ key = vulkanResources::replaceKeyNames[key];
+ }
+
QList item;
- // @todo: Special treatment for values like UUIDs
- item << new QStandardItem(iterator.key());
+ item << new QStandardItem(key);
item << new QStandardItem(iterator.value().toString());
parent->appendRow(item);
}
diff --git a/vulkanresources.h b/vulkanresources.h
index 633384e..6aa982c 100644
--- a/vulkanresources.h
+++ b/vulkanresources.h
@@ -118,7 +118,7 @@ namespace vulkanResources {
STR(VIRTUAL_GPU);
STR(CPU);
#undef STR
- default: return "UNKNOWN_DEVICE_TYPE (" + toHexString(type) + ")";
+ default: return "UNKNOWN_DEVICE_TYPE (" + toHexString(type) + ")";
}
}
@@ -160,7 +160,7 @@ namespace vulkanResources {
STR(ERROR_INVALID_DEVICE_ADDRESS_EXT);
STR(ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT);
#undef STR
- default: return "UNKNOWN_RESULT (" + toHexString(result) + ")";
+ default: return "UNKNOWN_RESULT (" + toHexString(result) + ")";
}
}
@@ -389,7 +389,7 @@ namespace vulkanResources {
STR(G16_B16R16_2PLANE_422_UNORM);
STR(G16_B16_R16_3PLANE_444_UNORM);
#undef STR
- default: return "UNKNOWN_ENUM (" + toHexString(format) + ")";
+ default: return "UNKNOWN_ENUM (" + toHexString(format) + ")";
}
}
@@ -405,7 +405,7 @@ namespace vulkanResources {
STR(SHARED_DEMAND_REFRESH);
STR(SHARED_CONTINUOUS_REFRESH);
#undef STR
- default: return "UNKNOWN_ENUM (" + toHexString(presentMode) + ")";
+ default: return "UNKNOWN_ENUM (" + toHexString(presentMode) + ")";
}
}
@@ -431,13 +431,13 @@ namespace vulkanResources {
STR(EXTENDED_SRGB_NONLINEAR_EXT);
STR(DISPLAY_NATIVE_AMD);
#undef STR
- default: return "UNKNOWN_ENUM (" + toHexString(colorSpace) + ")";
+ default: return "UNKNOWN_ENUM (" + toHexString(colorSpace) + ")";
}
}
inline std::string driverIdKHRString(const VkDriverIdKHR driverId)
{
- switch(driverId){
+ switch (driverId) {
#define STR(r) case VK_DRIVER_ID_##r##_KHR: return #r
STR(AMD_PROPRIETARY);
STR(AMD_OPEN_SOURCE);
@@ -452,13 +452,13 @@ namespace vulkanResources {
STR(GGP_PROPRIETARY);
STR(BROADCOM_PROPRIETARY);
#undef STR
- default: return "UNKNOWN_ENUM (" + toHexString(driverId) + ")";
+ default: return "UNKNOWN_ENUM (" + toHexString(driverId) + ")";
};
}
inline std::string imageUsageBitString(const VkImageUsageFlagBits usageBit)
{
- switch(usageBit){
+ switch (usageBit) {
#define STR(r) case VK_IMAGE_USAGE_##r: return #r
STR(TRANSFER_SRC_BIT);
STR(TRANSFER_DST_BIT);
@@ -471,13 +471,13 @@ namespace vulkanResources {
STR(SHADING_RATE_IMAGE_BIT_NV);
STR(FRAGMENT_DENSITY_MAP_BIT_EXT);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(usageBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(usageBit) + ")";
};
}
inline std::string surfaceTransformBitString(const VkSurfaceTransformFlagBitsKHR transformBit)
{
- switch(transformBit){
+ switch (transformBit) {
#define STR(r) case VK_SURFACE_TRANSFORM_##r##_KHR: return #r
STR(IDENTITY_BIT);
STR(ROTATE_90_BIT);
@@ -489,26 +489,26 @@ namespace vulkanResources {
STR(HORIZONTAL_MIRROR_ROTATE_270_BIT);
STR(INHERIT_BIT);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(transformBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(transformBit) + ")";
};
}
inline std::string compositeAlphaBitString(const VkCompositeAlphaFlagBitsKHR alphaBit)
{
- switch(alphaBit){
+ switch (alphaBit) {
#define STR(r) case VK_COMPOSITE_ALPHA_##r##_KHR: return #r
STR(OPAQUE_BIT);
STR(PRE_MULTIPLIED_BIT);
STR(POST_MULTIPLIED_BIT);
STR(INHERIT_BIT);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(alphaBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(alphaBit) + ")";
};
}
inline std::string memoryPropBitString(const VkMemoryPropertyFlagBits memoryPropBit)
{
- switch(memoryPropBit){
+ switch (memoryPropBit) {
#define STR(r) case VK_MEMORY_PROPERTY_##r: return #r
STR(DEVICE_LOCAL_BIT);
STR(HOST_VISIBLE_BIT);
@@ -519,24 +519,24 @@ namespace vulkanResources {
STR(DEVICE_COHERENT_BIT_AMD);
STR(DEVICE_UNCACHED_BIT_AMD);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(memoryPropBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(memoryPropBit) + ")";
};
}
inline std::string memoryHeapBitString(const VkMemoryPropertyFlagBits heapBit)
{
- switch(heapBit){
+ switch (heapBit) {
#define STR(r) case VK_MEMORY_HEAP_##r: return #r
STR(DEVICE_LOCAL_BIT);
STR(MULTI_INSTANCE_BIT);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(heapBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(heapBit) + ")";
};
}
inline std::string queueBitString(const VkQueueFlagBits queueBit)
{
- switch(queueBit){
+ switch (queueBit) {
#define STR(r) case VK_QUEUE_##r: return #r
STR(GRAPHICS_BIT);
STR(COMPUTE_BIT);
@@ -544,13 +544,13 @@ namespace vulkanResources {
STR(SPARSE_BINDING_BIT);
STR(PROTECTED_BIT);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(queueBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(queueBit) + ")";
};
}
inline std::string subgroupFeatureBitString(const VkSubgroupFeatureFlagBits subgroupBit)
{
- switch(subgroupBit){
+ switch (subgroupBit) {
#define STR(r) case VK_SUBGROUP_FEATURE_##r: return #r
STR(BASIC_BIT);
STR(VOTE_BIT);
@@ -562,13 +562,13 @@ namespace vulkanResources {
STR(QUAD_BIT);
STR(PARTITIONED_BIT_NV);
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(subgroupBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(subgroupBit) + ")";
};
}
inline std::string shaderStagesBitString(const VkShaderStageFlagBits stageBit)
{
- switch(stageBit){
+ switch (stageBit) {
#define STR(r) case VK_SHADER_STAGE_##r: return #r
STR(VERTEX_BIT);
STR(TESSELLATION_CONTROL_BIT);
@@ -587,7 +587,7 @@ namespace vulkanResources {
STR(MESH_BIT_NV);
STR(ALL); // technically not a single bit, but it should work here
#undef STR
- default: return "UNKNOWN_FLAG (" + toHexString(stageBit) + ")";
+ default: return "UNKNOWN_FLAG (" + toHexString(stageBit) + ")";
};
}
@@ -606,7 +606,7 @@ namespace vulkanResources {
inline std::string conformanceVersionKHRString(const VkConformanceVersionKHR& conformanceVersion)
{
- const std::vector versionAsList = {conformanceVersion.major, conformanceVersion.minor, conformanceVersion.subminor, conformanceVersion.patch};
+ const std::vector versionAsList = { conformanceVersion.major, conformanceVersion.minor, conformanceVersion.subminor, conformanceVersion.patch };
std::vector versionAsStringList;
const auto u8ToString = [](const uint8_t num) {
return std::to_string(static_cast(num));
@@ -618,13 +618,13 @@ namespace vulkanResources {
// Values to be displayed as sample counts
const QSet sampleFlagsValueNames = {
- "framebufferColorSampleCounts",
+ "framebufferColorSampleCounts",
"framebufferDepthSampleCounts",
- "framebufferStencilSampleCounts",
+ "framebufferStencilSampleCounts",
"framebufferNoAttachmentsSampleCounts",
- "sampledImageColorSampleCounts",
- "sampledImageIntegerSampleCounts",
- "sampledImageDepthSampleCounts",
+ "sampledImageColorSampleCounts",
+ "sampledImageIntegerSampleCounts",
+ "sampledImageDepthSampleCounts",
"sampledImageStencilSampleCounts",
"storageImageSampleCounts",
// Core 1.2
@@ -632,9 +632,9 @@ namespace vulkanResources {
};
// Values to be displayed as booleans
- const QSet boolValueNames = {
- "timestampComputeAndGraphics",
- "strictLines",
+ const QSet boolValueNames = {
+ "timestampComputeAndGraphics",
+ "strictLines",
"standardSampleLocations",
// Core 1.1
"deviceLUIDValid",
@@ -683,5 +683,19 @@ namespace vulkanResources {
"deviceID"
};
+ // Values not to be displayd
+ const QSet skipValueNames = {
+ "apiVersion",
+ "deviceType",
+ "driverVersion",
+ "headerversion"
+ };
+
+ // Key replacement for display
+ const QMap replaceKeyNames = {
+ { "apiVersionText", "apiVersion" },
+ { "deviceTypeText", "driverVersion" },
+ { "driverVersionText", "driverVersion" },
+ };
};
From 709880742421b919c0397c50125265f8d16b7681 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 13:51:32 +0100
Subject: [PATCH 15/38] Reworked core 1.0 properties
Removed separate limits page
Limits are now part of the core 1.0 properties tab, like they should have been from the very beginning
---
vulkancapsviewer.cpp | 82 +++++++++++++-------------------------------
vulkancapsviewer.h | 4 ---
vulkancapsviewer.ui | 60 +-------------------------------
3 files changed, 25 insertions(+), 121 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 3d1191e..31db026 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -188,10 +188,6 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
appSettings.restore();
// Models and filters
- // Limits
- ui.treeViewDeviceLimits->setModel(&filterProxies.limits);
- filterProxies.limits.setSourceModel(&models.limits);
- connect(ui.filterLineEditLimits, SIGNAL(textChanged(QString)), this, SLOT(slotFilterLimits(QString)));
// Core 1.0 properties
ui.treeViewDeviceProperties->setModel(&filterProxies.propertiesCore10);
filterProxies.propertiesCore10.setSourceModel(&models.propertiesCore10);
@@ -376,12 +372,6 @@ void vulkanCapsViewer::slotSettings()
appSettings.restore();
}
-void vulkanCapsViewer::slotFilterLimits(QString text)
-{
- QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
- filterProxies.limits.setFilterRegExp(regExp);
-}
-
void vulkanCapsViewer::slotFilterPropertiesCore10(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
@@ -991,7 +981,6 @@ void vulkanCapsViewer::displayDevice(int index)
displayDeviceProperties(&device);
displayDeviceMemoryProperites(&device);
- displayDeviceLimits(&device);
displayDeviceFeatures(&device);
displayDeviceLayers(&device);
displayDeviceFormats(&device);
@@ -1026,14 +1015,6 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
}
}
- // Sparse properties
- QTreeWidgetItem *parentItem = new QTreeWidgetItem(treeItem);
- parentItem->setText(0, "sparse properties");
- treeItem->addChild(parentItem);
- for(QVariantMap::const_iterator iter = device->sparseProperties.begin(); iter != device->sparseProperties.end(); ++iter) {
- addTreeItemVkBool32(parentItem, iter.key().toStdString(), iter.value().toBool());
- }
-
// Subgroup operations properties
if (device->hasSubgroupProperties) {
QTreeWidgetItem *parentItem = new QTreeWidgetItem(treeItem);
@@ -1093,6 +1074,30 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
for (int i = 0; i < treeWidget->columnCount(); i++)
treeWidget->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
+ // Core 1.0
+ models.propertiesCore10.clear();
+ QStandardItem* rootItem = models.propertiesCore10.invisibleRootItem();
+ for (QVariantMap::const_iterator iter = device->properties.begin(); iter != device->properties.end(); ++iter) {
+ addPropertiesRow(rootItem, iter);
+ }
+ // Core 1.0 limits
+ QList core10LimitsItem;
+ core10LimitsItem << new QStandardItem("Limits");
+ rootItem->appendRow(core10LimitsItem);
+ for (QVariantMap::const_iterator iter = device->limits.begin(); iter != device->limits.end(); ++iter) {
+ addPropertiesRow(core10LimitsItem[0], iter);
+ }
+ // Core 1.0 sparse properties
+ QList core10SparseItem;
+ core10SparseItem << new QStandardItem("Sparse properties");
+ rootItem->appendRow(core10SparseItem);
+ for (QVariantMap::const_iterator iter = device->sparseProperties.begin(); iter != device->sparseProperties.end(); ++iter) {
+ addVkBool32Item(core10SparseItem[0], iter);
+ }
+
+ ui.treeViewDeviceProperties->expandAll();
+ ui.treeViewDeviceProperties->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+
// Core 1.1
if (!(device->core11Properties.empty())) {
models.propertiesCore11.clear();
@@ -1151,45 +1156,6 @@ void vulkanCapsViewer::displayDeviceMemoryProperites(VulkanDeviceInfo *device)
treeWidget->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
}
-void vulkanCapsViewer::displayDeviceLimits(VulkanDeviceInfo *device)
-{
- const QSet sampleFlagsLims = {
- "framebufferColorSampleCounts", "framebufferDepthSampleCounts", "framebufferStencilSampleCounts", "framebufferNoAttachmentsSampleCounts",
- "sampledImageColorSampleCounts", "sampledImageIntegerSampleCounts", "sampledImageDepthSampleCounts", "sampledImageStencilSampleCounts",
- "storageImageSampleCounts"
- };
-
- const QSet boolLims = {"timestampComputeAndGraphics", "strictLines", "standardSampleLocations"};
-
- models.limits.clear();
- QStandardItem *rootItem = models.limits.invisibleRootItem();
- for(QVariantMap::const_iterator iter = device->limits.begin(); iter != device->limits.end(); ++iter) {
- QList rowItems;
- rowItems << new QStandardItem(iter.key());
- if (iter.value().canConvert(QVariant::List)) {
- QList list = iter.value().toList();
- QString listStr = "[";
- for (int i = 0; i < list.size(); i++) {
- listStr += list[i].toString();
- if (i < list.size() - 1)
- listStr += ", ";
- }
- listStr += "]";
- rowItems << new QStandardItem(listStr);
- } else if (sampleFlagsLims.contains(iter.key())){
- const auto samples = static_cast(iter.value().toUInt());
- rowItems << new QStandardItem(vulkanResources::toQStringList(samples));
- } else if (boolLims.contains(iter.key())){
- rowItems << new QStandardItem(iter.value().toBool() ? "true" : "false");
- rowItems[1]->setForeground(iter.value().toBool() ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
- } else {
- rowItems << new QStandardItem(iter.value().toString());
- }
- rootItem->appendRow(rowItems);
- }
- ui.treeViewDeviceLimits->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
-}
-
void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
{
// Core 1.0
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index 04ccd0f..e754e0f 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -76,7 +76,6 @@ class vulkanCapsViewer : public QMainWindow
Ui::vulkanCapsViewerClass ui;
settings appSettings;
struct {
- TreeProxyFilter limits;
TreeProxyFilter propertiesCore10;
TreeProxyFilter propertiesCore11;
TreeProxyFilter propertiesCore12;
@@ -87,7 +86,6 @@ class vulkanCapsViewer : public QMainWindow
TreeProxyFilter extensions;
} filterProxies;
struct {
- QStandardItemModel limits;
QStandardItemModel propertiesCore10;
QStandardItemModel propertiesCore11;
QStandardItemModel propertiesCore12;
@@ -106,7 +104,6 @@ class vulkanCapsViewer : public QMainWindow
void displayDevice(int index);
void displayDeviceProperties(VulkanDeviceInfo *device);
void displayDeviceMemoryProperites(VulkanDeviceInfo *device);
- void displayDeviceLimits(VulkanDeviceInfo *device);
void displayDeviceFeatures(VulkanDeviceInfo *device);
void displayDeviceLayers(VulkanDeviceInfo *device);
void displayDeviceFormats(VulkanDeviceInfo *device);
@@ -125,7 +122,6 @@ private Q_SLOTS:
void slotSaveReport();
void slotUploadReport();
void slotSettings();
- void slotFilterLimits(QString text);
void slotFilterPropertiesCore10(QString text);
void slotFilterPropertiesCore11(QString text);
void slotFilterPropertiesCore12(QString text);
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 724aa47..d94f508 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -1051,64 +1051,6 @@ height: 24px;
-
-
- Limits
-
-
- -
-
-
-
- 0
-
-
- 2
-
-
- 0
-
-
- 2
-
-
-
-
-
- Filter :
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
- QTreeView::item { height: 1.25em; }
-
-
- QAbstractItemView::NoEditTriggers
-
-
- true
-
-
- true
-
-
-
-
-
Extensions
@@ -1530,7 +1472,7 @@ height: 24px;
0
0
927
- 20
+ 21
From be18931628c7a10dc9828cd3a59788eda76f24cc Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 14:16:59 +0100
Subject: [PATCH 16/38] Subgroup related flags display
---
vulkancapsviewer.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 31db026..88fe022 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -930,6 +930,38 @@ void addVariantListItem(QStandardItem* parent, const QVariantMap::const_iterator
parent->appendRow(item);
}
+template
+void addBitFlagsItem(QStandardItem* parent, const QString& key, const VkFlags flags, std::string(* const flagToString)(BitsType))
+{
+ QList flagsParentItem;
+ flagsParentItem << new QStandardItem(key);
+ flagsParentItem << new QStandardItem(QString::fromStdString(vulkanResources::toHexString(flags)));
+ parent->appendRow(flagsParentItem);
+ for (typename std::underlying_type::type bit = 0x1; bit != 0; bit <<= 1) {
+ const QString bitName = QString::fromStdString(flagToString(static_cast(bit)));
+ if (flags & bit) {
+ QList flagItem;
+ flagItem << new QStandardItem(bitName);
+ flagItem << new QStandardItem();
+ flagsParentItem[0]->appendRow(flagItem);
+ }
+ }
+ if (key == "subgroupSupportedStages") {
+ if ((flags & VK_SHADER_STAGE_ALL_GRAPHICS) == VK_SHADER_STAGE_ALL_GRAPHICS) {
+ QList flagItem;
+ flagItem << new QStandardItem(QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL_GRAPHICS)));
+ flagItem << new QStandardItem();
+ flagsParentItem[0]->appendRow(flagItem);
+ }
+ if ((flags & VK_SHADER_STAGE_ALL) == VK_SHADER_STAGE_ALL) {
+ QList flagItem;
+ flagItem << new QStandardItem(QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL)));
+ flagItem << new QStandardItem();
+ flagsParentItem[0]->appendRow(flagItem);
+ }
+ }
+}
+
void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
QString key = iterator.key();
@@ -958,6 +990,16 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator&
addVariantListItem(parent, iterator);
return;
}
+ if (key == "subgroupSupportedOperations") {
+ const VkSubgroupFeatureFlags flags = iterator.value().toUInt();
+ addBitFlagsItem(parent, iterator.key(), flags, vulkanResources::subgroupFeatureBitString);
+ return;
+ }
+ if (key == "subgroupSupportedStages") {
+ const VkShaderStageFlags flags = iterator.value().toUInt();
+ addBitFlagsItem(parent, iterator.key(), flags, vulkanResources::shaderStagesBitString);
+ return;
+ }
if (vulkanResources::replaceKeyNames.contains(key)) {
key = vulkanResources::replaceKeyNames[key];
From c81dd5566a38d1421803838b4b1de93f0857ee03 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 14:48:49 +0100
Subject: [PATCH 17/38] Removed device tab
All relevant information presented there has now been moved to the core 1.0 tab
This is more in line with the Vulkan structures
Additional code refactoring and cleanup
---
vulkancapsviewer.cpp | 151 +++++++------------------------------------
vulkancapsviewer.h | 4 +-
vulkancapsviewer.ui | 41 +-----------
3 files changed, 26 insertions(+), 170 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 88fe022..b09b6d1 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -201,8 +201,8 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
filterProxies.propertiesCore12.setSourceModel(&models.propertiesCore12);
connect(ui.filterLineEditPropertiesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore12(QString)));
// Core 1.0 features
- ui.treeViewDeviceFeatures->setModel(&filterProxies.features);
- filterProxies.features.setSourceModel(&models.features);
+ ui.treeViewDeviceFeatures->setModel(&filterProxies.featuresCore10);
+ filterProxies.featuresCore10.setSourceModel(&models.featuresCore10);
connect(ui.filterLineEditFeatures, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeatures(QString)));
// Core 1.1 features
ui.treeViewDeviceFeaturesCore11->setModel(&filterProxies.featuresCore11);
@@ -282,7 +282,7 @@ void vulkanCapsViewer::slotAbout()
"Copyright (c) 2016-2020 by Sascha Willems
"
"Build against Vulkan API " + vulkanApiVersion.toStdString() +
" header version " + to_string(VK_HEADER_VERSION) + "
"
- "This tool is FREEWARE
"
+ "This tool is Free Open Source Software
"
"For usage and distribution details refer to the readme
"
"https://www.gpuinfo.org
";
aboutText << "
";
@@ -393,7 +393,7 @@ void vulkanCapsViewer::slotFilterPropertiesCore12(QString text)
void vulkanCapsViewer::slotFilterFeatures(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
- filterProxies.features.setFilterRegExp(regExp);
+ filterProxies.featuresCore10.setFilterRegExp(regExp);
}
void vulkanCapsViewer::slotFilterFeaturesCore11(QString text)
@@ -814,32 +814,6 @@ QTreeWidgetItem *addTreeItem(QTreeWidgetItem *parent, const std::string& key, co
return newItem;
}
-enum ItemFormat {DEFAULT_FORMAT, HEX_FORMAT};
-QTreeWidgetItem *addTreeItem(QTreeWidgetItem *parent, QVariantMap::const_iterator iter, const ItemFormat format = DEFAULT_FORMAT)
-{
- // Map some key names to different display names
- QMap replaceList;
- replaceList["apiVersionText"] = "apiVersion";
- replaceList["deviceTypeText"] = "deviceType";
- replaceList["driverVersionText"] = "driverVersion";
-
- QString keyName = iter.key();
- if (replaceList.contains(keyName)) {
- keyName = replaceList[keyName];
- }
-
- QTreeWidgetItem *newItem = new QTreeWidgetItem(parent);
- newItem->setText(0, keyName);
- if (format == HEX_FORMAT){
- newItem->setText(1, vulkanResources::toHexQString(iter.value().toULongLong()));
- } else {
- assert(format == DEFAULT_FORMAT);
- newItem->setText(1, iter.value().toString());
- }
- parent->addChild(newItem);
- return newItem;
-}
-
QTreeWidgetItem *addTreeItemVkBool32(QTreeWidgetItem *parent, const std::string& key, const VkBool32 value)
{
QTreeWidgetItem *newItem = new QTreeWidgetItem(parent);
@@ -891,13 +865,27 @@ void addVkSampleCountFlagsItem(QStandardItem* parent, const QVariantMap::const_i
parent->appendRow(item);
}
+void addUUIDItem(QStandardItem* parent, const QString& key, uint8_t* UUID)
+{
+ std::ostringstream uuidSs;
+ uuidSs << std::hex << std::noshowbase << std::uppercase;
+ for (uint32_t i = 0; i < VK_UUID_SIZE; i++) {
+ uuidSs << std::right << std::setw(2) << std::setfill('0') << static_cast(UUID[i]);
+ if (i == 3 || i == 5 || i == 7 || i == 9) uuidSs << '-';
+ }
+ QList item;
+ item << new QStandardItem(key);
+ item << new QStandardItem(QString::fromStdString(uuidSs.str()));
+ parent->appendRow(item);
+}
+
void addUUIDItem(QStandardItem* parent, const QVariantMap::const_iterator& iterator)
{
const QJsonArray values = iterator.value().toJsonArray();
std::ostringstream uuidSs;
uuidSs << std::hex << std::noshowbase << std::uppercase;
- for (uint32_t i = 0; i < values.size(); i++) {
- uuidSs << std::right << std::setw(2) << std::setfill('0') << static_cast(values[i].toInt());
+ for (size_t i = 0; i < values.size(); i++) {
+ uuidSs << std::right << std::setw(2) << std::setfill('0') << static_cast(values[static_cast(i)].toInt());
if (i == 3 || i == 5 || i == 7 || i == 9) uuidSs << '-';
}
QList item;
@@ -1011,9 +999,6 @@ void addPropertiesRow(QStandardItem* parent, const QVariantMap::const_iterator&
parent->appendRow(item);
}
-///
-/// Display information on given device
-///
void vulkanCapsViewer::displayDevice(int index)
{
assert(index < vulkanGPUs.size());
@@ -1035,93 +1020,13 @@ void vulkanCapsViewer::displayDevice(int index)
void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
{
- QTreeWidget *treeWidget = ui.treeWidgetDeviceProperties;
- treeWidget->clear();
- QTreeWidgetItem *treeItem = treeWidget->invisibleRootItem();
-
-
- {
- // Some keys are doubled for raw and readable data for vkjson compatiblity, filter them out and display readable versions only
- const QSet skipList = {"apiVersion", "deviceType", "driverVersion", "headerversion"};
-
- // Some values look better as hex int
- const QSet hexList = {"vendorID", "deviceID"};
-
- // Basic properties
- for(QVariantMap::const_iterator iter = device->properties.begin(); iter != device->properties.end(); ++iter) {
- const QString& propName = iter.key();
- if (skipList.contains(propName)) continue;
-
- const ItemFormat itemFormat = hexList.contains(propName) ? HEX_FORMAT : DEFAULT_FORMAT;
- addTreeItem(treeItem, iter, itemFormat);
- }
- }
-
- // Subgroup operations properties
- if (device->hasSubgroupProperties) {
- QTreeWidgetItem *parentItem = new QTreeWidgetItem(treeItem);
- parentItem->setText(0, "subgroup properties");
- for(QVariantMap::const_iterator iter = device->subgroupProperties.begin(); iter != device->subgroupProperties.end(); ++iter) {
- QString keyName = iter.key();
- if (keyName == "quadOperationsInAllStages") {
- addTreeItemVkBool32(parentItem, iter.key().toStdString(), iter.value().toBool());
- }
- if (keyName == "subgroupSize") {
- addTreeItem(parentItem, iter);
- }
- if (keyName == "supportedOperations") {
- const VkSubgroupFeatureFlags flags = iter.value().toUInt();
- addTreeItemFlags(parentItem, iter.key().toStdString(), flags, vulkanResources::subgroupFeatureBitString);
- }
- if (keyName == "supportedStages") {
- VkShaderStageFlags flags = iter.value().toUInt();
- QTreeWidgetItem *stagesItem = addTreeItemFlags(parentItem, iter.key().toStdString(), flags, vulkanResources::shaderStagesBitString);
- addTreeItemFlag(stagesItem,
- QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL_GRAPHICS)),
- (flags & VK_SHADER_STAGE_ALL_GRAPHICS) == VK_SHADER_STAGE_ALL_GRAPHICS);
- addTreeItemFlag(stagesItem,
- QString::fromStdString(vulkanResources::shaderStagesBitString(VK_SHADER_STAGE_ALL)),
- (flags & VK_SHADER_STAGE_ALL) == VK_SHADER_STAGE_ALL);
- }
- }
- }
-
- // Pipeline cache UUID
- std::ostringstream uuidSs;
- uuidSs << std::hex << std::noshowbase << std::nouppercase;
- assert(VK_UUID_SIZE == 16);
- for (uint32_t i = 0; i < VK_UUID_SIZE; ++i){
- uuidSs << std::right << std::setw(2) << std::setfill('0') << static_cast(device->props.pipelineCacheUUID[i]);
- if (i == 3 || i == 5 || i == 7 || i == 9) uuidSs << '-';
- }
- addTreeItem(treeItem, "pipelineCacheUUID", uuidSs.str());
-
- // Operating system
- stringstream ss;
- ss << device->os.name << " " << device->os.version << " (" << device->os.architecture << ")";
- addTreeItem(treeItem, "operatingsystem", ss.str());
-
- // Platform specific info
- if (device->platformdetails.size() > 0) {
- QTreeWidgetItem *platformItem = new QTreeWidgetItem(treeItem);
- platformItem->setText(0, "Platform details");
- treeItem->addChild(platformItem);
- for (auto& detail : device->platformdetails) {
- addTreeItem(platformItem, detail.first, detail.second);
- }
- }
-
- ui.treeWidgetDeviceProperties->expandAll();
-
- for (int i = 0; i < treeWidget->columnCount(); i++)
- treeWidget->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
-
// Core 1.0
models.propertiesCore10.clear();
QStandardItem* rootItem = models.propertiesCore10.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->properties.begin(); iter != device->properties.end(); ++iter) {
addPropertiesRow(rootItem, iter);
}
+ addUUIDItem(rootItem, "pipelineCacheUUID", device->props.pipelineCacheUUID);
// Core 1.0 limits
QList core10LimitsItem;
core10LimitsItem << new QStandardItem("Limits");
@@ -1201,8 +1106,8 @@ void vulkanCapsViewer::displayDeviceMemoryProperites(VulkanDeviceInfo *device)
void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
{
// Core 1.0
- models.features.clear();
- QStandardItem *rootItem = models.features.invisibleRootItem();
+ models.featuresCore10.clear();
+ QStandardItem *rootItem = models.featuresCore10.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->features.begin(); iter != device->features.end(); ++iter) {
addVkBool32Item(rootItem, iter);
}
@@ -1258,8 +1163,6 @@ void vulkanCapsViewer::displayDeviceLayers(VulkanDeviceInfo *device)
QTreeWidget *treeWidget = ui.treeWidgetDeviceLayers;
treeWidget->clear();
- // @todo: adjust to new structure
-// ui.tabWidgetDevice->setTabText(5, "Layers (" + QString::number(device->getLayers().size()) + ")");
for (auto& layer : device->getLayers())
{
QTreeWidgetItem *treeItem = new QTreeWidgetItem(treeWidget);
@@ -1408,14 +1311,8 @@ QString arrayToStr(QVariant value) {
return listStr;
}
-/*
- Fill extension tree model incudling extension features and properties
-*/
void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
{
- // @todo: adjust to new structure
- //ui.tabWidgetDevice->setTabText(3, "Extensions (" + QString::number(device->extensions.size()) + ")");
-
models.extensions.clear();
QStandardItem *rootItem = models.extensions.invisibleRootItem();
@@ -1484,8 +1381,6 @@ void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
void vulkanCapsViewer::displayDeviceQueues(VulkanDeviceInfo *device)
{
- // @todo: adjust to new structure
- //ui.tabWidgetDevice->setTabText(6, "Queues Families (" + QString::number(device->queueFamilies.size()) + ")");
QTreeWidget* treeWidget = ui.treeWidgetQueues;
treeWidget->clear();
for (auto& queueFamily : device->queueFamilies)
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index e754e0f..b5c4b22 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -79,7 +79,7 @@ class vulkanCapsViewer : public QMainWindow
TreeProxyFilter propertiesCore10;
TreeProxyFilter propertiesCore11;
TreeProxyFilter propertiesCore12;
- TreeProxyFilter features;
+ TreeProxyFilter featuresCore10;
TreeProxyFilter featuresCore11;
TreeProxyFilter featuresCore12;
TreeProxyFilter formats;
@@ -89,7 +89,7 @@ class vulkanCapsViewer : public QMainWindow
QStandardItemModel propertiesCore10;
QStandardItemModel propertiesCore11;
QStandardItemModel propertiesCore12;
- QStandardItemModel features;
+ QStandardItemModel featuresCore10;
QStandardItemModel featuresCore11;
QStandardItemModel featuresCore12;
QStandardItemModel formats;
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index d94f508..32de8f9 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -580,7 +580,7 @@ height: 24px;
QTabWidget::Rounded
- 1
+ 0
false
@@ -588,45 +588,6 @@ height: 24px;
false
-
-
- Device
-
-
- -
-
-
- QTreeView::item { height: 1.25em; }
-
-
- QAbstractItemView::NoEditTriggers
-
-
- true
-
-
- true
-
-
- 200
-
-
- true
-
-
-
- key
-
-
-
-
- value
-
-
-
-
-
-
Properties
From f48e41c19e1f4333d33c64a2212ee8b3029a142a Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 15:36:11 +0100
Subject: [PATCH 18/38] Android combo box selector entries
---
vulkancapsviewer.ui | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 32de8f9..89417e3 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -502,7 +502,7 @@ height: 24px;
- Device Info
+ Properties
16
@@ -512,7 +512,7 @@ height: 24px;
-
- Device Info
+ Properties
-
@@ -520,11 +520,6 @@ height: 24px;
Features
- -
-
- Limits
-
-
-
Extensions
From 432dfcfdb62fa44f6f1058b65260721bf9c05870 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 16:01:37 +0100
Subject: [PATCH 19/38] Always clear features and properties models
---
vulkancapsviewer.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index b09b6d1..d442aa7 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -1046,8 +1046,8 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
ui.treeViewDeviceProperties->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
// Core 1.1
+ models.propertiesCore11.clear();
if (!(device->core11Properties.empty())) {
- models.propertiesCore11.clear();
QStandardItem* rootItem = models.propertiesCore11.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core11Properties.begin(); iter != device->core11Properties.end(); ++iter) {
addPropertiesRow(rootItem, iter);
@@ -1057,8 +1057,8 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
}
// Core 1.2
+ models.propertiesCore12.clear();
if (!(device->core12Properties.empty())) {
- models.propertiesCore12.clear();
QStandardItem* rootItem = models.propertiesCore12.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core12Properties.begin(); iter != device->core12Properties.end(); ++iter) {
addPropertiesRow(rootItem, iter);
@@ -1115,8 +1115,8 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
ui.treeViewDeviceFeatures->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
// Core 1.1
+ models.featuresCore11.clear();
if (!(device->core11Features.empty())) {
- models.featuresCore11.clear();
QStandardItem *rootItem = models.featuresCore11.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core11Features.begin(); iter != device->core11Features.end(); ++iter) {
addVkBool32Item(rootItem, iter);
@@ -1126,8 +1126,8 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
}
// Core 1.2
+ models.featuresCore12.clear();
if (!(device->core12Features.empty())) {
- models.featuresCore12.clear();
QStandardItem *rootItem = models.featuresCore12.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core12Features.begin(); iter != device->core12Features.end(); ++iter) {
addVkBool32Item(rootItem, iter);
From 241524e2690c02af22b4752be61ef09e30aaeed0 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 16:25:33 +0100
Subject: [PATCH 20/38] Moved extension features and properties into the
feature and properties main tabs
This is in line with the online database front-end
---
vulkancapsviewer.cpp | 169 +++++++++++++++++++++++++++----------------
vulkancapsviewer.h | 6 ++
vulkancapsviewer.ui | 122 +++++++++++++++++++++++++++++++
3 files changed, 233 insertions(+), 64 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index d442aa7..57c8feb 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -200,6 +200,10 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
ui.treeViewDevicePropertiesCore12->setModel(&filterProxies.propertiesCore12);
filterProxies.propertiesCore12.setSourceModel(&models.propertiesCore12);
connect(ui.filterLineEditPropertiesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesCore12(QString)));
+ // Extension properties
+ ui.treeViewDevicePropertiesExtensions->setModel(&filterProxies.propertiesExtensions);
+ filterProxies.propertiesExtensions.setSourceModel(&models.propertiesExtensions);
+ connect(ui.filterLineEditPropertiesExtensions, SIGNAL(textChanged(QString)), this, SLOT(slotFilterPropertiesExtensions(QString)));
// Core 1.0 features
ui.treeViewDeviceFeatures->setModel(&filterProxies.featuresCore10);
filterProxies.featuresCore10.setSourceModel(&models.featuresCore10);
@@ -212,6 +216,10 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
ui.treeViewDeviceFeaturesCore12->setModel(&filterProxies.featuresCore12);
filterProxies.featuresCore12.setSourceModel(&models.featuresCore12);
connect(ui.filterLineEditFeaturesCore12, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeaturesCore12(QString)));
+ // Extension features
+ ui.treeViewDeviceFeaturesExtensions->setModel(&filterProxies.featuresExtensions);
+ filterProxies.featuresExtensions.setSourceModel(&models.featuresExtensions);
+ connect(ui.filterLineEditFeaturesExtensions, SIGNAL(textChanged(QString)), this, SLOT(slotFilterFeaturesExtensions(QString)));
// Extensions
ui.treeViewDeviceExtensions->setModel(&filterProxies.extensions);
filterProxies.extensions.setSourceModel(&models.extensions);
@@ -390,6 +398,12 @@ void vulkanCapsViewer::slotFilterPropertiesCore12(QString text)
filterProxies.propertiesCore12.setFilterRegExp(regExp);
}
+void vulkanCapsViewer::slotFilterPropertiesExtensions(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.propertiesExtensions.setFilterRegExp(regExp);
+}
+
void vulkanCapsViewer::slotFilterFeatures(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
@@ -408,6 +422,12 @@ void vulkanCapsViewer::slotFilterFeaturesCore12(QString text)
filterProxies.featuresCore12.setFilterRegExp(regExp);
}
+void vulkanCapsViewer::slotFilterFeaturesExtensions(QString text)
+{
+ QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
+ filterProxies.featuresExtensions.setFilterRegExp(regExp);
+}
+
void vulkanCapsViewer::slotFilterExtensions(QString text)
{
QRegExp regExp(text, Qt::CaseInsensitive, QRegExp::RegExp);
@@ -1018,6 +1038,19 @@ void vulkanCapsViewer::displayDevice(int index)
checkReportDatabaseState();
}
+// @todo: replace
+QString arrayToStr(QVariant value) {
+ QList list = value.toList();
+ QString listStr = "[";
+ for (int i = 0; i < list.size(); i++) {
+ listStr += list[i].toString();
+ if (i < list.size() - 1)
+ listStr += ", ";
+ }
+ listStr += "]";
+ return listStr;
+}
+
void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
{
// Core 1.0
@@ -1066,6 +1099,49 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
ui.treeViewDevicePropertiesCore12->expandAll();
ui.treeViewDevicePropertiesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+
+ // Extensions
+ models.propertiesExtensions.clear();
+ if (!(device->properties2.empty())) {
+ QStandardItem* rootItem = models.propertiesExtensions.invisibleRootItem();
+ for (auto& extension : device->extensions) {
+ bool hasProperties = false;
+ QList extItem;
+ for (auto& property : device->properties2) {
+ if (strcmp(property.extension, extension.extensionName) == 0) {
+ if (!hasProperties) {
+ hasProperties = true;
+ 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);
+ }
+ }
+ if (hasProperties) {
+ rootItem->appendRow(extItem);
+ }
+ }
+ ui.treeViewDevicePropertiesExtensions->expandAll();
+ ui.treeViewDevicePropertiesExtensions->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
}
void vulkanCapsViewer::displayDeviceMemoryProperites(VulkanDeviceInfo *device)
@@ -1135,6 +1211,35 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
ui.treeViewDeviceFeaturesCore12->expandAll();
ui.treeViewDeviceFeaturesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+
+ // Extensions
+ models.featuresExtensions.clear();
+ if (!(device->features2.empty())) {
+ QStandardItem* rootItem = models.featuresExtensions.invisibleRootItem();
+ for (auto& extension : device->extensions) {
+ bool hasFeatures = false;
+ QList extItem;
+ for (auto& feature : device->features2) {
+ if (strcmp(feature.extension, extension.extensionName) == 0) {
+ if (!hasFeatures) {
+ hasFeatures = true;
+ extItem << new QStandardItem(QString::fromStdString(extension.extensionName));
+ extItem << new QStandardItem();
+ }
+ QList featureItem;
+ featureItem << new QStandardItem(QString::fromStdString(feature.name));
+ featureItem << new QStandardItem((feature.supported) ? "true" : "false");
+ featureItem[1]->setForeground((feature.supported) ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
+ extItem.first()->appendRow(featureItem);
+ }
+ }
+ if (hasFeatures) {
+ rootItem->appendRow(extItem);
+ }
+ }
+ ui.treeViewDeviceFeaturesExtensions->expandAll();
+ ui.treeViewDeviceFeaturesExtensions->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ }
}
void vulkanCapsViewer::displayGlobalLayers(QTreeWidget *tree)
@@ -1299,18 +1404,6 @@ void vulkanCapsViewer::displayDeviceFormats(VulkanDeviceInfo *device)
ui.treeViewFormats->sortByColumn(0, Qt::SortOrder::AscendingOrder);
}
-QString arrayToStr(QVariant value) {
- QList list = value.toList();
- QString listStr = "[";
- for (int i = 0; i < list.size(); i++) {
- listStr += list[i].toString();
- if (i < list.size() - 1)
- listStr += ", ";
- }
- listStr += "]";
- return listStr;
-}
-
void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
{
models.extensions.clear();
@@ -1320,58 +1413,6 @@ void vulkanCapsViewer::displayDeviceExtensions(VulkanDeviceInfo *device)
QList extItem;
extItem << new QStandardItem(QString::fromStdString(extension.extensionName));
extItem << new QStandardItem(QString::fromStdString(vulkanResources::revisionToString(extension.specVersion)));
-
- // Features
- bool hasFeatures = false;
- QList featureRootItem;
- for (auto& feature : device->features2) {
- featureRootItem << new QStandardItem("Features");
- featureRootItem << new QStandardItem(" ");
- if (strcmp(feature.extension, extension.extensionName) == 0) {
- hasFeatures = true;
- QList featureItem;
- featureItem << new QStandardItem(QString::fromStdString(feature.name));
- featureItem << new QStandardItem((feature.supported) ? "true" : "false");
- featureItem[1]->setForeground((feature.supported) ? QColor::fromRgb(0, 128, 0) : QColor::fromRgb(255, 0, 0));
- featureRootItem.first()->appendRow(featureItem);
- }
- }
- if (hasFeatures) {
- extItem.first()->appendRow(featureRootItem);
- }
-
- // Properties
- bool hasProperties = false;
- QList propertiesRootItem;
- for (auto& property : device->properties2) {
- propertiesRootItem << new QStandardItem("Properties");
- propertiesRootItem << new QStandardItem(" ");
- if (strcmp(property.extension, extension.extensionName) == 0) {
- hasProperties = true;
- 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());
- }
- }
- propertiesRootItem.first()->appendRow(propertyItem);
- }
- }
- if (hasProperties) {
- extItem.first()->appendRow(propertiesRootItem);
- }
-
rootItem->appendRow(extItem);
}
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index b5c4b22..3955670 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -79,9 +79,11 @@ class vulkanCapsViewer : public QMainWindow
TreeProxyFilter propertiesCore10;
TreeProxyFilter propertiesCore11;
TreeProxyFilter propertiesCore12;
+ TreeProxyFilter propertiesExtensions;
TreeProxyFilter featuresCore10;
TreeProxyFilter featuresCore11;
TreeProxyFilter featuresCore12;
+ TreeProxyFilter featuresExtensions;
TreeProxyFilter formats;
TreeProxyFilter extensions;
} filterProxies;
@@ -89,9 +91,11 @@ class vulkanCapsViewer : public QMainWindow
QStandardItemModel propertiesCore10;
QStandardItemModel propertiesCore11;
QStandardItemModel propertiesCore12;
+ QStandardItemModel propertiesExtensions;
QStandardItemModel featuresCore10;
QStandardItemModel featuresCore11;
QStandardItemModel featuresCore12;
+ QStandardItemModel featuresExtensions;
QStandardItemModel formats;
QStandardItemModel extensions;
} models;
@@ -125,9 +129,11 @@ private Q_SLOTS:
void slotFilterPropertiesCore10(QString text);
void slotFilterPropertiesCore11(QString text);
void slotFilterPropertiesCore12(QString text);
+ void slotFilterPropertiesExtensions(QString text);
void slotFilterFeatures(QString text);
void slotFilterFeaturesCore11(QString text);
void slotFilterFeaturesCore12(QString text);
+ void slotFilterFeaturesExtensions(QString text);
void slotFilterExtensions(QString text);
void slotFilterFormats(QString text);
void slotComboTabChanged(int index);
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 89417e3..8c78f50 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -791,6 +791,67 @@ height: 24px;
+
+
+ Extensions
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
@@ -1003,6 +1064,67 @@ height: 24px;
+
+
+ Extensions
+
+
+ -
+
+
+
+ 0
+
+
+ 2
+
+
+ 0
+
+
+ 2
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Filter :
+
+
+
+
+
+
+ -
+
+
+ QTreeView::item { height: 1.25em; }
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ false
+
+
+ 200
+
+
+
+
+
From 697431af68930434074360bf0486b8cee576eb98 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 16:27:25 +0100
Subject: [PATCH 21/38] Removed device layer display
These have been deprecated long time ago
---
vulkancapsviewer.cpp | 24 -------------------
vulkancapsviewer.h | 1 -
vulkancapsviewer.ui | 56 --------------------------------------------
3 files changed, 81 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 57c8feb..3cad475 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -1029,7 +1029,6 @@ void vulkanCapsViewer::displayDevice(int index)
displayDeviceProperties(&device);
displayDeviceMemoryProperites(&device);
displayDeviceFeatures(&device);
- displayDeviceLayers(&device);
displayDeviceFormats(&device);
displayDeviceExtensions(&device);
displayDeviceQueues(&device);
@@ -1262,29 +1261,6 @@ void vulkanCapsViewer::displayGlobalLayers(QTreeWidget *tree)
tree->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
}
-void vulkanCapsViewer::displayDeviceLayers(VulkanDeviceInfo *device)
-{
- using namespace vulkanResources;
-
- QTreeWidget *treeWidget = ui.treeWidgetDeviceLayers;
- treeWidget->clear();
- for (auto& layer : device->getLayers())
- {
- QTreeWidgetItem *treeItem = new QTreeWidgetItem(treeWidget);
- treeItem->setText(0, QString::fromUtf8(layer.properties.layerName));
- treeItem->setText(1, QString::fromStdString(versionToString(layer.properties.specVersion)));
- treeItem->setText(2, QString::fromStdString(revisionToString(layer.properties.implementationVersion)));
- treeItem->setText(3, QString::fromStdString(to_string(layer.extensions.size())));
- treeItem->setText(4, layer.properties.description);
- for (auto& layerExt : layer.extensions)
- {
- addTreeItem(treeItem, layerExt.extensionName, revisionToString(layerExt.specVersion));
- }
- }
- for (int i = 0; i < treeWidget->columnCount(); i++)
- treeWidget->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
-}
-
void addFlagModelItem(QStandardItem *parent, QString flagName, bool flag)
{
if (flag)
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index 3955670..d28f246 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -109,7 +109,6 @@ class vulkanCapsViewer : public QMainWindow
void displayDeviceProperties(VulkanDeviceInfo *device);
void displayDeviceMemoryProperites(VulkanDeviceInfo *device);
void displayDeviceFeatures(VulkanDeviceInfo *device);
- void displayDeviceLayers(VulkanDeviceInfo *device);
void displayDeviceFormats(VulkanDeviceInfo *device);
void displayDeviceExtensions(VulkanDeviceInfo *device);
void displayDeviceQueues(VulkanDeviceInfo *device);
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index 8c78f50..e6513de 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -530,11 +530,6 @@ height: 24px;
Formats
- -
-
- Layers
-
-
-
Queue Families
@@ -1253,57 +1248,6 @@ height: 24px;
-
-
- Layers
-
-
- -
-
-
- QTreeView::item { height: 1.25em; }
-
-
- QAbstractItemView::NoEditTriggers
-
-
- true
-
-
- 200
-
-
- true
-
-
-
- Name
-
-
-
-
- Specification
-
-
-
-
- Impementation
-
-
-
-
- Extension count
-
-
-
-
- Description
-
-
-
-
-
-
Queue families
From fcf9abb948eb87d5987284cc6051a69ccb10b8c8 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Thu, 24 Dec 2020 17:14:45 +0100
Subject: [PATCH 22/38] Version bump to 3.0
---
android/AndroidManifest.xml | 2 +-
vulkancapsviewer.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index 362b325..a6dfbec 100644
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
>
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 3cad475..2a20361 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -77,8 +77,8 @@ using std::to_string;
#define VK_API_VERSION VK_API_VERSION_1_1
-const std::string vulkanCapsViewer::version = "2.3";
-const std::string vulkanCapsViewer::reportVersion = "2.1";
+const std::string vulkanCapsViewer::version = "3.0";
+const std::string vulkanCapsViewer::reportVersion = "3.0";
///
/// Returns operating system name
From 48b54014e6deb278ae03ec4dd8a10ffddabdffd2 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Fri, 25 Dec 2020 10:28:50 +0100
Subject: [PATCH 23/38] Use vkEnumerateInstanceVersion (if available) to query
Vulkan version to be requested
Removed old, fixed version
---
vulkancapsviewer.cpp | 45 +++++++++++++++++++++++---------------------
vulkancapsviewer.h | 2 +-
2 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 2a20361..6c9d528 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -75,8 +75,6 @@ extern "C"{
using std::to_string;
-#define VK_API_VERSION VK_API_VERSION_1_1
-
const std::string vulkanCapsViewer::version = "3.0";
const std::string vulkanCapsViewer::reportVersion = "3.0";
@@ -132,13 +130,11 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
qApp->setStyle(QStyleFactory::create("Fusion"));
- vulkanApiVersion = QString::fromStdString(vulkanResources::versionToString(VK_API_VERSION));
-
ui.label_header_top->setText(ui.label_header_top->text() + " " + QString::fromStdString(version));
#ifdef ANDROID
// Load Vulkan libraries on Android manually
if (!loadVulkanLibrary()) {
- QMessageBox::warning(this, "Error", "Could not initialize Vulkan!\n\nPlease make sure that this device actually supports the Vulkan API!");
+ QMessageBox::warning(this, "Error", "Could not initialize Vulkan!\n\nPlease make sure that this device actually supports the Vulkan API.");
exit(EXIT_FAILURE);
}
// Adjust toolbar to better fit mobile devices
@@ -181,7 +177,7 @@ vulkanCapsViewer::vulkanCapsViewer(QWidget *parent)
if (!initVulkan())
{
- QMessageBox::warning(this, "Error", "Could not initialize Vulkan!\nDevice must support Vulkan API version " + vulkanApiVersion + "!");
+ QMessageBox::warning(this, "Error", "Could not initialize Vulkan!\n\nMake sure that at least one installed device supports Vulkan and supports at least Version 1.1.");
exit(EXIT_FAILURE);
}
@@ -280,21 +276,23 @@ void vulkanCapsViewer::slotRefresh()
// getGPUs(); TODO : Clean up before refresh
}
-///
-/// Display an about box
-///
+std::string apiVersionText(uint32_t apiVersion)
+{
+ return to_string(VK_VERSION_MAJOR(apiVersion)) + "." + to_string(VK_VERSION_MINOR(apiVersion)) + "." + to_string(VK_VERSION_PATCH(apiVersion));
+}
+
void vulkanCapsViewer::slotAbout()
{
std::stringstream aboutText;
aboutText << "Vulkan Hardware Capability Viewer " << version << "
"
"Copyright (c) 2016-2020 by Sascha Willems
"
- "Build against Vulkan API " + vulkanApiVersion.toStdString() +
- " header version " + to_string(VK_HEADER_VERSION) + "
"
- "This tool is Free Open Source Software
"
- "For usage and distribution details refer to the readme
"
- "https://www.gpuinfo.org
";
+ "This tool is Free Open Source Software
"
+ "For usage and distribution details refer to the readme
"
+ "https://www.gpuinfo.org
"
+ "Vulkan instance API version: " + apiVersionText(instanceApiVersion) + "
"
+ "Compiled against Vulkan header version: " + to_string(VK_HEADER_VERSION) + "
";
aboutText << "
";
- QMessageBox::about(this, tr("About the Vulkan hardware capability viewer"), QString::fromStdString(aboutText.str()));
+ QMessageBox::about(this, tr("About the Vulkan Hardware Capability Viewer"), QString::fromStdString(aboutText.str()));
}
///
@@ -339,7 +337,7 @@ void vulkanCapsViewer::slotUploadReport()
if (reportId > -1)
{
QMessageBox::StandardButton reply;
- reply = QMessageBox::question(this, "Device already present", "A report for the selected device is aleady present in the database.\n\nDo you want to open the report in your browser?", QMessageBox::Yes | QMessageBox::No);
+ reply = QMessageBox::question(this, "Device already present", "A report for the selected device is already present in the database.\n\nDo you want to open the report in your browser?", QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
QString url = QString::fromStdString(databaseConnection.getBaseUrl() + "displayreport.php?id=" + to_string(reportId));
@@ -459,20 +457,25 @@ void vulkanCapsViewer::displayGlobalExtensions()
}
}
-///
-/// Initialize vulkan and dome some initial setup
-///
bool vulkanCapsViewer::initVulkan()
{
VkResult vkRes;
+ // Get the max. supported Vulkan Version if vkEnumerateInstanceVersion is available (loader version 1.1 and up)
+ PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion = reinterpret_cast(vkGetInstanceProcAddr(nullptr, "vkEnumerateInstanceVersion"));
+ if (vkEnumerateInstanceVersion) {
+ vkEnumerateInstanceVersion(&instanceApiVersion);
+ } else {
+ instanceApiVersion = VK_API_VERSION_1_0;
+ }
+
VkApplicationInfo appInfo = {};
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
appInfo.pApplicationName = "VulkanCapsViewer";
appInfo.applicationVersion = 1;
appInfo.pEngineName = "VulkanCapsViewer";
appInfo.engineVersion = 1;
- appInfo.apiVersion = VK_API_VERSION_1_0;
+ appInfo.apiVersion = instanceApiVersion;
// Create Vulkan instance
VkInstanceCreateInfo instanceCreateInfo = {};
@@ -573,7 +576,7 @@ bool vulkanCapsViewer::initVulkan()
QString error;
if (vkRes == VK_ERROR_INCOMPATIBLE_DRIVER)
{
- error = "No compatible Vulkan driver found!\nThis version requires a Vulkan driver that is compatible with API Level " + QString::fromStdString(vulkanResources::versionToString(VK_API_VERSION));
+ error = "No compatible Vulkan driver found!\nThis version requires a Vulkan driver that is compatible with at least Vulkan 1.1";
}
else
{
diff --git a/vulkancapsviewer.h b/vulkancapsviewer.h
index d28f246..2435f94 100644
--- a/vulkancapsviewer.h
+++ b/vulkancapsviewer.h
@@ -68,7 +68,7 @@ class vulkanCapsViewer : public QMainWindow
void exportReportAsJSON(std::string fileName, std::string submitter, std::string comment);
int uploadReportNonVisual(int deviceIndex, QString submitter, QString comment);
private:
- QString vulkanApiVersion;
+ uint32_t instanceApiVersion;
int selectedDeviceIndex = 0;
VkInstance vkInstance = VK_NULL_HANDLE;
VkSurfaceKHR surface;
From a3b84ea554ea51c9e4250d4528f63c3ec4aec6e8 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Fri, 25 Dec 2020 10:55:21 +0100
Subject: [PATCH 24/38] Hide tabs if data is not available
---
vulkancapsviewer.cpp | 25 +++++++++++++++++++++++++
vulkancapsviewer.ui | 15 ++++++++++++---
2 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index 6c9d528..c356dba 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -1083,6 +1083,7 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
// Core 1.1
models.propertiesCore11.clear();
if (!(device->core11Properties.empty())) {
+ ui.tabWidgetProperties->setTabEnabled(1, true);
QStandardItem* rootItem = models.propertiesCore11.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core11Properties.begin(); iter != device->core11Properties.end(); ++iter) {
addPropertiesRow(rootItem, iter);
@@ -1090,10 +1091,14 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
ui.treeViewDevicePropertiesCore11->expandAll();
ui.treeViewDevicePropertiesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetProperties->setTabEnabled(1, false);
+ }
// Core 1.2
models.propertiesCore12.clear();
if (!(device->core12Properties.empty())) {
+ ui.tabWidgetProperties->setTabEnabled(2, true);
QStandardItem* rootItem = models.propertiesCore12.invisibleRootItem();
for (QVariantMap::const_iterator iter = device->core12Properties.begin(); iter != device->core12Properties.end(); ++iter) {
addPropertiesRow(rootItem, iter);
@@ -1101,10 +1106,14 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
ui.treeViewDevicePropertiesCore12->expandAll();
ui.treeViewDevicePropertiesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetProperties->setTabEnabled(2, false);
+ }
// Extensions
models.propertiesExtensions.clear();
if (!(device->properties2.empty())) {
+ ui.tabWidgetProperties->setTabEnabled(3, true);
QStandardItem* rootItem = models.propertiesExtensions.invisibleRootItem();
for (auto& extension : device->extensions) {
bool hasProperties = false;
@@ -1144,6 +1153,9 @@ void vulkanCapsViewer::displayDeviceProperties(VulkanDeviceInfo *device)
ui.treeViewDevicePropertiesExtensions->expandAll();
ui.treeViewDevicePropertiesExtensions->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetProperties->setTabEnabled(3, false);
+ }
}
void vulkanCapsViewer::displayDeviceMemoryProperites(VulkanDeviceInfo *device)
@@ -1195,6 +1207,7 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
// Core 1.1
models.featuresCore11.clear();
if (!(device->core11Features.empty())) {
+ ui.tabWidgetFeatures->setTabEnabled(1, true);
QStandardItem *rootItem = models.featuresCore11.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core11Features.begin(); iter != device->core11Features.end(); ++iter) {
addVkBool32Item(rootItem, iter);
@@ -1202,10 +1215,14 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
ui.treeViewDeviceFeaturesCore11->expandAll();
ui.treeViewDeviceFeaturesCore11->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetFeatures->setTabEnabled(1, false);
+ }
// Core 1.2
models.featuresCore12.clear();
if (!(device->core12Features.empty())) {
+ ui.tabWidgetFeatures->setTabEnabled(2, true);
QStandardItem *rootItem = models.featuresCore12.invisibleRootItem();
for(QVariantMap::const_iterator iter = device->core12Features.begin(); iter != device->core12Features.end(); ++iter) {
addVkBool32Item(rootItem, iter);
@@ -1213,10 +1230,14 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
ui.treeViewDeviceFeaturesCore12->expandAll();
ui.treeViewDeviceFeaturesCore12->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetFeatures->setTabEnabled(2, false);
+ }
// Extensions
models.featuresExtensions.clear();
if (!(device->features2.empty())) {
+ ui.tabWidgetFeatures->setTabEnabled(3, true);
QStandardItem* rootItem = models.featuresExtensions.invisibleRootItem();
for (auto& extension : device->extensions) {
bool hasFeatures = false;
@@ -1242,6 +1263,10 @@ void vulkanCapsViewer::displayDeviceFeatures(VulkanDeviceInfo *device)
ui.treeViewDeviceFeaturesExtensions->expandAll();
ui.treeViewDeviceFeaturesExtensions->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
+ else {
+ ui.tabWidgetFeatures->setTabEnabled(3, false);
+ }
+
}
void vulkanCapsViewer::displayGlobalLayers(QTreeWidget *tree)
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index e6513de..c839c16 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -19,7 +19,7 @@
- Vulkan Hardware Capability Viewer 1.0 (beta)
+ Vulkan Hardware Capability Viewer
false
@@ -41,6 +41,15 @@ QTabWidget::tab-bar {
alignment: center;
}
+QTabBar::tab:disabled {
+ min-width: 0 !important;
+ width: 0 !important;
+ height: 0 !important;
+ margin: 0 !important;
+ padding: 0 !important;
+ border: none !important;
+}
+
QTabBar::tab {
min-width: 8ex;
padding: 8px 16px;
@@ -599,7 +608,7 @@ height: 24px;
0
-
-
+
0
@@ -872,7 +881,7 @@ height: 24px;
0
-
-
+
0
From 4db1170d5ecb1c1c49c8f951e083385240842950 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Fri, 25 Dec 2020 11:06:38 +0100
Subject: [PATCH 25/38] Hide device selection if only one device is available
(Android only)
---
vulkancapsviewer.cpp | 5 +++++
vulkancapsviewer.ui | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/vulkancapsviewer.cpp b/vulkancapsviewer.cpp
index c356dba..948b9e4 100644
--- a/vulkancapsviewer.cpp
+++ b/vulkancapsviewer.cpp
@@ -826,6 +826,11 @@ void vulkanCapsViewer::getGPUs()
{
QMessageBox::warning(this, tr("Error"), "Could not find a GPU with Vulkan support!");
}
+
+ // Only display device selection of more than once device is present (Android only)
+#ifdef __ANDROID__
+ ui.widgetDeviceSelection->setVisible(vulkanGPUs.size() > 1);
+#endif
}
QTreeWidgetItem *addTreeItem(QTreeWidgetItem *parent, const std::string& key, const std::string& value)
diff --git a/vulkancapsviewer.ui b/vulkancapsviewer.ui
index c839c16..a437d09 100644
--- a/vulkancapsviewer.ui
+++ b/vulkancapsviewer.ui
@@ -383,7 +383,7 @@ QTreeView {
-
-
+
background-color: rgb(68, 68, 68);
From c12acfaf03b4250b9ca48e53b5affa4abe172861 Mon Sep 17 00:00:00 2001
From: Sascha Willems
Date: Fri, 25 Dec 2020 12:12:27 +0100
Subject: [PATCH 26/38] Updated logos and readme
---
README.md | 11 ++++-------
Resources/vulkan32.png | Bin 2493 -> 4638 bytes
Resources/vulkan48.png | Bin 3728 -> 6763 bytes
images/vulkanlogo.png | Bin 9378 -> 19618 bytes
vulkancapsviewer.qrc | 32 ++++++++++++++++----------------
5 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
index f9e070e..06adf90 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
# Vulkan Hardware Capability Viewer
-![Vulkan Logo](./images/vulkanlogo.png)
+
-Client application to display hardware implementation details for GPUs supporting the new [Vulkan(tm)](https://www.khronos.org/vulkan/) API by Khronos.
+Client application to display hardware implementation details for GPUs supporting the [Vulkan](https://www.khronos.org/vulkan/) API by Khronos.
The hardware reports can be submitted to a public [online database](http://vulkan.gpuinfo.org/) that allows comparing different devices, browsing available features, extensions, formats, etc.
@@ -11,20 +11,17 @@ The hardware reports can be submitted to a public [online database](http://vulka
# Supported platforms
-**A Vulkan compatible driver (or on Android image) is required**
+**A Vulkan compatible device is required**
- Windows (x64)
- Linux (x64)
- Android (Including Android TV)
- Mac OS X
-# API version
-Due to the explicit nature of Vulkan, the API version of the Vulkan driver (or Android image) must fit the API level against which the application was build.
-
# Building
[![Build Status](https://travis-ci.org/SaschaWillems/VulkanCapsViewer.svg?branch=master)](https://travis-ci.org/SaschaWillems/VulkanCapsViewer)
-The repository includes a project file for the [Qt Creator IDE](https://www.qt.io/ide/) that has been tested to work with Windows, Linux and Android. This is the preferred (and easiest) way of building the application if you want to build it yourself.
+The repository includes a project file for the [Qt Creator IDE](https://www.qt.io/ide/) that has been tested to work with Windows, Linux and Android. This is the preferred (and easiest) way of building the application if you want to build it yourself. Using the [Qt Visual Studio Tools](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019), it's also possible to use a current Visual Studio version.
Alternatively, you can simply run `qmake` followed by `make` in the source directory.
# Releases
diff --git a/Resources/vulkan32.png b/Resources/vulkan32.png
index 5dc85e8f8f5641981fb72a98e9ccd1be95f02bee..a076edbf5d9dc7bf5aafc3d46cde26fe2d7bcfe8 100644
GIT binary patch
literal 4638
zcmV+(65;KMP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc5wl4|K~!i%?OO?y
zRMnZj%X_u-0(8?2^ith4tG2j|=m{8IBZ&WRvq+q1kA>4~O*gCFfG0
zqE6Rm8ZR2XQyzf^qB4a7{3R{yQJS@(P9t)nmeSks_Y=lto#V2mnC{uVxVgED+8)Ee
zI3R%!jEbB#RPw6>T+9Gzqg;>$0!#+x4i-dYrnN^bv7P4ImW+41Om$j{M{VZ3*=370
zn_JlXPqX?YRXT>==$D0?D=Wh%GUF^$v+oJP&J|qbgE&vn{1Avc5IiE$KljIx$a9pk
zklbo>wJxdM*KEc!A-DFqI>VOtm;5#6=*j(91kbq~-SF>D*x9YbXfq
zQA+RX(Q0*vvL3s+sp)T&PlZP-dNK2>NMvk26Tg;BoaI6V4u&>r1Boimbhlu<9qD$(
zbQjd62Szf93Te&JTB2S^auyPr=b=FX8Wx~#9yUw>?Y!Z0*`arif6#`xO7FFqTJ13R
znM8N@TX(m$wWn(xUGRiNAk8ZYuvfs^SM(R4j)Y344(1OW@H)-)My=Q%m7zb@LNvnu
zrSe?Y>IsLPz}}!5CR#mC_A13KXP5}*_ZY5Wm^>u{%CHMLGpdEw6S&g<03uI8U^78-
zkw+tWW*kp;cF;`0bSJd({ch#{`>@8ux>?}XFFh)dmBnM_Ro^cV;z3skbFlP5m>N-L
z6mnee3ih&M?ps&a*YEX<4;fEYSBFBjsIpCdDoCAztjX9cH4fvWFfM7ZM<~i@A>Aph
zUg~z-hfA9hn~oMDGhE51%Bwe+QcN4Hzk@0J3@Z14GT72&QBmU!@4bik;>h87%rP}?
zT)vxPrINc-G5&1Kemcx_I1|lK5M*fGl2Yu+_mb`RJ#rM7RgbOJ^XHG+`^LuiVLC?*
zf<6V|eFXA;vOOMMPto8*Ggp^JN9r!B}yKVu|dTd%pmAn{n8_bZ$KQ
z`%EbRqwU*q4rc)uf`kUoL;!Sw;B2;CRW-zG)DJ>qJ}pC_bG1TUY6F>Hh$&cen?IzR
znFE3}eqKY}2iteX?vctq55dnYCd3;sAPV!qt2i?xL1c(kwLd0EX6rNDQ1R*
zn3*TUStUss@Vooc!XxdYB}-ahe|8>7`*1#Mx3#)?c6?jZ&&ojK@V%BR1?!deOQ<_W
zD_QB4_5*IYwTz1rs_(VYx(j-{3Ui?5g9dG)?<5j!bK|l9=_(oa4Og>oLCe-)VI8m%
zMPV*}7LM$>52Pu~aXm(MJ-c(D#ePZP5qJY*Hl+4Cp7e=pA7t`i=bnls>i*~_dqFF)
ziF2_xBO7Q|5$d1o74`$vJsZS@z4!DJht_PN^uc1p?%nxTE|5c3NI-GJ;C_D+ZC&6)Q2
zD_}-1f4;W1kC`H$iGhh+FJz*d7ntC`7~$|C`J>$~_|xjgoEvX~pNX8wOVRH_oHG*$
zb}lxB`JltZV$x7=;KOs%Dkn2$PG`*U(+7ov?IX+Aoou=>uB!eXgNcO>(%AwZlIdMZ
zuD*(6LY<%02P>*ZUk_nD1|R5amBv|{O`DyF{Uu!^jpdP=Gf}<{^m*jcF#sBKSsquv
z@7Cfp8lP4oncH?nJidwQrIFjlGh<>R*zA_eTUR7CJY>VWF$gV)Hg{mJo
zZs40n$SQ`7S!8hbkGAH|Ioi5SGUFjf>IGO&lh><{|0pY~3UPBhcBv-K0lrMvw&tmr?s$)=~
z&p`y*%$+tb9*_B1eXz80e1*a7P4I0aDDB;4YJJC?ow1*xFV7Owalnd<{sm0kf~+cQ
z-JmR-^}^~np~MENNMqw!_uY8(Jg<%qYHwGKc@`RcxeMYkhT~{He{LeWa#d|@vD2CS
z5dBu9=dQbO{2xCz9&dbN;>5yW()vL_@qfac?zdd^Mwio_SkT%E%i>Lr|2h(x9MW<*
z=X@gNAz(vS>WQ{g_bpWKa*Ta`d1Pi#7`F?iC&T1>8j~w0%n7@Z#VzJ8W|BXS4dPwG
zKU`M%(-Om6NaGl2(P&xM7MXG)BIfTILJakU<3lOcfiu}+Y|KTO_5&enLJ1VUyUe%=
zlY5_pp8*LPrf7(C%u(r_{xLtXZ5I~*rl0iA59sUc
!LhQGTXwI`?yAGdu#)7@kbx_{d(h5gnt#f`B1QGUO5d
z3!0Fp<@2x#$H9M-g>`Twy1&6r{v=cH{EDh8^Mzaizxovg@@O8YgAJs+K%9$r^8Fmv
zq#9bbs3)btc^ZlwuUE#or4`FF#PuNWW+XlG=pl>Z-8OMvXmI||DO(K~LuAm4K*GHE
z)|e9d+gQNscp$^HK+tKv7A`{lfq{BjDYh2o3qcXJq)dLC3=SEYP9R!x_;_rNGQSki
z-L7_DpchP@hRUMP
z^D*Me9NEy0zxL^}F;#xLUr5c~#i8;uR8Mbz%|^J)nd%h+FvVv=2nBwU3B~G+fc&eU
zJYv9()-D$mcittmyHJ_(rMB(c?ImT^6N>}p3($mCq3!bj16JN
zxBwHQ1cdAPXRbe1Zt9--JEQMjwR8K9xjSQja22}^McrgY3AWbdk&z>5lX%G4op{x)
zbavenlvizy$8NWUo~wmeM0Kb&J*E(+6i=HroEi*-0of(L(K({%8m06t5PAdUNg+l`
zsejyGWSK#CG7z&g+eQ=dCd|2sopc%Pr1jIMLyr8L$o2dy4Gy#M?x9AXUj!h>g#W!v
z+G=r8Ma9@WDV_vz6G`(hCnyyExx?N2bIBt}C%L6dxwCM#yujjYrlt9f(OtW;^QOxJ
zZtzO3=z2H}tkn}i25DN;a)E{Vb3ohg{%HI56h-!)uXFe^Z2C4Thc+@H<(U>;uJfh`OO>InrwV2|WEFVg_f9Nl8nAhCga#ch9nmP5+
zHS_DE|7&n($LR9vlU78=Uc5Xq=BB(z+cHDxr4UePAKtRa$b+;P{A}fkM6Y!RhXz_u
z@~PLFHWW6SDeV2;7VVcn!rkmm=gOTs{%RHkXKAh%px?O3)ML*?#!SOx`kg7n^9qRi
zG((i+Vu)bYIq*T3Kn1e_4eB&`Oj$u&T*N}V#4~;`55`o3-
z&y-C-pw$=8OqftYN2QgKv8$Pun*&n*36}X~lk*2nF0O#~7L#iE)%$=7XdHhmifXe#
z7GX>{+-towPeze;lVd@?f-!M!UgYfkfvdtpanM--#JO(WB6
zXqIsB-@<$@hBkh_2+n?s^IHqO_7AGzR;l75qR5{;m^2*jAURmoVSk;6pnzK5$>;E(Gs=))npP**A}y
z{>wlZG=V-e9elqV-|?tz^7)`*Qhz}W*>q?tOfChMX#!yoW@s)>Ow$Kw-Ho>w=`Ec>
z0Zz_U9=$0Rx@+Hs*4EN@z@q*|^aX+Va%&>C$z|^2IPRpifpbG@ee1G{F*7LTP9jHTcl9Nu%HCD0U58-l>+*C(n+@E|aEQ1yV7!{%3bs=DZKSD1lkbk4EF6M08oQ
zyr|L7>II?2TZZNci+zpb@D229Hh>laQ&rC;`-svRI1VS@;|bEYC6%MAt9yOX=<4b!
zhK$A>7GWSJ#b$GKDtRvk`?H_R5GCguT;2UlRn;&*3+quhesJ$&H$|bC=N=jknm_`5XB+54ZkM*AuupaUO_~Npi2csK(I6GWhs|_VDhLiNpQmZN}!<5Er1*H!e{#_^nlrGHm9%x}ZZ47!4ZBBt1xdHEp)6JKht26X4~Mep==yKAtQH<|@xn*a|+fF9(6b?(Rv98y7mMWVLeKlUYa4Ex)3OQdR=se~y_YSSJcd0;qz)aHTsk@exm6aG${KjD13-Qza^V1Bb
z*M+$8fyvzWCFgfy(G=c#M-ZxGFoE;G0gX&!uyf1Qpws23)AeG4*92(M2%91lXbw)+^Jh
z9qLOv{WTo6y#DBB0Q`9uM&vBfMrOuCv_k=jxA9>j;lMth2enJl59xA10U83WdxMQO}=0{qG9C1_y`aeXLSFXDi3qr8+vVRE}QR6NxnS
zTELOOit_4Hq~z6JIGTZEo9VjFPxS%a+KerWe4R;SW@vcP1lo$p-FyDT4ffL9cznx~
z6&2&L^Cu~e6S*Uq7WR8{8yXUK!VisY@0tNNy+nu-I14MZHv2#V-1V}Y>%j(`Xl
zdI#xP#+?kW?{{Q#=_up;j-uI0;HSQJ#
zkcxz=gvx}P_*{Wdo)AZfAw=O?55Y;uA!HLW2p0+e5Y7_*!sqjZ3!+3qDiId1D@%Bg
z(3;RhQfkEz%;6doo<=xFI7T>1*iSfubDk1agAx4~>E!A&erlg`#hU*a=k#-GN+qG%I@rVKYL0i3FkG>V)?R1B&Qe
z?*m34j4vW2!^=xVBZfq>IJeFw)DQ7JTp(Fj2$u;C95WD}V}MdnVz6m|N!#~?nS`|%
zyF?TZW-ZSr)GFk7th`jh3Bn=#{~ZJ>9ZZ@-ts4rqL&>p(+rY%{BqR{-!hD#_Rf7TO
zB%aWR&>M>Wgs>9#DN!&M`n^IbcMn447AQDaB6Ig(DO$jXt_ef>ff6<7L
z1gs`Z#(Zx15ZxQ0xpV=3&kH#Xq0#w2&6z#90igpS5viq;N%{2^VUmgQ+%gJYK>r^L
z@^_~RuM@sODC7o5SA<>0865Wm??7>ts|C%2