[Mesa-dev] [PATCH 03/13] anv: Add func anv_get_raw_format()
Chad Versace
chadversary at chromium.org
Mon Mar 6 20:40:12 UTC 2017
Like anv_get_format(), but the returned format is not adjusted, not even
for the aspect.
Add anv_get_raw_isl_format() too, to match anv_get_isl_format().
---
src/intel/vulkan/anv_formats.c | 7 +++++++
src/intel/vulkan/anv_private.h | 8 ++++++++
2 files changed, 15 insertions(+)
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 4c930eda1dd..eade36eaf6f 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -251,6 +251,13 @@ static const struct anv_format anv_formats[] = {
#undef fmt
+/** Like anv_get_format(), except the returned format is not adjusted. */
+struct anv_format
+anv_get_raw_format(const struct gen_device_info *devinfo, VkFormat vk_format)
+{
+ return anv_formats[vk_format];
+}
+
/**
* Exactly one bit must be set in \a aspect.
*/
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 6661fb69134..60b05186c19 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1676,10 +1676,18 @@ struct anv_format {
struct isl_swizzle swizzle;
};
+struct anv_format ATTRIBUTE_PURE
+anv_get_raw_format(const struct gen_device_info *devinfo, VkFormat vk_format);
+
struct anv_format
anv_get_format(const struct gen_device_info *devinfo, VkFormat format,
VkImageAspectFlags aspect, VkImageTiling tiling);
+static inline enum isl_format ATTRIBUTE_PURE
+anv_get_raw_isl_format(const struct gen_device_info *devinfo, VkFormat vk_format) {
+ return anv_get_raw_format(devinfo, vk_format).isl_format;
+}
+
static inline enum isl_format
anv_get_isl_format(const struct gen_device_info *devinfo, VkFormat vk_format,
VkImageAspectFlags aspect, VkImageTiling tiling)
--
2.12.0
More information about the mesa-dev
mailing list