From: Chad Versace Date: Mon, 17 Aug 2015 19:52:09 +0000 (-0700) Subject: vk: Store the original VkFormat in anv_format X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ae42c83ec46be3e200120e928a8060628a45bb6;p=mesa.git vk: Store the original VkFormat in anv_format Store the original VkFormat as anv_format::vk_format. This will be used to reduce format indirection, such as lookups into the VkFormat -> anv_format translation table. --- diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c index 3cbcff5730f..1d1d1bbe135 100644 --- a/src/vulkan/anv_formats.c +++ b/src/vulkan/anv_formats.c @@ -26,7 +26,7 @@ #define UNSUPPORTED 0xffff #define fmt(__vk_fmt, ...) \ - [__vk_fmt] = { .name = #__vk_fmt, __VA_ARGS__ } + [__vk_fmt] = { .vk_format = __vk_fmt, .name = #__vk_fmt, __VA_ARGS__ } static const struct anv_format anv_formats[] = { fmt(VK_FORMAT_UNDEFINED, RAW, .cpp = 1, .num_channels = 1), diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index a94dd63b6ae..dc14dd2818a 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -870,6 +870,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 VkFormat vk_format; const char *name; uint16_t surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */ uint8_t cpp; /**< Bytes-per-pixel of anv_format::surface_format. */