Monado OpenXR Runtime
vk_print.c File Reference

Printing helper code. More...

#include "util/u_pretty_print.h"
#include "vk/vk_helpers.h"
Include dependency graph for vk_print.c:

Macros

#define P(...)   u_pp(dg, __VA_ARGS__)
 
#define PNT(...)   u_pp(dg, "\n\t" __VA_ARGS__)
 
#define PNTT(...)   u_pp(dg, "\n\t\t" __VA_ARGS__)
 
#define PRINT_BITS(BITS, FUNC)
 

Functions

void vk_print_result (struct vk_bundle *vk, const char *file, int line, const char *calling_func, VkResult ret, const char *called_func)
 Print the result of a function, info level if ret == VK_SUCCESS and error level otherwise. More...
 
void vk_print_device_info (struct vk_bundle *vk, enum u_logging_level log_level, const VkPhysicalDeviceProperties *pdp, uint32_t gpu_index, const char *title)
 Print device information to the logger at the given logging level, if the vk_bundle has that level enabled. More...
 
void vk_print_opened_device_info (struct vk_bundle *vk, enum u_logging_level log_level)
 Print device information about the device that bundle manages at the given logging level if the vk_bundle has that level enabled. More...
 
void vk_print_features_info (struct vk_bundle *vk, enum u_logging_level log_level)
 Print device features to the logger at the given logging level, if the vk_bundle has that level enabled. More...
 
void vk_print_external_handles_info (struct vk_bundle *vk, enum u_logging_level log_level)
 Print external handle features to the logger at the given logging level, if the vk_bundle has that level enabled. More...
 
void vk_print_swapchain_create_info (struct vk_bundle *vk, VkSwapchainCreateInfoKHR *i, enum u_logging_level log_level)
 Print a VkSwapchainCreateInfoKHR, used to log during creation. More...
 

Detailed Description

Macro Definition Documentation

◆ PRINT_BITS

#define PRINT_BITS (   BITS,
  FUNC 
)
Value:
do { \
for (uint32_t index = 0; index < 32; index++) { \
uint32_t bit = (BITS) & (1u << index); \
if (!bit) { \
continue; \
} \
const char *str = FUNC(bit, true); \
if (str != NULL) { \
PNTT("%s", str); \
} else { \
PNTT("0x%08x", bit); \
} \
} \
} while (false)

Function Documentation

◆ vk_print_external_handles_info()

void vk_print_external_handles_info ( struct vk_bundle vk,
enum u_logging_level  log_level 
)

Print external handle features to the logger at the given logging level, if the vk_bundle has that level enabled.

◆ vk_print_features_info()

void vk_print_features_info ( struct vk_bundle vk,
enum u_logging_level  log_level 
)

Print device features to the logger at the given logging level, if the vk_bundle has that level enabled.

◆ vk_print_swapchain_create_info()

void vk_print_swapchain_create_info ( struct vk_bundle vk,
VkSwapchainCreateInfoKHR *  i,
enum u_logging_level  log_level 
)

Print a VkSwapchainCreateInfoKHR, used to log during creation.