From 67df989fb096b88e9318491bd9a917444284b1c7 Mon Sep 17 00:00:00 2001 From: Jeremy Kniager Date: Mon, 7 Jan 2019 13:27:24 -0700 Subject: [PATCH] vulkaninfo: Add VK_EXT_fragment_density_map Added output for the following structures from extension VK_EXT_fragment_density_map: VkPhysicalDeviceFragmentDensityMapFeaturesEXT VkPhysicalDeviceFragmentDensityMapPropertiesEXT Change-Id: I6d9a09a3a1bf889c5e44ac0eff66cdcf572f7b19 --- vulkaninfo/vulkaninfo.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/vulkaninfo/vulkaninfo.c b/vulkaninfo/vulkaninfo.c index b9d8c63..cf6cf5e 100644 --- a/vulkaninfo/vulkaninfo.c +++ b/vulkaninfo/vulkaninfo.c @@ -995,7 +995,9 @@ static void AppGpuInit(struct AppGpu *gpu, struct AppInstance *inst, uint32_t id {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT, .mem_size = sizeof(VkPhysicalDevicePCIBusInfoPropertiesEXT)}, {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT, - .mem_size = sizeof(VkPhysicalDeviceTransformFeedbackPropertiesEXT)}}; + .mem_size = sizeof(VkPhysicalDeviceTransformFeedbackPropertiesEXT)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT, + .mem_size = sizeof(VkPhysicalDeviceFragmentDensityMapPropertiesEXT)}}; uint32_t chain_info_len = ARRAY_SIZE(chain_info); @@ -1101,7 +1103,9 @@ static void AppGpuInit(struct AppGpu *gpu, struct AppInstance *inst, uint32_t id {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, .mem_size = sizeof(VkPhysicalDeviceTransformFeedbackFeaturesEXT)}, {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT, - .mem_size = sizeof(VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)}}; + .mem_size = sizeof(VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)}, + {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT, + .mem_size = sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT)}}; uint32_t chain_info_len = ARRAY_SIZE(chain_info); @@ -2367,6 +2371,21 @@ static void AppGpuDumpFeatures(const struct AppGpu *gpu, FILE *out) { printf("==========================================\n"); printf("\tscalarBlockLayout = %" PRIuLEAST32 "\n", scalar_block_layout_features->scalarBlockLayout); } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT && CheckPhysicalDeviceExtensionIncluded(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceFragmentDensityMapFeaturesEXT *fragment_density_map_features = (VkPhysicalDeviceFragmentDensityMapFeaturesEXT*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceFragmentDensityMapFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
fragmentDensityMap =
%" PRIuLEAST32 "
\n", fragment_density_map_features->fragmentDensityMap); + fprintf(out, "\t\t\t\t\t\t
fragmentDensityMapDynamic =
%" PRIuLEAST32 "
\n", fragment_density_map_features->fragmentDensityMapDynamic); + fprintf(out, "\t\t\t\t\t\t
fragmentDensityMapNonSubsampledImages =
%" PRIuLEAST32 "
\n", fragment_density_map_features->fragmentDensityMapNonSubsampledImages); + } + else if (human_readable_output) { + printf("\nVkPhysicalDeviceFragmentDensityMapFeatures:\n"); + printf("==========================================\n"); + printf("\tfragmentDensityMap = %" PRIuLEAST32 "\n", fragment_density_map_features->fragmentDensityMap); + printf("\tfragmentDensityMapDynamic = %" PRIuLEAST32 "\n", fragment_density_map_features->fragmentDensityMapDynamic); + printf("\tfragmentDensityMapNonSubsampledImages = %" PRIuLEAST32 "\n", fragment_density_map_features->fragmentDensityMapNonSubsampledImages); + } } place = structure->pNext; } @@ -3152,6 +3171,28 @@ static void AppGpuDumpProps(const struct AppGpu *gpu, FILE *out) { printf("\ttransformFeedbackRasterizationStreamSelect = %" PRIuLEAST32 "\n", transform_feedback_properties->transformFeedbackRasterizationStreamSelect); printf("\ttransformFeedbackDraw = %" PRIuLEAST32 "\n", transform_feedback_properties->transformFeedbackDraw); } + } else if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT && CheckPhysicalDeviceExtensionIncluded(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, gpu->device_extensions, gpu->device_extension_count)) { + VkPhysicalDeviceFragmentDensityMapPropertiesEXT *fragment_density_map_properties = (VkPhysicalDeviceFragmentDensityMapPropertiesEXT*)structure; + if (html_output) { + fprintf(out, "\n\t\t\t\t\t
VkPhysicalDeviceFragmentDensityMapProperties\n"); + fprintf(out, "\t\t\t\t\t\t
minFragmentDensityTexelSize\n"); + fprintf(out, "\t\t\t\t\t\t\t
width =
%" PRIuLEAST32 "
\n", fragment_density_map_properties->minFragmentDensityTexelSize.width); + fprintf(out, "\t\t\t\t\t\t\t
height =
%" PRIuLEAST32 "
\n", fragment_density_map_properties->minFragmentDensityTexelSize.height); + fprintf(out, "\t\t\t\t\t\t
maxFragmentDensityTexelSize\n"); + fprintf(out, "\t\t\t\t\t\t\t
width =
%" PRIuLEAST32 "
\n", fragment_density_map_properties->maxFragmentDensityTexelSize.width); + fprintf(out, "\t\t\t\t\t\t\t
height =
%" PRIuLEAST32 "
\n", fragment_density_map_properties->maxFragmentDensityTexelSize.height); + fprintf(out, "\t\t\t\t\t\t
fragmentDensityInvocations =
%" PRIuLEAST32 "
\n", fragment_density_map_properties->fragmentDensityInvocations); + } else if (human_readable_output) { + printf("\nVkPhysicalDeviceFragmentDensityMapProperties\n"); + printf("============================================\n"); + printf("\tminFragmentDensityTexelSize\n"); + printf("\t\twidth = %" PRIuLEAST32 "\n", fragment_density_map_properties->minFragmentDensityTexelSize.width); + printf("\t\theight = %" PRIuLEAST32 "\n", fragment_density_map_properties->minFragmentDensityTexelSize.height); + printf("\tmaxFragmentDensityTexelSize\n"); + printf("\t\twidth = %" PRIuLEAST32 "\n", fragment_density_map_properties->maxFragmentDensityTexelSize.width); + printf("\t\theight = %" PRIuLEAST32 "\n", fragment_density_map_properties->maxFragmentDensityTexelSize.height); + printf("\tfragmentDensityInvocations = %" PRIuLEAST32 "\n", fragment_density_map_properties->fragmentDensityInvocations); + } } place = structure->pNext; } -- 2.7.4