From: Shannon McPherson Date: Wed, 20 Sep 2017 21:53:07 +0000 (-0600) Subject: demos: Add html backend and option to vulkaninfo X-Git-Tag: submit/tizen/20181227.054638~683 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03082b77aeb3c8661ca9b74c603da7b03037ab38;p=platform%2Fupstream%2FVulkan-Tools.git demos: Add html backend and option to vulkaninfo - Run clang-format on vulkaninfo.c - Format Instance Extensions section - Complete Layers info tree - Convert spaces to tabs for html output - Fix indentation of html output file - Add Presentable Surfaces to html option - Ammend Presentable Surfaces html output - Extend platform compatibility - Display VkPhysicalDeviceProps in html - Convert DeviceLims and SparseProps to html - Convert memoryType/flags to support html - Complete AppGpuDumpMemProps html upgrade - Complete format properties html upgrade - Improve boolean logic for html_output var - Change output filename to vulkaninfo.html - Create auto-open format property flag info - Update page title, further .html fixes - WIN32 formatting and bug fixes - Clang-format changes - Close clang-format comments - Update file format to code style standard Change-Id: I49c7c6c62a54493fe622bd457f7c61e81806487e --- diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index 5d54698e..e631dca6 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -20,6 +20,7 @@ * Author: Mark Lobodzinski * Author: Rene Lindsay * Author: Jeremy Kniager + * Author: Shannon McPherson */ #ifdef __GNUC__ @@ -57,7 +58,7 @@ #ifdef _WIN32 #define snprintf _snprintf -#define strdup _strdup +#define strdup _strdup // Returns nonzero if the console is used only for this process. Will return // zero if another process (such as cmd.exe) is also attached. @@ -94,6 +95,8 @@ static int ConsoleIsExclusive(void) { #define MAX_QUEUE_TYPES 5 #define APP_SHORT_NAME "vulkaninfo" +static bool html_output; + struct VkStructureHeader { VkStructureType sType; void *pNext; @@ -633,10 +636,112 @@ static void AppGetInstanceExtensions(struct AppInstance *inst) { AppGetGlobalLayerExtensions(NULL, &inst->global_extension_count, &inst->global_extensions); } +// Prints opening CSS and HTML code for html output file +// Defines various div text styles +void PrintHtmlHeader(FILE *out) { + fprintf(out, "\n"); + fprintf(out, "\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\tVulkan Info\n"); + fprintf(out, "\t\t\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\n"); + fprintf(out, "\t\t\n"); + fprintf(out, "\t\t
\n"); +} + +// Prints closing HTML code for html output file +void PrintHtmlFooter(FILE *out) { + fprintf(out, "\t\t
\n"); + fprintf(out, "\t\n"); + fprintf(out, ""); +} + +// static void AppCreateInstance(struct AppInstance *inst, int argc, ...) { static void AppCreateInstance(struct AppInstance *inst) { AppGetInstanceExtensions(inst); -//---Build a list of extensions to load--- + //---Build a list of extensions to load--- const char *info_instance_extensions[] = {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, @@ -706,27 +811,27 @@ static void AppCreateInstance(struct AppInstance *inst) { } inst->vkGetPhysicalDeviceSurfaceSupportKHR = - (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); + (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); inst->vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); + inst->instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); inst->vkGetPhysicalDeviceSurfaceFormatsKHR = - (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceFormatsKHR"); + (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceFormatsKHR"); inst->vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceSurfacePresentModesKHR"); + inst->instance, "vkGetPhysicalDeviceSurfacePresentModesKHR"); inst->vkGetPhysicalDeviceProperties2KHR = - (PFN_vkGetPhysicalDeviceProperties2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceProperties2KHR"); + (PFN_vkGetPhysicalDeviceProperties2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceProperties2KHR"); inst->vkGetPhysicalDeviceFormatProperties2KHR = (PFN_vkGetPhysicalDeviceFormatProperties2KHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceFormatProperties2KHR"); + inst->instance, "vkGetPhysicalDeviceFormatProperties2KHR"); inst->vkGetPhysicalDeviceQueueFamilyProperties2KHR = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); + inst->instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); inst->vkGetPhysicalDeviceFeatures2KHR = - (PFN_vkGetPhysicalDeviceFeatures2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceFeatures2KHR"); + (PFN_vkGetPhysicalDeviceFeatures2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceFeatures2KHR"); inst->vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2KHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceMemoryProperties2KHR"); + inst->instance, "vkGetPhysicalDeviceMemoryProperties2KHR"); inst->vkGetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR"); + inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR"); inst->vkGetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)vkGetInstanceProcAddr( - inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); + inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); } //----------------------------------------------------------- @@ -737,7 +842,7 @@ static void AppDestroyInstance(struct AppInstance *inst) { free(inst->global_layers[i].extension_properties); } free(inst->global_layers); - free((char**)inst->inst_extensions); + free((char **)inst->inst_extensions); vkDestroyInstance(inst->instance, NULL); } @@ -1034,7 +1139,7 @@ static void AppDestroyXlibWindow(struct AppInstance *inst) { #if defined(VK_USE_PLATFORM_XCB_KHR) || \ defined(VK_USE_PLATFORM_XLIB_KHR) || \ defined(VK_USE_PLATFORM_WIN32_KHR) -static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu){ +static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu, FILE *out){ // Get the list of VkFormat's that are supported: VkResult U_ASSERT_ONLY err; uint32_t format_count = 0; @@ -1046,18 +1151,34 @@ static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu){ ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); err = inst->vkGetPhysicalDeviceSurfaceFormatsKHR(gpu->obj, inst->surface, &format_count, surf_formats); assert(!err); - printf("Formats:\t\tcount = %d\n", format_count); + + if (html_output) { + fprintf(out, "\t\t\t\t
Formats: count =
%d
", format_count); + if (format_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
\n"); + } + } else { + printf("Formats:\t\tcount = %d\n", format_count); + } for (uint32_t i = 0; i < format_count; i++) { - printf("\t%s\n", VkFormatString(surf_formats[i].format)); + if (html_output) { + fprintf(out, "\t\t\t\t\t
%s
\n", + VkFormatString(surf_formats[i].format)); + } else { + printf("\t%s\n", VkFormatString(surf_formats[i].format)); + } } - fflush(stdout); + if (html_output && format_count > 0) fprintf(out, "\t\t\t\t\n"); + fflush(out); free(surf_formats); return format_count; } -static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *gpu) { +static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) { // Get the list of VkPresentMode's that are supported: VkResult U_ASSERT_ONLY err; uint32_t present_mode_count = 0; @@ -1069,75 +1190,210 @@ static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *g ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, inst->surface, &present_mode_count, surf_present_modes); assert(!err); - printf("Present Modes:\t\tcount = %d\n", present_mode_count); + + if (html_output) { + fprintf(out, "\t\t\t\t
Present Modes: count =
%d
", present_mode_count); + if (present_mode_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
"); + } + } else { + printf("Present Modes:\t\tcount = %d\n", present_mode_count); + } for (uint32_t i = 0; i < present_mode_count; i++) { - printf("\t%s\n", VkPresentModeString(surf_present_modes[i])); + if (html_output) { + fprintf(out, "\t\t\t\t\t
%s
\n", + VkPresentModeString(surf_present_modes[i])); + } else { + printf("\t%s\n", VkPresentModeString(surf_present_modes[i])); + } } - printf("\n"); - fflush(stdout); + if (html_output && present_mode_count > 0) fprintf(out, "\t\t\t\t\n"); + fflush(out); free(surf_present_modes); return present_mode_count; } -static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu *gpu) { +static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) { if (CheckExtensionEnabled(VK_KHR_SURFACE_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { - inst->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(gpu->obj, inst->surface, &inst->surface_capabilities); - printf("\nVkSurfaceCapabilitiesKHR:\n"); - printf("=========================\n\n"); - printf("\tminImageCount = %u\n", inst->surface_capabilities.minImageCount); - printf("\tmaxImageCount = %u\n", inst->surface_capabilities.maxImageCount); - printf("\tcurrentExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.currentExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.currentExtent.height); - printf("\tminImageExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.minImageExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.minImageExtent.height); - printf("\tmaxImageExtent:\n"); - printf("\t\twidth = %u\n", inst->surface_capabilities.maxImageExtent.width); - printf("\t\theight = %u\n", inst->surface_capabilities.maxImageExtent.height); - printf("\tmaxImageArrayLayers = %u\n", inst->surface_capabilities.maxImageArrayLayers); - printf("\tsupportedTransform:\n"); - if (inst->surface_capabilities.supportedTransforms == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } - printf("\tcurrentTransform:\n"); - if (inst->surface_capabilities.currentTransform == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } - else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } - printf("\tsupportedCompositeAlpha:\n"); - if (inst->surface_capabilities.supportedCompositeAlpha == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR\n"); } - if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_INHERIT_BIT_KHR\n"); } - printf("\tsupportedUsageFlags:\n"); - if (inst->surface_capabilities.supportedUsageFlags == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } - if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t
VkSurfaceCapabilitiesKHR\n"); + fprintf(out, "\t\t\t\t\t
minImageCount =
%u
\n", inst->surface_capabilities.minImageCount); + fprintf(out, "\t\t\t\t\t
maxImageCount =
%u
\n", inst->surface_capabilities.maxImageCount); + fprintf(out, "\t\t\t\t\t
currentExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.currentExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.currentExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
minImageExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.minImageExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.minImageExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
maxImageExtent\n"); + fprintf(out, "\t\t\t\t\t\t
width =
%u
\n", inst->surface_capabilities.maxImageExtent.width); + fprintf(out, "\t\t\t\t\t\t
height =
%u
\n", inst->surface_capabilities.maxImageExtent.height); + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
maxImageArrayLayers =
%u
\n", inst->surface_capabilities.maxImageArrayLayers); + fprintf(out, "\t\t\t\t\t
supportedTransform\n"); + if (inst->surface_capabilities.supportedTransforms == 0) { fprintf(out, "\t\t\t\t\t\t
None
\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
currentTransform\n"); + if (inst->surface_capabilities.currentTransform == 0) { fprintf(out, "\t\t\t\t\t\t
None
\n"); } + if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { + fprintf(out, "\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
\n"); + } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
supportedCompositeAlpha\n"); + if (inst->surface_capabilities.supportedCompositeAlpha == 0) { fprintf(out, "\t\t\t\t\t\t
None
\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
\n"); + } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { + fprintf(out, "\t\t\t\t\t\t
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
supportedUsageFlags\n"); + if (inst->surface_capabilities.supportedUsageFlags == 0) { fprintf(out, "\t\t\t\t\t\t
None
\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_DST_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_SAMPLED_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_STORAGE_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
\n"); + } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
\n"); + } + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\nVkSurfaceCapabilitiesKHR:\n"); + printf("=========================\n"); + printf("\tminImageCount = %u\n", inst->surface_capabilities.minImageCount); + printf("\tmaxImageCount = %u\n", inst->surface_capabilities.maxImageCount); + printf("\tcurrentExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.currentExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.currentExtent.height); + printf("\tminImageExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.minImageExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.minImageExtent.height); + printf("\tmaxImageExtent:\n"); + printf("\t\twidth = %u\n", inst->surface_capabilities.maxImageExtent.width); + printf("\t\theight = %u\n", inst->surface_capabilities.maxImageExtent.height); + printf("\tmaxImageArrayLayers = %u\n", inst->surface_capabilities.maxImageArrayLayers); + printf("\tsupportedTransform:\n"); + if (inst->surface_capabilities.supportedTransforms == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } + printf("\tcurrentTransform:\n"); + if (inst->surface_capabilities.currentTransform == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); } + else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); } + printf("\tsupportedCompositeAlpha:\n"); + if (inst->surface_capabilities.supportedCompositeAlpha == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR\n"); } + if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_INHERIT_BIT_KHR\n"); } + printf("\tsupportedUsageFlags:\n"); + if (inst->surface_capabilities.supportedUsageFlags == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } + if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + } // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2EXT if (CheckExtensionEnabled(VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) { @@ -1147,11 +1403,22 @@ static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu * inst->vkGetPhysicalDeviceSurfaceCapabilities2EXT(gpu->obj, inst->surface, &inst->surface_capabilities2_ext); - printf("\nVkSurfaceCapabilities2EXT:\n"); - printf("==========================\n\n"); - printf("\tsupportedSurfaceCounters:\n"); - if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { printf("\t\tNone\n"); } - if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { printf("\t\tVK_SURFACE_COUNTER_VBLANK_EXT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkSurfaceCapabilities2EXT\n"); + fprintf(out, "\t\t\t\t\t\t
supportedSurfaceCounters\n"); + if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { fprintf(out, "\t\t\t\t\t\t\t
None
\n"); } + if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_SURFACE_COUNTER_VBLANK_EXT
\n"); + } + fprintf(out, "\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\nVkSurfaceCapabilities2EXT:\n"); + printf("==========================\n\n"); + printf("\tsupportedSurfaceCounters:\n"); + if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { printf("\t\tNone\n"); } + if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { printf("\t\tVK_SURFACE_COUNTER_VBLANK_EXT\n"); } + } } // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2KHR @@ -1177,31 +1444,63 @@ static void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu * while (place) { struct VkStructureHeader* work = (struct VkStructureHeader*) place; if (work->sType == VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) { - printf("\nVkSharedPresentSurfaceCapabilitiesKHR:\n"); - printf("========================================\n"); - VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place; - printf("\tsharedPresentSupportedUsageFlags:\n"); - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { printf("\t\tNone\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } - if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkSharedPresentSurfaceCapabilitiesKHR\n"); + VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place; + fprintf(out, "\t\t\t\t\t\t
sharedPresentSupportedUsageFlags\n"); + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { fprintf(out, "\t\t\t\t\t\t\t
None
\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSFER_DST_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_SAMPLED_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_STORAGE_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
\n"); + } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { + fprintf(out, "\t\t\t\t\t\t\t
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
\n"); + } + fprintf(out, "\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\nVkSharedPresentSurfaceCapabilitiesKHR:\n"); + printf("========================================\n"); + VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place; + printf("\tsharedPresentSupportedUsageFlags:\n"); + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { printf("\t\tNone\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); } + if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); } + } } - place = work->pNext; } } + if (html_output) { fprintf(out, "\t\t\t\t
\n"); } } } #endif -static void AppDevDumpFormatProps(const struct AppDev *dev, VkFormat fmt) -{ +static void AppDevDumpFormatProps(const struct AppDev *dev, VkFormat fmt, FILE *out) { const VkFormatProperties *props = &dev->format_props[fmt]; struct { const char *name; @@ -1215,44 +1514,82 @@ static void AppDevDumpFormatProps(const struct AppDev *dev, VkFormat fmt) features[2].name = "bufferFeatures FormatFeatureFlags"; features[2].flags = props->bufferFeatures; - printf("\nFORMAT_%s:", VkFormatString(fmt)); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
FORMAT_%s
\n", VkFormatString(fmt)); + } else { + printf("\nFORMAT_%s:", VkFormatString(fmt)); + } + for (uint32_t i = 0; i < ARRAY_SIZE(features); i++) { - printf("\n\t%s:", features[i].name); - if (features[i].flags == 0) { - printf("\n\t\tNone"); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
%s\n", features[i].name); + if (features[i].flags == 0) { + fprintf(out, "\t\t\t\t\t\t\t\t
None
\n"); + } else { + fprintf(out, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
\n" : ""), //0x0001 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
\n" : ""), //0x0002 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
\n" : ""), //0x0004 + ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
\n" : ""), //0x0008 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
\n" : ""), //0x0010 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
\n" : ""), //0x0020 + ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT
\n" : ""), //0x0040 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
\n" : ""), //0x0080 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
\n" : ""), //0x0100 + ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
\n" : ""), //0x0200 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_BLIT_SRC_BIT
\n" : ""), //0x0400 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_BLIT_DST_BIT
\n" : ""), //0x0800 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
\n" : ""), //0x1000 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG
\n" : ""), //0x2000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
\n" : ""), //0x4000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\t\t\t\t\t\t\t\t
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
\n" : "")); //0x8000 + } + fprintf(out, "\t\t\t\t\t\t\t
\n"); } else { - printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT" : ""), //0x0001 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT" : ""), //0x0002 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT" : ""), //0x0004 - ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" : ""), //0x0008 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" : ""), //0x0010 - ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" : ""), //0x0020 - ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" : ""), //0x0040 - ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT" : ""), //0x0080 - ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT" : ""), //0x0100 - ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT" : ""), //0x0200 - ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_SRC_BIT" : ""), //0x0400 - ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_DST_BIT" : ""), //0x0800 - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" : ""), //0x1000 - ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" : ""), //0x2000 - ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" : ""), //0x4000 - ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" : "")); //0x8000 + printf("\n\t%s:", features[i].name); + if (features[i].flags == 0) { + printf("\n\t\tNone"); + } else { + printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT" : ""), //0x0001 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT" : ""), //0x0002 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT" : ""), //0x0004 + ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" : ""), //0x0008 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" : ""), //0x0010 + ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" : ""), //0x0020 + ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) ? "\n\t\tVK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" : ""), //0x0040 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT" : ""), //0x0080 + ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT" : ""), //0x0100 + ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) ? "\n\t\tVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT" : ""), //0x0200 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_SRC_BIT" : ""), //0x0400 + ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT) ? "\n\t\tVK_FORMAT_FEATURE_BLIT_DST_BIT" : ""), //0x0800 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" : ""), //0x1000 + ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" : ""), //0x2000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" : ""), //0x4000 + ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR) ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" : "")); //0x8000 + } } } - printf("\n"); + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
\n"); + } else { + printf("\n"); + } } -static void -AppDevDump(const struct AppDev *dev) -{ - printf("Format Properties:\n"); - printf("=================="); +static void AppDevDump(const struct AppDev *dev, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
Format Properties\n"); + } else { + printf("Format Properties:\n"); + printf("=================="); + } VkFormat fmt; - for (fmt = 0; fmt < VK_FORMAT_RANGE_SIZE; fmt++) { - AppDevDumpFormatProps(dev, fmt); + AppDevDumpFormatProps(dev, fmt, out); } + if (html_output) fprintf(out, "\t\t\t\t\t
\n"); } #ifdef _WIN32 @@ -1261,274 +1598,508 @@ AppDevDump(const struct AppDev *dev) #define PRINTF_SIZE_T_SPECIFIER "%zu" #endif -static void AppGpuDumpFeatures(const struct AppGpu *gpu) -{ +static void AppGpuDumpFeatures(const struct AppGpu *gpu, FILE *out) { const VkPhysicalDeviceFeatures *features = &gpu->features; - printf("VkPhysicalDeviceFeatures:\n"); - printf("=========================\n"); - - printf("\trobustBufferAccess = %u\n", features->robustBufferAccess ); - printf("\tfullDrawIndexUint32 = %u\n", features->fullDrawIndexUint32 ); - printf("\timageCubeArray = %u\n", features->imageCubeArray ); - printf("\tindependentBlend = %u\n", features->independentBlend ); - printf("\tgeometryShader = %u\n", features->geometryShader ); - printf("\ttessellationShader = %u\n", features->tessellationShader ); - printf("\tsampleRateShading = %u\n", features->sampleRateShading ); - printf("\tdualSrcBlend = %u\n", features->dualSrcBlend ); - printf("\tlogicOp = %u\n", features->logicOp ); - printf("\tmultiDrawIndirect = %u\n", features->multiDrawIndirect ); - printf("\tdrawIndirectFirstInstance = %u\n", features->drawIndirectFirstInstance ); - printf("\tdepthClamp = %u\n", features->depthClamp ); - printf("\tdepthBiasClamp = %u\n", features->depthBiasClamp ); - printf("\tfillModeNonSolid = %u\n", features->fillModeNonSolid ); - printf("\tdepthBounds = %u\n", features->depthBounds ); - printf("\twideLines = %u\n", features->wideLines ); - printf("\tlargePoints = %u\n", features->largePoints ); - printf("\talphaToOne = %u\n", features->alphaToOne ); - printf("\tmultiViewport = %u\n", features->multiViewport ); - printf("\tsamplerAnisotropy = %u\n", features->samplerAnisotropy ); - printf("\ttextureCompressionETC2 = %u\n", features->textureCompressionETC2 ); - printf("\ttextureCompressionASTC_LDR = %u\n", features->textureCompressionASTC_LDR ); - printf("\ttextureCompressionBC = %u\n", features->textureCompressionBC ); - printf("\tocclusionQueryPrecise = %u\n", features->occlusionQueryPrecise ); - printf("\tpipelineStatisticsQuery = %u\n", features->pipelineStatisticsQuery ); - printf("\tvertexPipelineStoresAndAtomics = %u\n", features->vertexPipelineStoresAndAtomics ); - printf("\tfragmentStoresAndAtomics = %u\n", features->fragmentStoresAndAtomics ); - printf("\tshaderTessellationAndGeometryPointSize = %u\n", features->shaderTessellationAndGeometryPointSize ); - printf("\tshaderImageGatherExtended = %u\n", features->shaderImageGatherExtended ); - printf("\tshaderStorageImageExtendedFormats = %u\n", features->shaderStorageImageExtendedFormats ); - printf("\tshaderStorageImageMultisample = %u\n", features->shaderStorageImageMultisample ); - printf("\tshaderStorageImageReadWithoutFormat = %u\n", features->shaderStorageImageReadWithoutFormat ); - printf("\tshaderStorageImageWriteWithoutFormat = %u\n", features->shaderStorageImageWriteWithoutFormat ); - printf("\tshaderUniformBufferArrayDynamicIndexing = %u\n", features->shaderUniformBufferArrayDynamicIndexing); - printf("\tshaderSampledImageArrayDynamicIndexing = %u\n", features->shaderSampledImageArrayDynamicIndexing ); - printf("\tshaderStorageBufferArrayDynamicIndexing = %u\n", features->shaderStorageBufferArrayDynamicIndexing); - printf("\tshaderStorageImageArrayDynamicIndexing = %u\n", features->shaderStorageImageArrayDynamicIndexing ); - printf("\tshaderClipDistance = %u\n", features->shaderClipDistance ); - printf("\tshaderCullDistance = %u\n", features->shaderCullDistance ); - printf("\tshaderFloat64 = %u\n", features->shaderFloat64 ); - printf("\tshaderInt64 = %u\n", features->shaderInt64 ); - printf("\tshaderInt16 = %u\n", features->shaderInt16 ); - printf("\tshaderResourceResidency = %u\n", features->shaderResourceResidency ); - printf("\tshaderResourceMinLod = %u\n", features->shaderResourceMinLod ); - printf("\tsparseBinding = %u\n", features->sparseBinding ); - printf("\tsparseResidencyBuffer = %u\n", features->sparseResidencyBuffer ); - printf("\tsparseResidencyImage2D = %u\n", features->sparseResidencyImage2D ); - printf("\tsparseResidencyImage3D = %u\n", features->sparseResidencyImage3D ); - printf("\tsparseResidency2Samples = %u\n", features->sparseResidency2Samples ); - printf("\tsparseResidency4Samples = %u\n", features->sparseResidency4Samples ); - printf("\tsparseResidency8Samples = %u\n", features->sparseResidency8Samples ); - printf("\tsparseResidency16Samples = %u\n", features->sparseResidency16Samples ); - printf("\tsparseResidencyAliased = %u\n", features->sparseResidencyAliased ); - printf("\tvariableMultisampleRate = %u\n", features->variableMultisampleRate ); - printf("\tinheritedQueries = %u\n", features->inheritedQueries ); + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceFeatures\n"); + fprintf(out, "\t\t\t\t\t\t
robustBufferAccess =
%u
\n", features->robustBufferAccess ); + fprintf(out, "\t\t\t\t\t\t
fullDrawIndexUint32 =
%u
\n", features->fullDrawIndexUint32 ); + fprintf(out, "\t\t\t\t\t\t
imageCubeArray =
%u
\n", features->imageCubeArray ); + fprintf(out, "\t\t\t\t\t\t
independentBlend =
%u
\n", features->independentBlend ); + fprintf(out, "\t\t\t\t\t\t
geometryShader =
%u
\n", features->geometryShader ); + fprintf(out, "\t\t\t\t\t\t
tessellationShader =
%u
\n", features->tessellationShader ); + fprintf(out, "\t\t\t\t\t\t
sampleRateShading =
%u
\n", features->sampleRateShading ); + fprintf(out, "\t\t\t\t\t\t
dualSrcBlend =
%u
\n", features->dualSrcBlend ); + fprintf(out, "\t\t\t\t\t\t
logicOp =
%u
\n", features->logicOp ); + fprintf(out, "\t\t\t\t\t\t
multiDrawIndirect =
%u
\n", features->multiDrawIndirect ); + fprintf(out, "\t\t\t\t\t\t
drawIndirectFirstInstance =
%u
\n", features->drawIndirectFirstInstance ); + fprintf(out, "\t\t\t\t\t\t
depthClamp =
%u
\n", features->depthClamp ); + fprintf(out, "\t\t\t\t\t\t
depthBiasClamp =
%u
\n", features->depthBiasClamp ); + fprintf(out, "\t\t\t\t\t\t
fillModeNonSolid =
%u
\n", features->fillModeNonSolid ); + fprintf(out, "\t\t\t\t\t\t
depthBounds =
%u
\n", features->depthBounds ); + fprintf(out, "\t\t\t\t\t\t
wideLines =
%u
\n", features->wideLines ); + fprintf(out, "\t\t\t\t\t\t
largePoints =
%u
\n", features->largePoints ); + fprintf(out, "\t\t\t\t\t\t
alphaToOne =
%u
\n", features->alphaToOne ); + fprintf(out, "\t\t\t\t\t\t
multiViewport =
%u
\n", features->multiViewport ); + fprintf(out, "\t\t\t\t\t\t
samplerAnisotropy =
%u
\n", features->samplerAnisotropy ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionETC2 =
%u
\n", features->textureCompressionETC2 ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionASTC_LDR =
%u
\n", features->textureCompressionASTC_LDR ); + fprintf(out, "\t\t\t\t\t\t
textureCompressionBC =
%u
\n", features->textureCompressionBC ); + fprintf(out, "\t\t\t\t\t\t
occlusionQueryPrecise =
%u
\n", features->occlusionQueryPrecise ); + fprintf(out, "\t\t\t\t\t\t
pipelineStatisticsQuery =
%u
\n", features->pipelineStatisticsQuery ); + fprintf(out, "\t\t\t\t\t\t
vertexPipelineStoresAndAtomics =
%u
\n", features->vertexPipelineStoresAndAtomics ); + fprintf(out, "\t\t\t\t\t\t
fragmentStoresAndAtomics =
%u
\n", features->fragmentStoresAndAtomics ); + fprintf(out, "\t\t\t\t\t\t
shaderTessellationAndGeometryPointSize =
%u
\n", features->shaderTessellationAndGeometryPointSize ); + fprintf(out, "\t\t\t\t\t\t
shaderImageGatherExtended =
%u
\n", features->shaderImageGatherExtended ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageExtendedFormats =
%u
\n", features->shaderStorageImageExtendedFormats ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageMultisample =
%u
\n", features->shaderStorageImageMultisample ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageReadWithoutFormat =
%u
\n", features->shaderStorageImageReadWithoutFormat ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageWriteWithoutFormat =
%u
\n", features->shaderStorageImageWriteWithoutFormat ); + fprintf(out, "\t\t\t\t\t\t
shaderUniformBufferArrayDynamicIndexing =
%u
\n", features->shaderUniformBufferArrayDynamicIndexing); + fprintf(out, "\t\t\t\t\t\t
shaderSampledImageArrayDynamicIndexing =
%u
\n", features->shaderSampledImageArrayDynamicIndexing ); + fprintf(out, "\t\t\t\t\t\t
shaderStorageBufferArrayDynamicIndexing =
%u
\n", features->shaderStorageBufferArrayDynamicIndexing); + fprintf(out, "\t\t\t\t\t\t
shaderStorageImageArrayDynamicIndexing =
%u
\n", features->shaderStorageImageArrayDynamicIndexing ); + fprintf(out, "\t\t\t\t\t\t
shaderClipDistance =
%u
\n", features->shaderClipDistance ); + fprintf(out, "\t\t\t\t\t\t
shaderCullDistance =
%u
\n", features->shaderCullDistance ); + fprintf(out, "\t\t\t\t\t\t
shaderFloat64 =
%u
\n", features->shaderFloat64 ); + fprintf(out, "\t\t\t\t\t\t
shaderInt64 =
%u
\n", features->shaderInt64 ); + fprintf(out, "\t\t\t\t\t\t
shaderInt16 =
%u
\n", features->shaderInt16 ); + fprintf(out, "\t\t\t\t\t\t
shaderResourceResidency =
%u
\n", features->shaderResourceResidency ); + fprintf(out, "\t\t\t\t\t\t
shaderResourceMinLod =
%u
\n", features->shaderResourceMinLod ); + fprintf(out, "\t\t\t\t\t\t
sparseBinding =
%u
\n", features->sparseBinding ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyBuffer =
%u
\n", features->sparseResidencyBuffer ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyImage2D =
%u
\n", features->sparseResidencyImage2D ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyImage3D =
%u
\n", features->sparseResidencyImage3D ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency2Samples =
%u
\n", features->sparseResidency2Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency4Samples =
%u
\n", features->sparseResidency4Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency8Samples =
%u
\n", features->sparseResidency8Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidency16Samples =
%u
\n", features->sparseResidency16Samples ); + fprintf(out, "\t\t\t\t\t\t
sparseResidencyAliased =
%u
\n", features->sparseResidencyAliased ); + fprintf(out, "\t\t\t\t\t\t
variableMultisampleRate =
%u
\n", features->variableMultisampleRate ); + fprintf(out, "\t\t\t\t\t\t
inheritedQueries =
%u
\n", features->inheritedQueries ); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("VkPhysicalDeviceFeatures:\n"); + printf("=========================\n"); + printf("\trobustBufferAccess = %u\n", features->robustBufferAccess ); + printf("\tfullDrawIndexUint32 = %u\n", features->fullDrawIndexUint32 ); + printf("\timageCubeArray = %u\n", features->imageCubeArray ); + printf("\tindependentBlend = %u\n", features->independentBlend ); + printf("\tgeometryShader = %u\n", features->geometryShader ); + printf("\ttessellationShader = %u\n", features->tessellationShader ); + printf("\tsampleRateShading = %u\n", features->sampleRateShading ); + printf("\tdualSrcBlend = %u\n", features->dualSrcBlend ); + printf("\tlogicOp = %u\n", features->logicOp ); + printf("\tmultiDrawIndirect = %u\n", features->multiDrawIndirect ); + printf("\tdrawIndirectFirstInstance = %u\n", features->drawIndirectFirstInstance ); + printf("\tdepthClamp = %u\n", features->depthClamp ); + printf("\tdepthBiasClamp = %u\n", features->depthBiasClamp ); + printf("\tfillModeNonSolid = %u\n", features->fillModeNonSolid ); + printf("\tdepthBounds = %u\n", features->depthBounds ); + printf("\twideLines = %u\n", features->wideLines ); + printf("\tlargePoints = %u\n", features->largePoints ); + printf("\talphaToOne = %u\n", features->alphaToOne ); + printf("\tmultiViewport = %u\n", features->multiViewport ); + printf("\tsamplerAnisotropy = %u\n", features->samplerAnisotropy ); + printf("\ttextureCompressionETC2 = %u\n", features->textureCompressionETC2 ); + printf("\ttextureCompressionASTC_LDR = %u\n", features->textureCompressionASTC_LDR ); + printf("\ttextureCompressionBC = %u\n", features->textureCompressionBC ); + printf("\tocclusionQueryPrecise = %u\n", features->occlusionQueryPrecise ); + printf("\tpipelineStatisticsQuery = %u\n", features->pipelineStatisticsQuery ); + printf("\tvertexPipelineStoresAndAtomics = %u\n", features->vertexPipelineStoresAndAtomics ); + printf("\tfragmentStoresAndAtomics = %u\n", features->fragmentStoresAndAtomics ); + printf("\tshaderTessellationAndGeometryPointSize = %u\n", features->shaderTessellationAndGeometryPointSize ); + printf("\tshaderImageGatherExtended = %u\n", features->shaderImageGatherExtended ); + printf("\tshaderStorageImageExtendedFormats = %u\n", features->shaderStorageImageExtendedFormats ); + printf("\tshaderStorageImageMultisample = %u\n", features->shaderStorageImageMultisample ); + printf("\tshaderStorageImageReadWithoutFormat = %u\n", features->shaderStorageImageReadWithoutFormat ); + printf("\tshaderStorageImageWriteWithoutFormat = %u\n", features->shaderStorageImageWriteWithoutFormat ); + printf("\tshaderUniformBufferArrayDynamicIndexing = %u\n", features->shaderUniformBufferArrayDynamicIndexing); + printf("\tshaderSampledImageArrayDynamicIndexing = %u\n", features->shaderSampledImageArrayDynamicIndexing ); + printf("\tshaderStorageBufferArrayDynamicIndexing = %u\n", features->shaderStorageBufferArrayDynamicIndexing); + printf("\tshaderStorageImageArrayDynamicIndexing = %u\n", features->shaderStorageImageArrayDynamicIndexing ); + printf("\tshaderClipDistance = %u\n", features->shaderClipDistance ); + printf("\tshaderCullDistance = %u\n", features->shaderCullDistance ); + printf("\tshaderFloat64 = %u\n", features->shaderFloat64 ); + printf("\tshaderInt64 = %u\n", features->shaderInt64 ); + printf("\tshaderInt16 = %u\n", features->shaderInt16 ); + printf("\tshaderResourceResidency = %u\n", features->shaderResourceResidency ); + printf("\tshaderResourceMinLod = %u\n", features->shaderResourceMinLod ); + printf("\tsparseBinding = %u\n", features->sparseBinding ); + printf("\tsparseResidencyBuffer = %u\n", features->sparseResidencyBuffer ); + printf("\tsparseResidencyImage2D = %u\n", features->sparseResidencyImage2D ); + printf("\tsparseResidencyImage3D = %u\n", features->sparseResidencyImage3D ); + printf("\tsparseResidency2Samples = %u\n", features->sparseResidency2Samples ); + printf("\tsparseResidency4Samples = %u\n", features->sparseResidency4Samples ); + printf("\tsparseResidency8Samples = %u\n", features->sparseResidency8Samples ); + printf("\tsparseResidency16Samples = %u\n", features->sparseResidency16Samples ); + printf("\tsparseResidencyAliased = %u\n", features->sparseResidencyAliased ); + printf("\tvariableMultisampleRate = %u\n", features->variableMultisampleRate ); + printf("\tinheritedQueries = %u\n", features->inheritedQueries ); + } } -static void AppDumpSparseProps(const VkPhysicalDeviceSparseProperties *sparse_props) -{ - - printf("\tVkPhysicalDeviceSparseProperties:\n"); - printf("\t---------------------------------\n"); - - printf("\t\tresidencyStandard2DBlockShape = %u\n", sparse_props->residencyStandard2DBlockShape ); - printf("\t\tresidencyStandard2DMultisampleBlockShape = %u\n", sparse_props->residencyStandard2DMultisampleBlockShape); - printf("\t\tresidencyStandard3DBlockShape = %u\n", sparse_props->residencyStandard3DBlockShape ); - printf("\t\tresidencyAlignedMipSize = %u\n", sparse_props->residencyAlignedMipSize ); - printf("\t\tresidencyNonResidentStrict = %u\n", sparse_props->residencyNonResidentStrict ); +static void AppDumpSparseProps(const VkPhysicalDeviceSparseProperties *sparse_props, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceSparseProperties\n"); + fprintf(out, "\t\t\t\t\t\t
residencyStandard2DBlockShape =
%u
\n", sparse_props->residencyStandard2DBlockShape ); + fprintf(out, "\t\t\t\t\t\t
residencyStandard2DMultisampleBlockShape =
%u
\n", sparse_props->residencyStandard2DMultisampleBlockShape); + fprintf(out, "\t\t\t\t\t\t
residencyStandard3DBlockShape =
%u
\n", sparse_props->residencyStandard3DBlockShape ); + fprintf(out, "\t\t\t\t\t\t
residencyAlignedMipSize =
%u
\n", sparse_props->residencyAlignedMipSize ); + fprintf(out, "\t\t\t\t\t\t
residencyNonResidentStrict =
%u
\n", sparse_props->residencyNonResidentStrict ); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\tVkPhysicalDeviceSparseProperties:\n"); + printf("\t---------------------------------\n"); + printf("\t\tresidencyStandard2DBlockShape = %u\n", sparse_props->residencyStandard2DBlockShape ); + printf("\t\tresidencyStandard2DMultisampleBlockShape = %u\n", sparse_props->residencyStandard2DMultisampleBlockShape); + printf("\t\tresidencyStandard3DBlockShape = %u\n", sparse_props->residencyStandard3DBlockShape ); + printf("\t\tresidencyAlignedMipSize = %u\n", sparse_props->residencyAlignedMipSize ); + printf("\t\tresidencyNonResidentStrict = %u\n", sparse_props->residencyNonResidentStrict ); + } } -static void AppDumpLimits(const VkPhysicalDeviceLimits *limits) -{ - printf("\tVkPhysicalDeviceLimits:\n"); - printf("\t-----------------------\n"); - printf("\t\tmaxImageDimension1D = %u\n", limits->maxImageDimension1D ); - printf("\t\tmaxImageDimension2D = %u\n", limits->maxImageDimension2D ); - printf("\t\tmaxImageDimension3D = %u\n", limits->maxImageDimension3D ); - printf("\t\tmaxImageDimensionCube = %u\n", limits->maxImageDimensionCube ); - printf("\t\tmaxImageArrayLayers = %u\n", limits->maxImageArrayLayers ); - printf("\t\tmaxTexelBufferElements = 0x%" PRIxLEAST32 "\n", limits->maxTexelBufferElements ); - printf("\t\tmaxUniformBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxUniformBufferRange ); - printf("\t\tmaxStorageBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxStorageBufferRange ); - printf("\t\tmaxPushConstantsSize = %u\n", limits->maxPushConstantsSize ); - printf("\t\tmaxMemoryAllocationCount = %u\n", limits->maxMemoryAllocationCount ); - printf("\t\tmaxSamplerAllocationCount = %u\n", limits->maxSamplerAllocationCount ); - printf("\t\tbufferImageGranularity = 0x%" PRIxLEAST64 "\n", limits->bufferImageGranularity ); - printf("\t\tsparseAddressSpaceSize = 0x%" PRIxLEAST64 "\n", limits->sparseAddressSpaceSize ); - printf("\t\tmaxBoundDescriptorSets = %u\n", limits->maxBoundDescriptorSets ); - printf("\t\tmaxPerStageDescriptorSamplers = %u\n", limits->maxPerStageDescriptorSamplers ); - printf("\t\tmaxPerStageDescriptorUniformBuffers = %u\n", limits->maxPerStageDescriptorUniformBuffers ); - printf("\t\tmaxPerStageDescriptorStorageBuffers = %u\n", limits->maxPerStageDescriptorStorageBuffers ); - printf("\t\tmaxPerStageDescriptorSampledImages = %u\n", limits->maxPerStageDescriptorSampledImages ); - printf("\t\tmaxPerStageDescriptorStorageImages = %u\n", limits->maxPerStageDescriptorStorageImages ); - printf("\t\tmaxPerStageDescriptorInputAttachments = %u\n", limits->maxPerStageDescriptorInputAttachments ); - printf("\t\tmaxPerStageResources = %u\n", limits->maxPerStageResources ); - printf("\t\tmaxDescriptorSetSamplers = %u\n", limits->maxDescriptorSetSamplers ); - printf("\t\tmaxDescriptorSetUniformBuffers = %u\n", limits->maxDescriptorSetUniformBuffers ); - printf("\t\tmaxDescriptorSetUniformBuffersDynamic = %u\n", limits->maxDescriptorSetUniformBuffersDynamic ); - printf("\t\tmaxDescriptorSetStorageBuffers = %u\n", limits->maxDescriptorSetStorageBuffers ); - printf("\t\tmaxDescriptorSetStorageBuffersDynamic = %u\n", limits->maxDescriptorSetStorageBuffersDynamic ); - printf("\t\tmaxDescriptorSetSampledImages = %u\n", limits->maxDescriptorSetSampledImages ); - printf("\t\tmaxDescriptorSetStorageImages = %u\n", limits->maxDescriptorSetStorageImages ); - printf("\t\tmaxDescriptorSetInputAttachments = %u\n", limits->maxDescriptorSetInputAttachments ); - printf("\t\tmaxVertexInputAttributes = %u\n", limits->maxVertexInputAttributes ); - printf("\t\tmaxVertexInputBindings = %u\n", limits->maxVertexInputBindings ); - printf("\t\tmaxVertexInputAttributeOffset = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputAttributeOffset ); - printf("\t\tmaxVertexInputBindingStride = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputBindingStride ); - printf("\t\tmaxVertexOutputComponents = %u\n", limits->maxVertexOutputComponents ); - printf("\t\tmaxTessellationGenerationLevel = %u\n", limits->maxTessellationGenerationLevel ); - printf("\t\tmaxTessellationPatchSize = %u\n", limits->maxTessellationPatchSize ); - printf("\t\tmaxTessellationControlPerVertexInputComponents = %u\n", limits->maxTessellationControlPerVertexInputComponents ); - printf("\t\tmaxTessellationControlPerVertexOutputComponents = %u\n", limits->maxTessellationControlPerVertexOutputComponents); - printf("\t\tmaxTessellationControlPerPatchOutputComponents = %u\n", limits->maxTessellationControlPerPatchOutputComponents ); - printf("\t\tmaxTessellationControlTotalOutputComponents = %u\n", limits->maxTessellationControlTotalOutputComponents ); - printf("\t\tmaxTessellationEvaluationInputComponents = %u\n", limits->maxTessellationEvaluationInputComponents ); - printf("\t\tmaxTessellationEvaluationOutputComponents = %u\n", limits->maxTessellationEvaluationOutputComponents ); - printf("\t\tmaxGeometryShaderInvocations = %u\n", limits->maxGeometryShaderInvocations ); - printf("\t\tmaxGeometryInputComponents = %u\n", limits->maxGeometryInputComponents ); - printf("\t\tmaxGeometryOutputComponents = %u\n", limits->maxGeometryOutputComponents ); - printf("\t\tmaxGeometryOutputVertices = %u\n", limits->maxGeometryOutputVertices ); - printf("\t\tmaxGeometryTotalOutputComponents = %u\n", limits->maxGeometryTotalOutputComponents ); - printf("\t\tmaxFragmentInputComponents = %u\n", limits->maxFragmentInputComponents ); - printf("\t\tmaxFragmentOutputAttachments = %u\n", limits->maxFragmentOutputAttachments ); - printf("\t\tmaxFragmentDualSrcAttachments = %u\n", limits->maxFragmentDualSrcAttachments ); - printf("\t\tmaxFragmentCombinedOutputResources = %u\n", limits->maxFragmentCombinedOutputResources ); - printf("\t\tmaxComputeSharedMemorySize = 0x%" PRIxLEAST32 "\n", limits->maxComputeSharedMemorySize ); - printf("\t\tmaxComputeWorkGroupCount[0] = %u\n", limits->maxComputeWorkGroupCount[0] ); - printf("\t\tmaxComputeWorkGroupCount[1] = %u\n", limits->maxComputeWorkGroupCount[1] ); - printf("\t\tmaxComputeWorkGroupCount[2] = %u\n", limits->maxComputeWorkGroupCount[2] ); - printf("\t\tmaxComputeWorkGroupInvocations = %u\n", limits->maxComputeWorkGroupInvocations ); - printf("\t\tmaxComputeWorkGroupSize[0] = %u\n", limits->maxComputeWorkGroupSize[0] ); - printf("\t\tmaxComputeWorkGroupSize[1] = %u\n", limits->maxComputeWorkGroupSize[1] ); - printf("\t\tmaxComputeWorkGroupSize[2] = %u\n", limits->maxComputeWorkGroupSize[2] ); - printf("\t\tsubPixelPrecisionBits = %u\n", limits->subPixelPrecisionBits ); - printf("\t\tsubTexelPrecisionBits = %u\n", limits->subTexelPrecisionBits ); - printf("\t\tmipmapPrecisionBits = %u\n", limits->mipmapPrecisionBits ); - printf("\t\tmaxDrawIndexedIndexValue = %u\n", limits->maxDrawIndexedIndexValue ); - printf("\t\tmaxDrawIndirectCount = %u\n", limits->maxDrawIndirectCount ); - printf("\t\tmaxSamplerLodBias = %f\n", limits->maxSamplerLodBias ); - printf("\t\tmaxSamplerAnisotropy = %f\n", limits->maxSamplerAnisotropy ); - printf("\t\tmaxViewports = %u\n", limits->maxViewports ); - printf("\t\tmaxViewportDimensions[0] = %u\n", limits->maxViewportDimensions[0] ); - printf("\t\tmaxViewportDimensions[1] = %u\n", limits->maxViewportDimensions[1] ); - printf("\t\tviewportBoundsRange[0] =%13f\n", limits->viewportBoundsRange[0] ); - printf("\t\tviewportBoundsRange[1] =%13f\n", limits->viewportBoundsRange[1] ); - printf("\t\tviewportSubPixelBits = %u\n", limits->viewportSubPixelBits ); - printf("\t\tminMemoryMapAlignment = " PRINTF_SIZE_T_SPECIFIER "\n", limits->minMemoryMapAlignment ); - printf("\t\tminTexelBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minTexelBufferOffsetAlignment ); - printf("\t\tminUniformBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minUniformBufferOffsetAlignment ); - printf("\t\tminStorageBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minStorageBufferOffsetAlignment ); - printf("\t\tminTexelOffset =%3d\n", limits->minTexelOffset ); - printf("\t\tmaxTexelOffset =%3d\n", limits->maxTexelOffset ); - printf("\t\tminTexelGatherOffset =%3d\n", limits->minTexelGatherOffset ); - printf("\t\tmaxTexelGatherOffset =%3d\n", limits->maxTexelGatherOffset ); - printf("\t\tminInterpolationOffset =%9f\n", limits->minInterpolationOffset ); - printf("\t\tmaxInterpolationOffset =%9f\n", limits->maxInterpolationOffset ); - printf("\t\tsubPixelInterpolationOffsetBits = %u\n", limits->subPixelInterpolationOffsetBits ); - printf("\t\tmaxFramebufferWidth = %u\n", limits->maxFramebufferWidth ); - printf("\t\tmaxFramebufferHeight = %u\n", limits->maxFramebufferHeight ); - printf("\t\tmaxFramebufferLayers = %u\n", limits->maxFramebufferLayers ); - printf("\t\tframebufferColorSampleCounts = %u\n", limits->framebufferColorSampleCounts ); - printf("\t\tframebufferDepthSampleCounts = %u\n", limits->framebufferDepthSampleCounts ); - printf("\t\tframebufferStencilSampleCounts = %u\n", limits->framebufferStencilSampleCounts ); - printf("\t\tframebufferNoAttachmentsSampleCounts = %u\n", limits->framebufferNoAttachmentsSampleCounts ); - printf("\t\tmaxColorAttachments = %u\n", limits->maxColorAttachments ); - printf("\t\tsampledImageColorSampleCounts = %u\n", limits->sampledImageColorSampleCounts ); - printf("\t\tsampledImageDepthSampleCounts = %u\n", limits->sampledImageDepthSampleCounts ); - printf("\t\tsampledImageStencilSampleCounts = %u\n", limits->sampledImageStencilSampleCounts ); - printf("\t\tsampledImageIntegerSampleCounts = %u\n", limits->sampledImageIntegerSampleCounts ); - printf("\t\tstorageImageSampleCounts = %u\n", limits->storageImageSampleCounts ); - printf("\t\tmaxSampleMaskWords = %u\n", limits->maxSampleMaskWords ); - printf("\t\ttimestampComputeAndGraphics = %u\n", limits->timestampComputeAndGraphics ); - printf("\t\ttimestampPeriod = %f\n", limits->timestampPeriod ); - printf("\t\tmaxClipDistances = %u\n", limits->maxClipDistances ); - printf("\t\tmaxCullDistances = %u\n", limits->maxCullDistances ); - printf("\t\tmaxCombinedClipAndCullDistances = %u\n", limits->maxCombinedClipAndCullDistances ); - printf("\t\tdiscreteQueuePriorities = %u\n", limits->discreteQueuePriorities ); - printf("\t\tpointSizeRange[0] = %f\n", limits->pointSizeRange[0] ); - printf("\t\tpointSizeRange[1] = %f\n", limits->pointSizeRange[1] ); - printf("\t\tlineWidthRange[0] = %f\n", limits->lineWidthRange[0] ); - printf("\t\tlineWidthRange[1] = %f\n", limits->lineWidthRange[1] ); - printf("\t\tpointSizeGranularity = %f\n", limits->pointSizeGranularity ); - printf("\t\tlineWidthGranularity = %f\n", limits->lineWidthGranularity ); - printf("\t\tstrictLines = %u\n", limits->strictLines ); - printf("\t\tstandardSampleLocations = %u\n", limits->standardSampleLocations ); - printf("\t\toptimalBufferCopyOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyOffsetAlignment ); - printf("\t\toptimalBufferCopyRowPitchAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyRowPitchAlignment ); - printf("\t\tnonCoherentAtomSize = 0x%" PRIxLEAST64 "\n", limits->nonCoherentAtomSize ); +static void AppDumpLimits(const VkPhysicalDeviceLimits *limits, FILE *out) { + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceLimits\n"); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension1D =
%u
\n", limits->maxImageDimension1D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension2D =
%u
\n", limits->maxImageDimension2D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimension3D =
%u
\n", limits->maxImageDimension3D ); + fprintf(out, "\t\t\t\t\t\t
maxImageDimensionCube =
%u
\n", limits->maxImageDimensionCube ); + fprintf(out, "\t\t\t\t\t\t
maxImageArrayLayers =
%u
\n", limits->maxImageArrayLayers ); + fprintf(out, "\t\t\t\t\t\t
maxTexelBufferElements =
0x%" PRIxLEAST32 "
\n", limits->maxTexelBufferElements ); + fprintf(out, "\t\t\t\t\t\t
maxUniformBufferRange =
0x%" PRIxLEAST32 "
\n", limits->maxUniformBufferRange ); + fprintf(out, "\t\t\t\t\t\t
maxStorageBufferRange =
0x%" PRIxLEAST32 "
\n", limits->maxStorageBufferRange ); + fprintf(out, "\t\t\t\t\t\t
maxPushConstantsSize =
%u
\n", limits->maxPushConstantsSize ); + fprintf(out, "\t\t\t\t\t\t
maxMemoryAllocationCount =
%u
\n", limits->maxMemoryAllocationCount ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerAllocationCount =
%u
\n", limits->maxSamplerAllocationCount ); + fprintf(out, "\t\t\t\t\t\t
bufferImageGranularity =
0x%" PRIxLEAST64 "
\n", limits->bufferImageGranularity ); + fprintf(out, "\t\t\t\t\t\t
sparseAddressSpaceSize =
0x%" PRIxLEAST64 "
\n", limits->sparseAddressSpaceSize ); + fprintf(out, "\t\t\t\t\t\t
maxBoundDescriptorSets =
%u
\n", limits->maxBoundDescriptorSets ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorSamplers =
%u
\n", limits->maxPerStageDescriptorSamplers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorUniformBuffers =
%u
\n", limits->maxPerStageDescriptorUniformBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorStorageBuffers =
%u
\n", limits->maxPerStageDescriptorStorageBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorSampledImages =
%u
\n", limits->maxPerStageDescriptorSampledImages ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorStorageImages =
%u
\n", limits->maxPerStageDescriptorStorageImages ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageDescriptorInputAttachments =
%u
\n", limits->maxPerStageDescriptorInputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxPerStageResources =
%u
\n", limits->maxPerStageResources ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetSamplers =
%u
\n", limits->maxDescriptorSetSamplers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetUniformBuffers =
%u
\n", limits->maxDescriptorSetUniformBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetUniformBuffersDynamic =
%u
\n", limits->maxDescriptorSetUniformBuffersDynamic ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageBuffers =
%u
\n", limits->maxDescriptorSetStorageBuffers ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageBuffersDynamic =
%u
\n", limits->maxDescriptorSetStorageBuffersDynamic ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetSampledImages =
%u
\n", limits->maxDescriptorSetSampledImages ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetStorageImages =
%u
\n", limits->maxDescriptorSetStorageImages ); + fprintf(out, "\t\t\t\t\t\t
maxDescriptorSetInputAttachments =
%u
\n", limits->maxDescriptorSetInputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputAttributes =
%u
\n", limits->maxVertexInputAttributes ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputBindings =
%u
\n", limits->maxVertexInputBindings ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputAttributeOffset =
0x%" PRIxLEAST32 "
\n", limits->maxVertexInputAttributeOffset ); + fprintf(out, "\t\t\t\t\t\t
maxVertexInputBindingStride =
0x%" PRIxLEAST32 "
\n", limits->maxVertexInputBindingStride ); + fprintf(out, "\t\t\t\t\t\t
maxVertexOutputComponents =
%u
\n", limits->maxVertexOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationGenerationLevel =
%u
\n", limits->maxTessellationGenerationLevel ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationPatchSize =
%u
\n", limits->maxTessellationPatchSize ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerVertexInputComponents =
%u
\n", limits->maxTessellationControlPerVertexInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerVertexOutputComponents =
%u
\n", limits->maxTessellationControlPerVertexOutputComponents); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlPerPatchOutputComponents =
%u
\n", limits->maxTessellationControlPerPatchOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationControlTotalOutputComponents =
%u
\n", limits->maxTessellationControlTotalOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationEvaluationInputComponents =
%u
\n", limits->maxTessellationEvaluationInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxTessellationEvaluationOutputComponents =
%u
\n", limits->maxTessellationEvaluationOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryShaderInvocations =
%u
\n", limits->maxGeometryShaderInvocations ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryInputComponents =
%u
\n", limits->maxGeometryInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryOutputComponents =
%u
\n", limits->maxGeometryOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryOutputVertices =
%u
\n", limits->maxGeometryOutputVertices ); + fprintf(out, "\t\t\t\t\t\t
maxGeometryTotalOutputComponents =
%u
\n", limits->maxGeometryTotalOutputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentInputComponents =
%u
\n", limits->maxFragmentInputComponents ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentOutputAttachments =
%u
\n", limits->maxFragmentOutputAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentDualSrcAttachments =
%u
\n", limits->maxFragmentDualSrcAttachments ); + fprintf(out, "\t\t\t\t\t\t
maxFragmentCombinedOutputResources =
%u
\n", limits->maxFragmentCombinedOutputResources ); + fprintf(out, "\t\t\t\t\t\t
maxComputeSharedMemorySize =
0x%" PRIxLEAST32 "
\n", limits->maxComputeSharedMemorySize ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[0] =
%u
\n", limits->maxComputeWorkGroupCount[0] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[1] =
%u
\n", limits->maxComputeWorkGroupCount[1] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupCount[2] =
%u
\n", limits->maxComputeWorkGroupCount[2] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupInvocations =
%u
\n", limits->maxComputeWorkGroupInvocations ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[0] =
%u
\n", limits->maxComputeWorkGroupSize[0] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[1] =
%u
\n", limits->maxComputeWorkGroupSize[1] ); + fprintf(out, "\t\t\t\t\t\t
maxComputeWorkGroupSize[2] =
%u
\n", limits->maxComputeWorkGroupSize[2] ); + fprintf(out, "\t\t\t\t\t\t
subPixelPrecisionBits =
%u
\n", limits->subPixelPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
subTexelPrecisionBits =
%u
\n", limits->subTexelPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
mipmapPrecisionBits =
%u
\n", limits->mipmapPrecisionBits ); + fprintf(out, "\t\t\t\t\t\t
maxDrawIndexedIndexValue =
%u
\n", limits->maxDrawIndexedIndexValue ); + fprintf(out, "\t\t\t\t\t\t
maxDrawIndirectCount =
%u
\n", limits->maxDrawIndirectCount ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerLodBias =
%f
\n", limits->maxSamplerLodBias ); + fprintf(out, "\t\t\t\t\t\t
maxSamplerAnisotropy =
%f
\n", limits->maxSamplerAnisotropy ); + fprintf(out, "\t\t\t\t\t\t
maxViewports =
%u
\n", limits->maxViewports ); + fprintf(out, "\t\t\t\t\t\t
maxViewportDimensions[0] =
%u
\n", limits->maxViewportDimensions[0] ); + fprintf(out, "\t\t\t\t\t\t
maxViewportDimensions[1] =
%u
\n", limits->maxViewportDimensions[1] ); + fprintf(out, "\t\t\t\t\t\t
viewportBoundsRange[0] =
%13f
\n", limits->viewportBoundsRange[0] ); + fprintf(out, "\t\t\t\t\t\t
viewportBoundsRange[1] =
%13f
\n", limits->viewportBoundsRange[1] ); + fprintf(out, "\t\t\t\t\t\t
viewportSubPixelBits =
%u
\n", limits->viewportSubPixelBits ); + fprintf(out, "\t\t\t\t\t\t
minMemoryMapAlignment =
" PRINTF_SIZE_T_SPECIFIER "
\n", limits->minMemoryMapAlignment ); + fprintf(out, "\t\t\t\t\t\t
minTexelBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minTexelBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minUniformBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minUniformBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minStorageBufferOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->minStorageBufferOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
minTexelOffset =
%3d
\n", limits->minTexelOffset ); + fprintf(out, "\t\t\t\t\t\t
maxTexelOffset =
%3d
\n", limits->maxTexelOffset ); + fprintf(out, "\t\t\t\t\t\t
minTexelGatherOffset =
%3d
\n", limits->minTexelGatherOffset ); + fprintf(out, "\t\t\t\t\t\t
maxTexelGatherOffset =
%3d
\n", limits->maxTexelGatherOffset ); + fprintf(out, "\t\t\t\t\t\t
minInterpolationOffset =
%9f
\n", limits->minInterpolationOffset ); + fprintf(out, "\t\t\t\t\t\t
maxInterpolationOffset =
%9f
\n", limits->maxInterpolationOffset ); + fprintf(out, "\t\t\t\t\t\t
subPixelInterpolationOffsetBits =
%u
\n", limits->subPixelInterpolationOffsetBits ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferWidth =
%u
\n", limits->maxFramebufferWidth ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferHeight =
%u
\n", limits->maxFramebufferHeight ); + fprintf(out, "\t\t\t\t\t\t
maxFramebufferLayers =
%u
\n", limits->maxFramebufferLayers ); + fprintf(out, "\t\t\t\t\t\t
framebufferColorSampleCounts =
%u
\n", limits->framebufferColorSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferDepthSampleCounts =
%u
\n", limits->framebufferDepthSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferStencilSampleCounts =
%u
\n", limits->framebufferStencilSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
framebufferNoAttachmentsSampleCounts =
%u
\n", limits->framebufferNoAttachmentsSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
maxColorAttachments =
%u
\n", limits->maxColorAttachments ); + fprintf(out, "\t\t\t\t\t\t
sampledImageColorSampleCounts =
%u
\n", limits->sampledImageColorSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageDepthSampleCounts =
%u
\n", limits->sampledImageDepthSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageStencilSampleCounts =
%u
\n", limits->sampledImageStencilSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
sampledImageIntegerSampleCounts =
%u
\n", limits->sampledImageIntegerSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
storageImageSampleCounts =
%u
\n", limits->storageImageSampleCounts ); + fprintf(out, "\t\t\t\t\t\t
maxSampleMaskWords =
%u
\n", limits->maxSampleMaskWords ); + fprintf(out, "\t\t\t\t\t\t
timestampComputeAndGraphics =
%u
\n", limits->timestampComputeAndGraphics ); + fprintf(out, "\t\t\t\t\t\t
timestampPeriod =
%f
\n", limits->timestampPeriod ); + fprintf(out, "\t\t\t\t\t\t
maxClipDistances =
%u
\n", limits->maxClipDistances ); + fprintf(out, "\t\t\t\t\t\t
maxCullDistances =
%u
\n", limits->maxCullDistances ); + fprintf(out, "\t\t\t\t\t\t
maxCombinedClipAndCullDistances =
%u
\n", limits->maxCombinedClipAndCullDistances ); + fprintf(out, "\t\t\t\t\t\t
discreteQueuePriorities =
%u
\n", limits->discreteQueuePriorities ); + fprintf(out, "\t\t\t\t\t\t
pointSizeRange[0] =
%f
\n", limits->pointSizeRange[0] ); + fprintf(out, "\t\t\t\t\t\t
pointSizeRange[1] =
%f
\n", limits->pointSizeRange[1] ); + fprintf(out, "\t\t\t\t\t\t
lineWidthRange[0] =
%f
\n", limits->lineWidthRange[0] ); + fprintf(out, "\t\t\t\t\t\t
lineWidthRange[1] =
%f
\n", limits->lineWidthRange[1] ); + fprintf(out, "\t\t\t\t\t\t
pointSizeGranularity =
%f
\n", limits->pointSizeGranularity ); + fprintf(out, "\t\t\t\t\t\t
lineWidthGranularity =
%f
\n", limits->lineWidthGranularity ); + fprintf(out, "\t\t\t\t\t\t
strictLines =
%u
\n", limits->strictLines ); + fprintf(out, "\t\t\t\t\t\t
standardSampleLocations =
%u
\n", limits->standardSampleLocations ); + fprintf(out, "\t\t\t\t\t\t
optimalBufferCopyOffsetAlignment =
0x%" PRIxLEAST64 "
\n", limits->optimalBufferCopyOffsetAlignment ); + fprintf(out, "\t\t\t\t\t\t
optimalBufferCopyRowPitchAlignment =
0x%" PRIxLEAST64 "
\n", limits->optimalBufferCopyRowPitchAlignment ); + fprintf(out, "\t\t\t\t\t\t
nonCoherentAtomSize =
0x%" PRIxLEAST64 "
\n", limits->nonCoherentAtomSize ); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\tVkPhysicalDeviceLimits:\n"); + printf("\t-----------------------\n"); + printf("\t\tmaxImageDimension1D = %u\n", limits->maxImageDimension1D ); + printf("\t\tmaxImageDimension2D = %u\n", limits->maxImageDimension2D ); + printf("\t\tmaxImageDimension3D = %u\n", limits->maxImageDimension3D ); + printf("\t\tmaxImageDimensionCube = %u\n", limits->maxImageDimensionCube ); + printf("\t\tmaxImageArrayLayers = %u\n", limits->maxImageArrayLayers ); + printf("\t\tmaxTexelBufferElements = 0x%" PRIxLEAST32 "\n", limits->maxTexelBufferElements ); + printf("\t\tmaxUniformBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxUniformBufferRange ); + printf("\t\tmaxStorageBufferRange = 0x%" PRIxLEAST32 "\n", limits->maxStorageBufferRange ); + printf("\t\tmaxPushConstantsSize = %u\n", limits->maxPushConstantsSize ); + printf("\t\tmaxMemoryAllocationCount = %u\n", limits->maxMemoryAllocationCount ); + printf("\t\tmaxSamplerAllocationCount = %u\n", limits->maxSamplerAllocationCount ); + printf("\t\tbufferImageGranularity = 0x%" PRIxLEAST64 "\n", limits->bufferImageGranularity ); + printf("\t\tsparseAddressSpaceSize = 0x%" PRIxLEAST64 "\n", limits->sparseAddressSpaceSize ); + printf("\t\tmaxBoundDescriptorSets = %u\n", limits->maxBoundDescriptorSets ); + printf("\t\tmaxPerStageDescriptorSamplers = %u\n", limits->maxPerStageDescriptorSamplers ); + printf("\t\tmaxPerStageDescriptorUniformBuffers = %u\n", limits->maxPerStageDescriptorUniformBuffers ); + printf("\t\tmaxPerStageDescriptorStorageBuffers = %u\n", limits->maxPerStageDescriptorStorageBuffers ); + printf("\t\tmaxPerStageDescriptorSampledImages = %u\n", limits->maxPerStageDescriptorSampledImages ); + printf("\t\tmaxPerStageDescriptorStorageImages = %u\n", limits->maxPerStageDescriptorStorageImages ); + printf("\t\tmaxPerStageDescriptorInputAttachments = %u\n", limits->maxPerStageDescriptorInputAttachments ); + printf("\t\tmaxPerStageResources = %u\n", limits->maxPerStageResources ); + printf("\t\tmaxDescriptorSetSamplers = %u\n", limits->maxDescriptorSetSamplers ); + printf("\t\tmaxDescriptorSetUniformBuffers = %u\n", limits->maxDescriptorSetUniformBuffers ); + printf("\t\tmaxDescriptorSetUniformBuffersDynamic = %u\n", limits->maxDescriptorSetUniformBuffersDynamic ); + printf("\t\tmaxDescriptorSetStorageBuffers = %u\n", limits->maxDescriptorSetStorageBuffers ); + printf("\t\tmaxDescriptorSetStorageBuffersDynamic = %u\n", limits->maxDescriptorSetStorageBuffersDynamic ); + printf("\t\tmaxDescriptorSetSampledImages = %u\n", limits->maxDescriptorSetSampledImages ); + printf("\t\tmaxDescriptorSetStorageImages = %u\n", limits->maxDescriptorSetStorageImages ); + printf("\t\tmaxDescriptorSetInputAttachments = %u\n", limits->maxDescriptorSetInputAttachments ); + printf("\t\tmaxVertexInputAttributes = %u\n", limits->maxVertexInputAttributes ); + printf("\t\tmaxVertexInputBindings = %u\n", limits->maxVertexInputBindings ); + printf("\t\tmaxVertexInputAttributeOffset = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputAttributeOffset ); + printf("\t\tmaxVertexInputBindingStride = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputBindingStride ); + printf("\t\tmaxVertexOutputComponents = %u\n", limits->maxVertexOutputComponents ); + printf("\t\tmaxTessellationGenerationLevel = %u\n", limits->maxTessellationGenerationLevel ); + printf("\t\tmaxTessellationPatchSize = %u\n", limits->maxTessellationPatchSize ); + printf("\t\tmaxTessellationControlPerVertexInputComponents = %u\n", limits->maxTessellationControlPerVertexInputComponents ); + printf("\t\tmaxTessellationControlPerVertexOutputComponents = %u\n", limits->maxTessellationControlPerVertexOutputComponents); + printf("\t\tmaxTessellationControlPerPatchOutputComponents = %u\n", limits->maxTessellationControlPerPatchOutputComponents ); + printf("\t\tmaxTessellationControlTotalOutputComponents = %u\n", limits->maxTessellationControlTotalOutputComponents ); + printf("\t\tmaxTessellationEvaluationInputComponents = %u\n", limits->maxTessellationEvaluationInputComponents ); + printf("\t\tmaxTessellationEvaluationOutputComponents = %u\n", limits->maxTessellationEvaluationOutputComponents ); + printf("\t\tmaxGeometryShaderInvocations = %u\n", limits->maxGeometryShaderInvocations ); + printf("\t\tmaxGeometryInputComponents = %u\n", limits->maxGeometryInputComponents ); + printf("\t\tmaxGeometryOutputComponents = %u\n", limits->maxGeometryOutputComponents ); + printf("\t\tmaxGeometryOutputVertices = %u\n", limits->maxGeometryOutputVertices ); + printf("\t\tmaxGeometryTotalOutputComponents = %u\n", limits->maxGeometryTotalOutputComponents ); + printf("\t\tmaxFragmentInputComponents = %u\n", limits->maxFragmentInputComponents ); + printf("\t\tmaxFragmentOutputAttachments = %u\n", limits->maxFragmentOutputAttachments ); + printf("\t\tmaxFragmentDualSrcAttachments = %u\n", limits->maxFragmentDualSrcAttachments ); + printf("\t\tmaxFragmentCombinedOutputResources = %u\n", limits->maxFragmentCombinedOutputResources ); + printf("\t\tmaxComputeSharedMemorySize = 0x%" PRIxLEAST32 "\n", limits->maxComputeSharedMemorySize ); + printf("\t\tmaxComputeWorkGroupCount[0] = %u\n", limits->maxComputeWorkGroupCount[0] ); + printf("\t\tmaxComputeWorkGroupCount[1] = %u\n", limits->maxComputeWorkGroupCount[1] ); + printf("\t\tmaxComputeWorkGroupCount[2] = %u\n", limits->maxComputeWorkGroupCount[2] ); + printf("\t\tmaxComputeWorkGroupInvocations = %u\n", limits->maxComputeWorkGroupInvocations ); + printf("\t\tmaxComputeWorkGroupSize[0] = %u\n", limits->maxComputeWorkGroupSize[0] ); + printf("\t\tmaxComputeWorkGroupSize[1] = %u\n", limits->maxComputeWorkGroupSize[1] ); + printf("\t\tmaxComputeWorkGroupSize[2] = %u\n", limits->maxComputeWorkGroupSize[2] ); + printf("\t\tsubPixelPrecisionBits = %u\n", limits->subPixelPrecisionBits ); + printf("\t\tsubTexelPrecisionBits = %u\n", limits->subTexelPrecisionBits ); + printf("\t\tmipmapPrecisionBits = %u\n", limits->mipmapPrecisionBits ); + printf("\t\tmaxDrawIndexedIndexValue = %u\n", limits->maxDrawIndexedIndexValue ); + printf("\t\tmaxDrawIndirectCount = %u\n", limits->maxDrawIndirectCount ); + printf("\t\tmaxSamplerLodBias = %f\n", limits->maxSamplerLodBias ); + printf("\t\tmaxSamplerAnisotropy = %f\n", limits->maxSamplerAnisotropy ); + printf("\t\tmaxViewports = %u\n", limits->maxViewports ); + printf("\t\tmaxViewportDimensions[0] = %u\n", limits->maxViewportDimensions[0] ); + printf("\t\tmaxViewportDimensions[1] = %u\n", limits->maxViewportDimensions[1] ); + printf("\t\tviewportBoundsRange[0] =%13f\n", limits->viewportBoundsRange[0] ); + printf("\t\tviewportBoundsRange[1] =%13f\n", limits->viewportBoundsRange[1] ); + printf("\t\tviewportSubPixelBits = %u\n", limits->viewportSubPixelBits ); + printf("\t\tminMemoryMapAlignment = " PRINTF_SIZE_T_SPECIFIER "\n", limits->minMemoryMapAlignment ); + printf("\t\tminTexelBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minTexelBufferOffsetAlignment ); + printf("\t\tminUniformBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minUniformBufferOffsetAlignment ); + printf("\t\tminStorageBufferOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->minStorageBufferOffsetAlignment ); + printf("\t\tminTexelOffset =%3d\n", limits->minTexelOffset ); + printf("\t\tmaxTexelOffset =%3d\n", limits->maxTexelOffset ); + printf("\t\tminTexelGatherOffset =%3d\n", limits->minTexelGatherOffset ); + printf("\t\tmaxTexelGatherOffset =%3d\n", limits->maxTexelGatherOffset ); + printf("\t\tminInterpolationOffset =%9f\n", limits->minInterpolationOffset ); + printf("\t\tmaxInterpolationOffset =%9f\n", limits->maxInterpolationOffset ); + printf("\t\tsubPixelInterpolationOffsetBits = %u\n", limits->subPixelInterpolationOffsetBits ); + printf("\t\tmaxFramebufferWidth = %u\n", limits->maxFramebufferWidth ); + printf("\t\tmaxFramebufferHeight = %u\n", limits->maxFramebufferHeight ); + printf("\t\tmaxFramebufferLayers = %u\n", limits->maxFramebufferLayers ); + printf("\t\tframebufferColorSampleCounts = %u\n", limits->framebufferColorSampleCounts ); + printf("\t\tframebufferDepthSampleCounts = %u\n", limits->framebufferDepthSampleCounts ); + printf("\t\tframebufferStencilSampleCounts = %u\n", limits->framebufferStencilSampleCounts ); + printf("\t\tframebufferNoAttachmentsSampleCounts = %u\n", limits->framebufferNoAttachmentsSampleCounts ); + printf("\t\tmaxColorAttachments = %u\n", limits->maxColorAttachments ); + printf("\t\tsampledImageColorSampleCounts = %u\n", limits->sampledImageColorSampleCounts ); + printf("\t\tsampledImageDepthSampleCounts = %u\n", limits->sampledImageDepthSampleCounts ); + printf("\t\tsampledImageStencilSampleCounts = %u\n", limits->sampledImageStencilSampleCounts ); + printf("\t\tsampledImageIntegerSampleCounts = %u\n", limits->sampledImageIntegerSampleCounts ); + printf("\t\tstorageImageSampleCounts = %u\n", limits->storageImageSampleCounts ); + printf("\t\tmaxSampleMaskWords = %u\n", limits->maxSampleMaskWords ); + printf("\t\ttimestampComputeAndGraphics = %u\n", limits->timestampComputeAndGraphics ); + printf("\t\ttimestampPeriod = %f\n", limits->timestampPeriod ); + printf("\t\tmaxClipDistances = %u\n", limits->maxClipDistances ); + printf("\t\tmaxCullDistances = %u\n", limits->maxCullDistances ); + printf("\t\tmaxCombinedClipAndCullDistances = %u\n", limits->maxCombinedClipAndCullDistances ); + printf("\t\tdiscreteQueuePriorities = %u\n", limits->discreteQueuePriorities ); + printf("\t\tpointSizeRange[0] = %f\n", limits->pointSizeRange[0] ); + printf("\t\tpointSizeRange[1] = %f\n", limits->pointSizeRange[1] ); + printf("\t\tlineWidthRange[0] = %f\n", limits->lineWidthRange[0] ); + printf("\t\tlineWidthRange[1] = %f\n", limits->lineWidthRange[1] ); + printf("\t\tpointSizeGranularity = %f\n", limits->pointSizeGranularity ); + printf("\t\tlineWidthGranularity = %f\n", limits->lineWidthGranularity ); + printf("\t\tstrictLines = %u\n", limits->strictLines ); + printf("\t\tstandardSampleLocations = %u\n", limits->standardSampleLocations ); + printf("\t\toptimalBufferCopyOffsetAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyOffsetAlignment ); + printf("\t\toptimalBufferCopyRowPitchAlignment = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyRowPitchAlignment ); + printf("\t\tnonCoherentAtomSize = 0x%" PRIxLEAST64 "\n", limits->nonCoherentAtomSize ); + } } -static void AppGpuDumpProps(const struct AppGpu *gpu) -{ +static void AppGpuDumpProps(const struct AppGpu *gpu, FILE *out) { const VkPhysicalDeviceProperties *props = &gpu->props; const uint32_t apiVersion=props->apiVersion; const uint32_t major = VK_VERSION_MAJOR(apiVersion); const uint32_t minor = VK_VERSION_MINOR(apiVersion); const uint32_t patch = VK_VERSION_PATCH(apiVersion); - printf("VkPhysicalDeviceProperties:\n"); - printf("===========================\n"); - printf("\tapiVersion = 0x%" PRIxLEAST32 " (%d.%d.%d)\n", apiVersion, major, minor, patch); - printf("\tdriverVersion = %u (0x%" PRIxLEAST32 ")\n",props->driverVersion, props->driverVersion); - printf("\tvendorID = 0x%04x\n", props->vendorID); - printf("\tdeviceID = 0x%04x\n", props->deviceID); - printf("\tdeviceType = %s\n", VkPhysicalDeviceTypeString(props->deviceType)); - printf("\tdeviceName = %s\n", props->deviceName); + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceProperties\n"); + fprintf(out, "\t\t\t\t\t\t
apiVersion =
0x%" PRIxLEAST32 "
(
%d.%d.%d
)
\n", apiVersion, major, minor, patch); + fprintf(out, "\t\t\t\t\t\t
driverVersion =
%u
(
0x%" PRIxLEAST32 "
)
\n", props->driverVersion, props->driverVersion); + fprintf(out, "\t\t\t\t\t\t
vendorID =
0x%04x
\n", props->vendorID); + fprintf(out, "\t\t\t\t\t\t
deviceID =
0x%04x
\n", props->deviceID); + fprintf(out, "\t\t\t\t\t\t
deviceType = %s
\n", VkPhysicalDeviceTypeString(props->deviceType)); + fprintf(out, "\t\t\t\t\t\t
deviceName = %s
\n", props->deviceName); + } else { + printf("VkPhysicalDeviceProperties:\n"); + printf("===========================\n"); + printf("\tapiVersion = 0x%" PRIxLEAST32 " (%d.%d.%d)\n", apiVersion, major, minor, patch); + printf("\tdriverVersion = %u (0x%" PRIxLEAST32 ")\n", props->driverVersion, props->driverVersion); + printf("\tvendorID = 0x%04x\n", props->vendorID); + printf("\tdeviceID = 0x%04x\n", props->deviceID); + printf("\tdeviceType = %s\n", VkPhysicalDeviceTypeString(props->deviceType)); + printf("\tdeviceName = %s\n", props->deviceName); + } + if (html_output) fprintf(out, "\t\t\t\t\t
\n"); - AppDumpLimits(&gpu->props.limits); - AppDumpSparseProps(&gpu->props.sparseProperties); + AppDumpLimits(&gpu->props.limits, out); + AppDumpSparseProps(&gpu->props.sparseProperties, out); - fflush(stdout); + fflush(out); } -// clang-format on static void AppDumpExtensions(const char *indent, const char *layer_name, const uint32_t extension_count, - const VkExtensionProperties *extension_properties) { + const VkExtensionProperties *extension_properties, FILE *out) { uint32_t i; + + if (html_output) fprintf(out, "\t\t\t%s
", indent); if (layer_name && (strlen(layer_name) > 0)) { - printf("%s%s Extensions", indent, layer_name); + if (html_output) { + fprintf(out, "%s Extensions", layer_name); + } else { + printf("%s%s Extensions", indent, layer_name); + } + } else { + fprintf(out, "%sExtensions", indent); + } + if (html_output) { + fprintf(out, "\tcount =
%d
", extension_count); + if (extension_count > 0) fprintf(out, "\n"); } else { - printf("%sExtensions", indent); + printf("\tcount = %d\n", extension_count); } - printf("\tcount = %d\n", extension_count); + for (i = 0; i < extension_count; i++) { VkExtensionProperties const *ext_prop = &extension_properties[i]; - printf("%s\t", indent); - printf("%-36s: extension revision %2d\n", ext_prop->extensionName, ext_prop->specVersion); + if (html_output) { + fprintf(out, "\t\t\t\t%s
", indent); + fprintf(out, "
%s
: extension revision
%d
", ext_prop->extensionName, + ext_prop->specVersion); + fprintf(out, "
\n"); + } else { + printf("%s\t", indent); + printf("%-36s: extension revision %2d\n", ext_prop->extensionName, ext_prop->specVersion); + } } - fflush(stdout); + if (html_output) { + if (extension_count > 0) { + fprintf(out, "\t\t\t%s
\n", indent); + } else { + fprintf(out, "\n"); + } + } + + fflush(out); } -static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id) { +static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *out) { const VkQueueFamilyProperties *props = &gpu->queue_props[id]; - printf("VkQueueFamilyProperties[%d]:\n", id); - printf("===========================\n"); + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkQueueFamilyProperties[
%d
]
\n", id); + fprintf(out, "\t\t\t\t\t\t
queueFlags = "); + } else { + printf("VkQueueFamilyProperties[%d]:\n", id); + printf("===========================\n"); + printf("\tqueueFlags = "); + } + char *sep = ""; // separator character - printf("\tqueueFlags = "); if (props->queueFlags & VK_QUEUE_GRAPHICS_BIT) { - printf("GRAPHICS"); + fprintf(out, "GRAPHICS"); sep = " | "; } if (props->queueFlags & VK_QUEUE_COMPUTE_BIT) { - printf("%sCOMPUTE", sep); + fprintf(out, "%sCOMPUTE", sep); sep = " | "; } if (props->queueFlags & VK_QUEUE_TRANSFER_BIT) { - printf("%sTRANSFER", sep); + fprintf(out, "%sTRANSFER", sep); sep = " | "; } if (props->queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) { - printf("%sSPARSE", sep); + fprintf(out, "%sSPARSE", sep); + } + if (html_output) { + fprintf(out, "
\n"); + fprintf(out, "\t\t\t\t\t\t
queueCount =
%u
\n", props->queueCount); + fprintf(out, "\t\t\t\t\t\t
timestampValidBits =
%u
\n", props->timestampValidBits); + fprintf(out, "\t\t\t\t\t\t
minImageTransferGranularity = (
%d
,
%d
,
%d
)
\n", props->minImageTransferGranularity.width, + props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth); + fprintf(out, "\t\t\t\t\t
\n"); + } else { + printf("\n"); + printf("\tqueueCount = %u\n", props->queueCount); + printf("\ttimestampValidBits = %u\n", props->timestampValidBits); + printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props->minImageTransferGranularity.width, + props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth); } - printf("\n"); - printf("\tqueueCount = %u\n", props->queueCount); - printf("\ttimestampValidBits = %u\n", props->timestampValidBits); - printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props->minImageTransferGranularity.width, - props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth); - fflush(stdout); + fflush(out); } // This prints a number of bytes in a human-readable format according to prefixes of the International System of Quantities (ISQ), @@ -1554,64 +2125,137 @@ static char *HumanReadable(const size_t sz) { return strndup(buf, kBufferSize); } -static void AppGpuDumpMemoryProps(const struct AppGpu *gpu) { +static void AppGpuDumpMemoryProps(const struct AppGpu *gpu, FILE *out) { const VkPhysicalDeviceMemoryProperties *props = &gpu->memory_props; - printf("VkPhysicalDeviceMemoryProperties:\n"); - printf("=================================\n"); - printf("\tmemoryTypeCount = %u\n", props->memoryTypeCount); + if (html_output) { + fprintf(out, "\t\t\t\t\t
VkPhysicalDeviceMemoryProperties\n"); + fprintf(out, "\t\t\t\t\t\t
memoryTypeCount =
%u
", props->memoryTypeCount); + if (props->memoryTypeCount > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
\n"); + } + } else { + printf("VkPhysicalDeviceMemoryProperties:\n"); + printf("=================================\n"); + printf("\tmemoryTypeCount = %u\n", props->memoryTypeCount); + } for (uint32_t i = 0; i < props->memoryTypeCount; i++) { - printf("\tmemoryTypes[%u] :\n", i); - printf("\t\theapIndex = %u\n", props->memoryTypes[i].heapIndex); - printf("\t\tpropertyFlags = 0x%" PRIxLEAST32 ":\n", props->memoryTypes[i].propertyFlags); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
memoryTypes[
%u
]
\n", i); + fprintf(out, "\t\t\t\t\t\t\t\t
heapIndex =
%u
\n", props->memoryTypes[i].heapIndex); + fprintf(out, "\t\t\t\t\t\t\t\t
propertyFlags =
0x%" PRIxLEAST32 "
", props->memoryTypes[i].propertyFlags); + if (props->memoryTypes[i].propertyFlags == 0) { + fprintf(out, "
\n"); + } else { + fprintf(out, "\n"); + } + } else { + printf("\tmemoryTypes[%u] :\n", i); + printf("\t\theapIndex = %u\n", props->memoryTypes[i].heapIndex); + printf("\t\tpropertyFlags = 0x%" PRIxLEAST32 ":\n", props->memoryTypes[i].propertyFlags); + } - // Print each named flag, if it is set. + // Print each named flag, if it is set VkFlags flags = props->memoryTypes[i].propertyFlags; -#define PRINT_FLAG(FLAG) \ - if (flags & FLAG) printf("\t\t\t" #FLAG "\n"); - PRINT_FLAG(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_HOST_CACHED_BIT) - PRINT_FLAG(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) -#undef PRINT_FLAG - } - printf("\n"); - printf("\tmemoryHeapCount = %u\n", props->memoryHeapCount); + if (html_output) { + if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_HOST_CACHED_BIT
\n"); } + if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t
VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
\n"); } + if (props->memoryTypes[i].propertyFlags > 0) fprintf(out, "\t\t\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t\t\t
\n"); + } else { + if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_VISIBLE_BIT\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_COHERENT_BIT\n"); } + if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_CACHED_BIT\n"); } + if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT\n"); } + } + } + + if (props->memoryTypeCount > 0) fprintf(out, "\t\t\t\t\t\t\n"); + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
memoryHeapCount =
%u
", props->memoryHeapCount); + if (props->memoryTypeCount > 0) fprintf(out, "\n"); + } else { + printf("\tmemoryHeapCount = %u\n", props->memoryHeapCount); + } for (uint32_t i = 0; i < props->memoryHeapCount; i++) { - printf("\tmemoryHeaps[%u] :\n", i); const VkDeviceSize memSize = props->memoryHeaps[i].size; char *mem_size_human_readable = HumanReadable((const size_t)memSize); - printf("\t\tsize = " PRINTF_SIZE_T_SPECIFIER " (0x%" PRIxLEAST64 ") (%s)\n", (size_t)memSize, memSize, - mem_size_human_readable); + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t
memoryHeaps[
%u
]
\n", i); + fprintf(out, "\t\t\t\t\t\t\t\t
size =
" PRINTF_SIZE_T_SPECIFIER "
(
0x%" PRIxLEAST64 "
) (
%s
)
\n", + (size_t)memSize, memSize, mem_size_human_readable); + } else { + printf("\tmemoryHeaps[%u] :\n", i); + printf("\t\tsize = " PRINTF_SIZE_T_SPECIFIER " (0x%" PRIxLEAST64 ") (%s)\n", (size_t)memSize, memSize, + mem_size_human_readable); + } free(mem_size_human_readable); VkMemoryHeapFlags heap_flags = props->memoryHeaps[i].flags; - printf("\t\tflags:\n\t\t\t"); - printf((heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT\n" : "None\n"); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t\t\t
flags\n"); + fprintf(out, "\t\t\t\t\t\t\t\t\t
"); + fprintf(out, (heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "
VK_MEMORY_HEAP_DEVICE_LOCAL_BIT
" : "None"); + fprintf(out, "
\n"); + fprintf(out, "\t\t\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t\t\t
\n"); + } else { + printf("\t\tflags:\n\t\t\t"); + printf((heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT\n" : "None\n"); + } } - fflush(stdout); + + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
\n"); + fprintf(out, "\t\t\t\t\t\n"); + } + + fflush(out); } +// clang-format on -static void AppGpuDump(const struct AppGpu *gpu) { +static void AppGpuDump(const struct AppGpu *gpu, FILE *out) { uint32_t i; - printf("\nDevice Properties and Extensions :\n"); - printf("==================================\n"); - printf("GPU%u\n", gpu->id); - AppGpuDumpProps(gpu); - printf("\n"); - AppDumpExtensions("", "Device", gpu->device_extension_count, gpu->device_extensions); - printf("\n"); - for (i = 0; i < gpu->queue_count; i++) { - AppGpuDumpQueueProps(gpu, i); + if (html_output) { + fprintf(out, "\t\t\t
Device Properties and Extensions\n"); + fprintf(out, "\t\t\t\t
GPU%u\n", gpu->id); + } else { + printf("\nDevice Properties and Extensions :\n"); + printf("==================================\n"); + printf("GPU%u\n", gpu->id); + } + + AppGpuDumpProps(gpu, out); + if (html_output) { + AppDumpExtensions("\t\t", "Device", gpu->device_extension_count, gpu->device_extensions, out); + } else { + printf("\n"); + AppDumpExtensions("", "Device", gpu->device_extension_count, gpu->device_extensions, out); printf("\n"); } - AppGpuDumpMemoryProps(gpu); - printf("\n"); - AppGpuDumpFeatures(gpu); - printf("\n"); - AppDevDump(&gpu->dev); + + for (i = 0; i < gpu->queue_count; i++) { + AppGpuDumpQueueProps(gpu, i, out); + if (!html_output) printf("\n"); + } + AppGpuDumpMemoryProps(gpu, out); + if (!html_output) printf("\n"); + AppGpuDumpFeatures(gpu, out); + if (!html_output) printf("\n"); + AppDevDump(&gpu->dev, out); + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + fprintf(out, "\t\t\t
\n"); + } } #ifdef _WIN32 @@ -1646,6 +2290,7 @@ int main(int argc, char **argv) { uint32_t gpu_count; VkResult err; struct AppInstance inst; + FILE *out = stdout; #ifdef _WIN32 if (ConsoleIsExclusive()) ConsoleEnlarge(); @@ -1654,17 +2299,37 @@ int main(int argc, char **argv) { vulkan_major = VK_VERSION_MAJOR(VK_API_VERSION_1_0); vulkan_minor = VK_VERSION_MINOR(VK_API_VERSION_1_0); vulkan_patch = VK_VERSION_PATCH(VK_HEADER_VERSION); + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "--html") == 0) { + out = fopen("vulkaninfo.html", "w"); + html_output = true; + continue; + } + } - printf("===========\n"); - printf("VULKAN INFO\n"); - printf("===========\n\n"); - printf("Vulkan API Version: %d.%d.%d\n\n", vulkan_major, vulkan_minor, vulkan_patch); + if (html_output) { + PrintHtmlHeader(out); + fprintf(out, "\t\t\t
"); + } else { + printf("===========\n"); + printf("VULKAN INFO\n"); + printf("===========\n\n"); + } + fprintf(out, "Vulkan API Version: "); + if (html_output) { + fprintf(out, "
%d.%d.%d
\n", vulkan_major, vulkan_minor, vulkan_patch); + fprintf(out, "\t\t\t
\n"); + } else { + printf("%d.%d.%d\n\n", vulkan_major, vulkan_minor, vulkan_patch); + } AppCreateInstance(&inst); - printf("\nInstance Extensions:\n"); - printf("====================\n"); - AppDumpExtensions("", "Instance", inst.global_extension_count, inst.global_extensions); + if (!html_output) { + printf("Instance Extensions:\n"); + printf("====================\n"); + } + AppDumpExtensions("", "Instance", inst.global_extension_count, inst.global_extensions, out); err = vkEnumeratePhysicalDevices(inst.instance, &gpu_count, NULL); if (err) ERR_EXIT(err); @@ -1677,12 +2342,20 @@ int main(int argc, char **argv) { if (!gpus) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); for (uint32_t i = 0; i < gpu_count; i++) { AppGpuInit(&gpus[i], &inst, i, objs[i]); - printf("\n\n"); + if (!html_output) printf("\n\n"); } //---Layer-Device-Extensions--- - printf("Layers: count = %d\n", inst.global_layer_count); - printf("=======\n"); + if (html_output) { + fprintf(out, "\t\t\t
Layers: count =
%d
", inst.global_layer_count); + if (inst.global_layer_count > 0) { + fprintf(out, "\n"); + } + } else { + printf("Layers: count = %d\n", inst.global_layer_count); + printf("=======\n"); + } + for (uint32_t i = 0; i < inst.global_layer_count; i++) { uint32_t layer_major, layer_minor, layer_patch; char spec_version[64], layer_version[64]; @@ -1691,28 +2364,69 @@ int main(int argc, char **argv) { ExtractVersion(layer_prop->specVersion, &layer_major, &layer_minor, &layer_patch); snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", layer_major, layer_minor, layer_patch); snprintf(layer_version, sizeof(layer_version), "%d", layer_prop->implementationVersion); - printf("%s (%s) Vulkan version %s, layer version %s\n", layer_prop->layerName, (char *)layer_prop->description, - spec_version, layer_version); - AppDumpExtensions("\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties); + if (html_output) { + fprintf(out, "\t\t\t\t
"); + fprintf(out, "
%s
(%s) Vulkan version
%s
, ", layer_prop->layerName, + (char *)layer_prop->description, spec_version); + fprintf(out, "layer version
%s
\n", layer_version); + AppDumpExtensions("\t\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties, + out); + } else { + printf("%s (%s) Vulkan version %s, layer version %s\n", layer_prop->layerName, (char *) layer_prop->description, + spec_version, layer_version); + AppDumpExtensions("\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties, + out); + } char *layer_name = inst.global_layers[i].layer_properties.layerName; - printf("\tDevices \tcount = %d\n", gpu_count); + + if (html_output) { + fprintf(out, "\t\t\t\t\t
Devices count =
%d
\n", gpu_count); + } else { + printf("\tDevices \tcount = %d\n", gpu_count); + } for (uint32_t j = 0; j < gpu_count; j++) { - printf("\t\tGPU id : %u (%s)\n", j, gpus[j].props.deviceName); + if (html_output) { + fprintf(out, "\t\t\t\t\t\t
"); + fprintf(out, "GPU id:
%u
(%s)
\n", j, gpus[j].props.deviceName); + } else { + printf("\t\tGPU id : %u (%s)\n", j, gpus[j].props.deviceName); + } uint32_t count = 0; VkExtensionProperties *props; AppGetPhysicalDeviceLayerExtensions(&gpus[j], layer_name, &count, &props); - AppDumpExtensions("\t\t", "Layer-Device", count, props); + if (html_output) { + AppDumpExtensions("\t\t\t", "Layer-Device", count, props, out); + } else { + AppDumpExtensions("\t\t", "Layer-Device", count, props, out); + } + if (html_output) { fprintf(out, "\t\t\t\t\t
\n"); } free(props); } - printf("\n"); + if (html_output) { + fprintf(out, "\t\t\t\t
\n"); + } else { + printf("\n"); + } } - fflush(stdout); + + if (html_output) { fprintf(out, "\t\t\t
\n"); } + + fflush(out); //----------------------------- - printf("Presentable Surfaces:\n"); - printf("=====================\n"); + if (html_output) { + fprintf(out, "\t\t\t
Presentable Surfaces"); + if (gpu_count > 0) { + fprintf(out, "\n"); + } else { + fprintf(out, "
\n"); + } + } else { + printf("Presentable Surfaces:\n"); + printf("=====================\n"); + } inst.width = 256; inst.height = 256; int format_count = 0; @@ -1725,17 +2439,25 @@ int main(int argc, char **argv) { exit(1); } #endif + //--WIN32-- #ifdef VK_USE_PLATFORM_WIN32_KHR if (CheckExtensionEnabled(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) { AppCreateWin32Window(&inst); for (uint32_t i = 0; i < gpu_count; i++) { AppCreateWin32Surface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + } else { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyWin32Window(&inst); @@ -1746,11 +2468,18 @@ int main(int argc, char **argv) { AppCreateXcbWindow(&inst); for (uint32_t i = 0; i < gpu_count; i++) { AppCreateXcbSurface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_XCB_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_XCB_SURFACE_EXTENSION_NAME); + } else { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_XCB_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyXcbWindow(&inst); @@ -1761,22 +2490,42 @@ int main(int argc, char **argv) { AppCreateXlibWindow(&inst); for (uint32_t i = 0; i < gpu_count; i++) { AppCreateXlibSurface(&inst); - printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); - printf("Surface type : %s\n", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); - format_count += AppDumpSurfaceFormats(&inst, &gpus[i]); - present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i]); - AppDumpSurfaceCapabilities(&inst, &gpus[i]); + if (html_output) { + fprintf(out, "\t\t\t\t
GPU id :
%u
(%s)
\n", i, + gpus[i].props.deviceName); + fprintf(out, "\t\t\t\t
Surface type :
%s
\n", + VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + } else { + printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName); + printf("Surface type : %s\n", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + } + format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out); + present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out); + AppDumpSurfaceCapabilities(&inst, &gpus[i], out); AppDestroySurface(&inst); } AppDestroyXlibWindow(&inst); } #endif + // TODO: Android / Wayland / MIR - if (!format_count && !present_mode_count) printf("None found\n"); + if (!format_count && !present_mode_count) { + if (html_output) { + fprintf(out, "\t\t\t\t
None found
\n"); + } else { + printf( "None found\n"); + } + } + + if (html_output) { + fprintf(out, "\t\t\t\n"); + } else { + printf("\n"); + } //--------- for (uint32_t i = 0; i < gpu_count; i++) { - AppGpuDump(&gpus[i]); + AppGpuDump(&gpus[i], out); printf("\n\n"); } @@ -1786,10 +2535,15 @@ int main(int argc, char **argv) { AppDestroyInstance(&inst); - fflush(stdout); + fflush(out); #ifdef _WIN32 - if (ConsoleIsExclusive()) Sleep(INFINITE); + if (ConsoleIsExclusive() && !html_output) Sleep(INFINITE); #endif + if (html_output) { + PrintHtmlFooter(out); + fclose(out); + } + return 0; }