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
3 changes: 2 additions & 1 deletion scripts/generators/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
STRUCTURES_TO_GEN = ['VkExtent3D', 'VkExtent2D', 'VkPhysicalDeviceLimits', 'VkPhysicalDeviceFeatures', 'VkPhysicalDeviceSparseProperties',
'VkSurfaceCapabilitiesKHR', 'VkSurfaceFormatKHR', 'VkLayerProperties', 'VkPhysicalDeviceToolProperties', 'VkFormatProperties',
'VkSurfacePresentScalingCapabilitiesKHR', 'VkSurfacePresentModeCompatibilityKHR', 'VkPhysicalDeviceHostImageCopyProperties',
'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR', 'VkCooperativeMatrixPropertiesKHR']
'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR', 'VkCooperativeMatrixPropertiesKHR',
'VkPhysicalDeviceFragmentShadingRateKHR', 'VkMultisamplePropertiesEXT']
ENUMS_TO_GEN = ['VkResult', 'VkFormat', 'VkPresentModeKHR',
'VkPhysicalDeviceType', 'VkImageTiling', 'VkTimeDomainKHR']
FLAGS_TO_GEN = ['VkSurfaceTransformFlagsKHR', 'VkCompositeAlphaFlagsKHR', 'VkSurfaceCounterFlagsEXT', 'VkQueueFlags',
Expand Down
9 changes: 9 additions & 0 deletions vulkaninfo/generated/vulkaninfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4468,6 +4468,10 @@ void DumpVkLayerProperties(Printer &p, std::string name, const VkLayerProperties
p.PrintKeyValue("implementationVersion", obj.implementationVersion);
p.PrintKeyString("description", obj.description);
}
void DumpVkMultisamplePropertiesEXT(Printer &p, std::string name, const VkMultisamplePropertiesEXT &obj) {
ObjectWrapper object{p, name};
DumpVkExtent2D(p, "maxSampleLocationGridSize", obj.maxSampleLocationGridSize);
}
void DumpVkOffset2D(Printer &p, std::string name, const VkOffset2D &obj) {
ObjectWrapper object{p, name};
p.SetMinKeyWidth(1);
Expand Down Expand Up @@ -5141,6 +5145,11 @@ void DumpVkPhysicalDeviceFragmentShadingRateFeaturesKHR(Printer &p, std::string
p.PrintKeyBool("primitiveFragmentShadingRate", static_cast<bool>(obj.primitiveFragmentShadingRate));
p.PrintKeyBool("attachmentFragmentShadingRate", static_cast<bool>(obj.attachmentFragmentShadingRate));
}
void DumpVkPhysicalDeviceFragmentShadingRateKHR(Printer &p, std::string name, const VkPhysicalDeviceFragmentShadingRateKHR &obj) {
ObjectWrapper object{p, name};
DumpVkSampleCountFlags(p, "sampleCounts", obj.sampleCounts);
DumpVkExtent2D(p, "fragmentSize", obj.fragmentSize);
}
void DumpVkPhysicalDeviceFragmentShadingRatePropertiesKHR(Printer &p, std::string name,
const VkPhysicalDeviceFragmentShadingRatePropertiesKHR &obj) {
ObjectWrapper object{p, name};
Expand Down
30 changes: 30 additions & 0 deletions vulkaninfo/vulkaninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*
*/

#include <string>
#ifdef _WIN32
#include <crtdbg.h>
#endif
Expand Down Expand Up @@ -618,6 +619,33 @@ void GpuDumpCalibrateableTimeDomain(Printer &p, AppGpu &gpu) {
}
}

void GpuDumpFragmentShadingRate(Printer &p, AppGpu &gpu) {
auto props = GetFragmentShadingRateInfo(gpu);
if (props.size() > 0) {
p.SetSubHeader();
ObjectWrapper obj(p, "vkGetPhysicalDeviceFragmentShadingRatesKHR");
for (const auto prop : props) {
DumpVkPhysicalDeviceFragmentShadingRateKHR(p, "VkPhysicalDeviceFragmentShadingRateKHR", prop);
p.AddNewline();
}
}
}

// VK_EXT_sample_locations ('Multisample Properties' is too ambiguous of a name)
void GpuDumpSampleLocations(Printer &p, AppGpu &gpu) {
auto props = GetSampleLocationInfo(gpu);
if (props.size() > 0) {
p.SetSubHeader();
ObjectWrapper obj(p, "vkGetPhysicalDeviceMultisamplePropertiesEXT");
for (uint32_t i = 0; i < props.size(); i++) {
const VkSampleCountFlagBits sample_count = (VkSampleCountFlagBits)(1 << i);
DumpVkSampleCountFlagBits(p, "samples", sample_count);
DumpVkMultisamplePropertiesEXT(p, "VkMultisamplePropertiesEXT", props[i]);
p.AddNewline();
}
}
}

void GpuDevDump(Printer &p, AppGpu &gpu) {
p.SetHeader();
ObjectWrapper obj_format_props(p, "Format Properties");
Expand Down Expand Up @@ -765,6 +793,8 @@ void DumpGpu(Printer &p, AppGpu &gpu, const ShowSettings &show) {
if (show.all) {
GpuDumpCooperativeMatrix(p, gpu);
GpuDumpCalibrateableTimeDomain(p, gpu);
GpuDumpFragmentShadingRate(p, gpu);
GpuDumpSampleLocations(p, gpu);
}

if (p.Type() != OutputType::text || show.formats) {
Expand Down
19 changes: 19 additions & 0 deletions vulkaninfo/vulkaninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <algorithm>
#include <array>
#include <cstdint>
#include <exception>
#include <iostream>
#include <fstream>
Expand Down Expand Up @@ -1896,6 +1897,24 @@ std::vector<VkTimeDomainKHR> GetTimeDomainInfo(AppGpu &gpu) {
return GetVector<VkTimeDomainKHR>("vkGetPhysicalDeviceCalibrateableTimeDomainsKHR",
vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, gpu.phys_device);
}
std::vector<VkPhysicalDeviceFragmentShadingRateKHR> GetFragmentShadingRateInfo(AppGpu &gpu) {
if (vkGetPhysicalDeviceFragmentShadingRatesKHR == nullptr) return {};
return GetVector<VkPhysicalDeviceFragmentShadingRateKHR>("vkGetPhysicalDeviceFragmentShadingRatesKHR",
vkGetPhysicalDeviceFragmentShadingRatesKHR, gpu.phys_device);
}
// Returns vector where each index maps to VkSampleCountFlagBits
std::vector<VkMultisamplePropertiesEXT> GetSampleLocationInfo(AppGpu &gpu) {
if (vkGetPhysicalDeviceMultisamplePropertiesEXT == nullptr) return {};
std::vector<VkMultisamplePropertiesEXT> result;
// 7 covers VK_SAMPLE_COUNT_1_BIT to 64_BIT
for (uint32_t i = 0; i < 7; i++) {
const VkSampleCountFlagBits sample_count = (VkSampleCountFlagBits)(1 << i);
VkMultisamplePropertiesEXT props = {VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT, nullptr};
vkGetPhysicalDeviceMultisamplePropertiesEXT(gpu.phys_device, sample_count, &props);
result.emplace_back(props);
}
return result;
}

// --------- 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
Expand Down
4 changes: 4 additions & 0 deletions vulkaninfo/vulkaninfo_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT;
PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR;
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR;
PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR vkGetPhysicalDeviceCalibrateableTimeDomainsKHR;
PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR vkGetPhysicalDeviceFragmentShadingRatesKHR;
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT;

// Device functions
PFN_vkCreateImage vkCreateImage;
Expand Down Expand Up @@ -247,6 +249,8 @@ static void load_vulkan_instance_functions(VkInstance instance) {
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceFormatProperties2KHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceCalibrateableTimeDomainsKHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceFragmentShadingRatesKHR);
LOAD_INSTANCE_FUNCTION(instance, vkGetPhysicalDeviceMultisamplePropertiesEXT);

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