Skip to content
Closed
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
2 changes: 1 addition & 1 deletion scripts/generators/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
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']
FLAGS_TO_GEN = ['VkSurfaceTransformFlagsKHR', 'VkCompositeAlphaFlagsKHR', 'VkSurfaceCounterFlagsEXT', 'VkQueueFlags',
Expand Down
55 changes: 55 additions & 0 deletions vulkaninfo/generated/vulkaninfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,33 @@ 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): return "DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHR";
Expand Down Expand Up @@ -1272,6 +1299,21 @@ 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): return "SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY";
Expand Down Expand Up @@ -3114,6 +3156,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
14 changes: 14 additions & 0 deletions vulkaninfo/vulkaninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,18 @@ 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, "Cooperative Matrix");
for (const auto prop : props) {
DumpVkCooperativeMatrixPropertiesKHR(p, "VkCooperativeMatrixPropertiesKHR", prop);
p.AddNewline();
}
}
}

void GpuDevDump(Printer &p, AppGpu &gpu) {
p.SetHeader();
ObjectWrapper obj_format_props(p, "Format Properties");
Expand Down Expand Up @@ -728,6 +740,8 @@ void DumpGpu(Printer &p, AppGpu &gpu, bool show_tooling_info, bool show_formats,
GpuDumpToolingInfo(p, gpu);
}

GpuDumpCooperativeMatrix(p, gpu);

if (p.Type() != OutputType::text || show_formats) {
GpuDevDump(p, gpu);
}
Expand Down
6 changes: 6 additions & 0 deletions vulkaninfo/vulkaninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,12 @@ 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);
}

// --------- 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
2 changes: 2 additions & 0 deletions vulkaninfo/vulkaninfo_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT;
PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR;
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR;

// Device functions
PFN_vkCreateImage vkCreateImage;
Expand Down Expand Up @@ -243,6 +244,7 @@ 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 device functions using vkGetInstanceProcAddr, vulkaninfo doesn't care about the extra indirection it causes
LOAD_INSTANCE_FUNCTION(instance, vkCreateImage);
Expand Down
Loading