From: Jason Ekstrand Date: Tue, 2 Jun 2015 18:03:22 +0000 (-0700) Subject: vk/formats: Add a name to the metadata and better logging X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e702197e3fdc46f3dea72211cbde4a9812371d9f;p=mesa.git vk/formats: Add a name to the metadata and better logging --- diff --git a/src/vulkan/formats.c b/src/vulkan/formats.c index fb491d07327..c5e52c47b5f 100644 --- a/src/vulkan/formats.c +++ b/src/vulkan/formats.c @@ -26,7 +26,7 @@ #define UNSUPPORTED 0xffff #define fmt(__vk_fmt, ...) \ - [VK_FORMAT_##__vk_fmt] = { __VA_ARGS__ } + [VK_FORMAT_##__vk_fmt] = { .name = "VK_FORMAT_" #__vk_fmt, __VA_ARGS__ } static const struct anv_format anv_formats[] = { fmt(UNDEFINED, .format = RAW, .cpp = 1, .channels = 1), @@ -234,6 +234,18 @@ struct surface_format_info { extern const struct surface_format_info surface_formats[]; +VkResult anv_validate_GetFormatInfo( + VkDevice _device, + VkFormat _format, + VkFormatInfoType infoType, + size_t* pDataSize, + void* pData) +{ + const struct anv_format *format = anv_format_for_vk_format(_format); + fprintf(stderr, "vkGetFormatInfo(%s)\n", format->name); + return anv_GetFormatInfo(_device, _format, infoType, pDataSize, pData); +} + VkResult anv_GetFormatInfo( VkDevice _device, VkFormat _format, diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 5ae39cf7cc9..1a6c3e0ca2f 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -716,6 +716,7 @@ int anv_compiler_run(struct anv_compiler *compiler, struct anv_pipeline *pipelin void anv_compiler_free(struct anv_pipeline *pipeline); struct anv_format { + const char * name; uint16_t format; uint8_t cpp; uint8_t channels;