vk/formats: Add a name to the metadata and better logging
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 2 Jun 2015 18:03:22 +0000 (11:03 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 2 Jun 2015 18:30:39 +0000 (11:30 -0700)
src/vulkan/formats.c
src/vulkan/private.h

index fb491d0732798e37e6b73a1fd8ddbd43e14f3718..c5e52c47b5f0f4e4734f7543721cc83aff4c539c 100644 (file)
@@ -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,
index 5ae39cf7cc920ab9683df849537b3b0d94c24a08..1a6c3e0ca2f7d83e9208cb8b311672ff585bb825 100644 (file)
@@ -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;