Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/generators/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
STRUCTURES_TO_GEN = ['VkExtent3D', 'VkExtent2D', 'VkPhysicalDeviceLimits', 'VkPhysicalDeviceFeatures', 'VkPhysicalDeviceSparseProperties',
'VkSurfaceCapabilitiesKHR', 'VkSurfaceFormatKHR', 'VkLayerProperties', 'VkPhysicalDeviceToolProperties', 'VkFormatProperties',
'VkSurfacePresentScalingCapabilitiesKHR', 'VkSurfacePresentModeCompatibilityKHR', 'VkPhysicalDeviceHostImageCopyProperties',
'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR']
'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR', 'VkCooperativeMatrixPropertiesKHR']
ENUMS_TO_GEN = ['VkResult', 'VkFormat', 'VkPresentModeKHR',
'VkPhysicalDeviceType', 'VkImageTiling']
'VkPhysicalDeviceType', 'VkImageTiling', 'VkTimeDomainKHR']
FLAGS_TO_GEN = ['VkSurfaceTransformFlagsKHR', 'VkCompositeAlphaFlagsKHR', 'VkSurfaceCounterFlagsEXT', 'VkQueueFlags',
'VkDeviceGroupPresentModeFlagsKHR', 'VkFormatFeatureFlags', 'VkFormatFeatureFlags2', 'VkMemoryPropertyFlags', 'VkMemoryHeapFlags']
FLAG_STRINGS_TO_GEN = ['VkQueueFlags']
Expand Down
101 changes: 101 additions & 0 deletions vulkaninfo/generated/vulkaninfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,50 @@ void DumpVkComponentSwizzle(Printer &p, std::string name, VkComponentSwizzle val
else
p.PrintKeyString(name, VkComponentSwizzleString(value));
}
std::string VkComponentTypeKHRString(VkComponentTypeKHR value) {
switch (value) {
case (VK_COMPONENT_TYPE_FLOAT16_KHR):
return "COMPONENT_TYPE_FLOAT16_KHR";
case (VK_COMPONENT_TYPE_FLOAT32_KHR):
return "COMPONENT_TYPE_FLOAT32_KHR";
case (VK_COMPONENT_TYPE_FLOAT64_KHR):
return "COMPONENT_TYPE_FLOAT64_KHR";
case (VK_COMPONENT_TYPE_SINT8_KHR):
return "COMPONENT_TYPE_SINT8_KHR";
case (VK_COMPONENT_TYPE_SINT16_KHR):
return "COMPONENT_TYPE_SINT16_KHR";
case (VK_COMPONENT_TYPE_SINT32_KHR):
return "COMPONENT_TYPE_SINT32_KHR";
case (VK_COMPONENT_TYPE_SINT64_KHR):
return "COMPONENT_TYPE_SINT64_KHR";
case (VK_COMPONENT_TYPE_UINT8_KHR):
return "COMPONENT_TYPE_UINT8_KHR";
case (VK_COMPONENT_TYPE_UINT16_KHR):
return "COMPONENT_TYPE_UINT16_KHR";
case (VK_COMPONENT_TYPE_UINT32_KHR):
return "COMPONENT_TYPE_UINT32_KHR";
case (VK_COMPONENT_TYPE_UINT64_KHR):
return "COMPONENT_TYPE_UINT64_KHR";
case (VK_COMPONENT_TYPE_BFLOAT16_KHR):
return "COMPONENT_TYPE_BFLOAT16_KHR";
case (VK_COMPONENT_TYPE_SINT8_PACKED_NV):
return "COMPONENT_TYPE_SINT8_PACKED_NV";
case (VK_COMPONENT_TYPE_UINT8_PACKED_NV):
return "COMPONENT_TYPE_UINT8_PACKED_NV";
case (VK_COMPONENT_TYPE_FLOAT8_E4M3_EXT):
return "COMPONENT_TYPE_FLOAT8_E4M3_EXT";
case (VK_COMPONENT_TYPE_FLOAT8_E5M2_EXT):
return "COMPONENT_TYPE_FLOAT8_E5M2_EXT";
default:
return std::string("UNKNOWN_VkComponentTypeKHR_value") + std::to_string(value);
}
}
void DumpVkComponentTypeKHR(Printer &p, std::string name, VkComponentTypeKHR value) {
if (p.Type() == OutputType::json)
p.PrintKeyString(name, std::string("VK_") + VkComponentTypeKHRString(value));
else
p.PrintKeyString(name, VkComponentTypeKHRString(value));
}
std::string VkDefaultVertexAttributeValueKHRString(VkDefaultVertexAttributeValueKHR value) {
switch (value) {
case (VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHR):
Expand Down Expand Up @@ -2072,6 +2116,26 @@ void DumpVkResult(Printer &p, std::string name, VkResult value) {
else
p.PrintKeyString(name, VkResultString(value));
}
std::string VkScopeKHRString(VkScopeKHR value) {
switch (value) {
case (VK_SCOPE_DEVICE_KHR):
return "SCOPE_DEVICE_KHR";
case (VK_SCOPE_WORKGROUP_KHR):
return "SCOPE_WORKGROUP_KHR";
case (VK_SCOPE_SUBGROUP_KHR):
return "SCOPE_SUBGROUP_KHR";
case (VK_SCOPE_QUEUE_FAMILY_KHR):
return "SCOPE_QUEUE_FAMILY_KHR";
default:
return std::string("UNKNOWN_VkScopeKHR_value") + std::to_string(value);
}
}
void DumpVkScopeKHR(Printer &p, std::string name, VkScopeKHR value) {
if (p.Type() == OutputType::json)
p.PrintKeyString(name, std::string("VK_") + VkScopeKHRString(value));
else
p.PrintKeyString(name, VkScopeKHRString(value));
}
std::string VkShaderFloatControlsIndependenceString(VkShaderFloatControlsIndependence value) {
switch (value) {
case (VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY):
Expand All @@ -2090,6 +2154,30 @@ void DumpVkShaderFloatControlsIndependence(Printer &p, std::string name, VkShade
else
p.PrintKeyString(name, VkShaderFloatControlsIndependenceString(value));
}
std::string VkTimeDomainKHRString(VkTimeDomainKHR value) {
switch (value) {
case (VK_TIME_DOMAIN_DEVICE_KHR):
return "TIME_DOMAIN_DEVICE_KHR";
case (VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR):
return "TIME_DOMAIN_CLOCK_MONOTONIC_KHR";
case (VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR):
return "TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR";
case (VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR):
return "TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR";
case (VK_TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT):
return "TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT";
case (VK_TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT):
return "TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT";
default:
return std::string("UNKNOWN_VkTimeDomainKHR_value") + std::to_string(value);
}
}
void DumpVkTimeDomainKHR(Printer &p, std::string name, VkTimeDomainKHR value) {
if (p.Type() == OutputType::json)
p.PrintKeyString(name, std::string("VK_") + VkTimeDomainKHRString(value));
else
p.PrintKeyString(name, VkTimeDomainKHRString(value));
}
std::string VkVideoEncodeTuningModeKHRString(VkVideoEncodeTuningModeKHR value) {
switch (value) {
case (VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR):
Expand Down Expand Up @@ -4254,6 +4342,19 @@ void DumpVkConformanceVersion(Printer &p, std::string name, const VkConformanceV
p.PrintKeyValue("subminor", static_cast<uint32_t>(obj.subminor));
p.PrintKeyValue("patch", static_cast<uint32_t>(obj.patch));
}
void DumpVkCooperativeMatrixPropertiesKHR(Printer &p, std::string name, const VkCooperativeMatrixPropertiesKHR &obj) {
ObjectWrapper object{p, name};
p.SetMinKeyWidth(22);
p.PrintKeyValue("MSize", obj.MSize);
p.PrintKeyValue("NSize", obj.NSize);
p.PrintKeyValue("KSize", obj.KSize);
DumpVkComponentTypeKHR(p, "AType", obj.AType);
DumpVkComponentTypeKHR(p, "BType", obj.BType);
DumpVkComponentTypeKHR(p, "CType", obj.CType);
DumpVkComponentTypeKHR(p, "ResultType", obj.ResultType);
p.PrintKeyBool("saturatingAccumulation", static_cast<bool>(obj.saturatingAccumulation));
DumpVkScopeKHR(p, "scope", obj.scope);
}
void DumpVkDrmFormatModifierProperties2EXT(Printer &p, std::string name, const VkDrmFormatModifierProperties2EXT &obj) {
ObjectWrapper object{p, name};
p.SetMinKeyWidth(27);
Expand Down
32 changes: 32 additions & 0 deletions vulkaninfo/vulkaninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,33 @@ void GpuDumpToolingInfo(Printer &p, AppGpu &gpu) {
}
}

void GpuDumpCooperativeMatrix(Printer &p, AppGpu &gpu) {
auto props = GetCooperativeMatrixInfo(gpu);
if (props.size() > 0) {
p.SetSubHeader();
ObjectWrapper obj(p, "vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR");
for (const auto prop : props) {
DumpVkCooperativeMatrixPropertiesKHR(p, "VkCooperativeMatrixPropertiesKHR", prop);
p.AddNewline();
}
}
}

void GpuDumpCalibrateableTimeDomain(Printer &p, AppGpu &gpu) {
auto props = GetTimeDomainInfo(gpu);
if (props.size() > 0) {
p.SetSubHeader();
ObjectWrapper obj_mem_props(p, "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR");
{
for (uint32_t i = 0; i < props.size(); ++i) {
p.SetElementIndex(static_cast<int>(i));
DumpVkTimeDomainKHR(p, "pTimeDomains", props[i]);
p.AddNewline();
}
}
}
}

void GpuDevDump(Printer &p, AppGpu &gpu) {
p.SetHeader();
ObjectWrapper obj_format_props(p, "Format Properties");
Expand Down Expand Up @@ -735,6 +762,11 @@ void DumpGpu(Printer &p, AppGpu &gpu, const ShowSettings &show) {
GpuDumpToolingInfo(p, gpu);
}

if (show.all) {
GpuDumpCooperativeMatrix(p, gpu);
GpuDumpCalibrateableTimeDomain(p, gpu);
}

if (p.Type() != OutputType::text || show.formats) {
GpuDevDump(p, gpu);
}
Expand Down
11 changes: 11 additions & 0 deletions vulkaninfo/vulkaninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,17 @@ std::vector<VkPhysicalDeviceToolPropertiesEXT> GetToolingInfo(AppGpu &gpu) {
vkGetPhysicalDeviceToolPropertiesEXT, gpu.phys_device);
}

std::vector<VkCooperativeMatrixPropertiesKHR> GetCooperativeMatrixInfo(AppGpu &gpu) {
if (vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR == nullptr) return {};
return GetVector<VkCooperativeMatrixPropertiesKHR>("vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR",
vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, gpu.phys_device);
}
std::vector<VkTimeDomainKHR> GetTimeDomainInfo(AppGpu &gpu) {
if (vkGetPhysicalDeviceCalibrateableTimeDomainsKHR == nullptr) return {};
return GetVector<VkTimeDomainKHR>("vkGetPhysicalDeviceCalibrateableTimeDomainsKHR",
vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, gpu.phys_device);
}

// --------- Format Properties ----------//
// can't use autogen because that is put in a header that we can't include because that header depends on stuff defined here
bool operator==(const VkFormatProperties &a, const VkFormatProperties b) {
Expand Down
4 changes: 4 additions & 0 deletions vulkaninfo/vulkaninfo_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT;
PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR;
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR;
PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR vkGetPhysicalDeviceCalibrateableTimeDomainsKHR;

// Device functions
PFN_vkCreateImage vkCreateImage;
Expand Down Expand Up @@ -243,6 +245,8 @@ static void load_vulkan_instance_functions(VkInstance instance) {
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceSurfaceCapabilities2EXT);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceToolPropertiesEXT);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceFormatProperties2KHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceCalibrateableTimeDomainsKHR);

// Load device functions using vkGetInstanceProcAddr, vulkaninfo doesn't care about the extra indirection it causes
LOAD_INSTANCE_FUNCTION(instance, vkCreateImage);
Expand Down
Loading