summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-15 21:15:59 -0700
committerJason Ekstrand <[email protected]>2016-05-17 12:17:22 -0700
commit8ed429a4f0d58eafe3e3212552af6fb0cb78feeb (patch)
tree0d0d24253ce01f136b6b8b0a394a970753fed33f /src/intel/vulkan/anv_private.h
parent13f5cee663f693bc2cafeda9c3d6fc3537334dde (diff)
anv/formats: Add an anv_get_format helper
This commit removes anv_format_for_vk_format and adds an anv_get_format helper. The anv_get_format helper returns the anv_format by-value. Unlike anv_format_for_vk_format the format returned by anv_get_format is 100% accurate and includes any tweaks needed for tiled vs. linear. anv_get_isl_format is now just a wrapper around anv_get_format that picks off just the isl_format.
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index bcf34755a97..040d0c7806b 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1518,12 +1518,16 @@ struct anv_format {
struct anv_format_swizzle swizzle;
};
-const struct anv_format *
-anv_format_for_vk_format(VkFormat format);
+struct anv_format
+anv_get_format(VkFormat format, VkImageAspectFlags aspect,
+ VkImageTiling tiling);
-enum isl_format
-anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect,
- VkImageTiling tiling, struct anv_format_swizzle *swizzle);
+static inline enum isl_format
+anv_get_isl_format(VkFormat vk_format, VkImageAspectFlags aspect,
+ VkImageTiling tiling)
+{
+ return anv_get_format(vk_format, aspect, tiling).isl_format;
+}
/**
* Subsurface of an anv_image.