Module: Mesa
Branch: master
Commit: b3e2ce058071a0e104ccdcbb705de2942360a29a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3e2ce058071a0e104ccdcbb705de2942360a29a

Author: Chad Versace <chadvers...@chromium.org>
Date:   Fri Nov  3 16:26:51 2017 -0700

anv: Simplify anv_get_image_format_properties()

Now that get_image_format_features() has a VkImageTiling parameter, we
can bypass anv_physical_device_get_format_properties() and call
get_image_format_features() directly.

Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>

---

 src/intel/vulkan/anv_formats.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index bd34e1ffab..6ecd32b532 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -713,30 +713,19 @@ anv_get_image_format_properties(
    VkImageFormatProperties *pImageFormatProperties,
    VkSamplerYcbcrConversionImageFormatPropertiesKHR 
*pYcbcrImageFormatProperties)
 {
-   VkFormatProperties format_props;
    VkFormatFeatureFlags format_feature_flags;
    VkExtent3D maxExtent;
    uint32_t maxMipLevels;
    uint32_t maxArraySize;
    VkSampleCountFlags sampleCounts = VK_SAMPLE_COUNT_1_BIT;
+   const struct gen_device_info *devinfo = &physical_device->info;
    const struct anv_format *format = anv_get_format(info->format);
 
    if (format == NULL)
       goto unsupported;
 
-   anv_physical_device_get_format_properties(physical_device, info->format,
-                                             &format_props);
-
-   /* Extract the VkFormatFeatureFlags that are relevant for the queried
-    * tiling.
-    */
-   if (info->tiling == VK_IMAGE_TILING_LINEAR) {
-      format_feature_flags = format_props.linearTilingFeatures;
-   } else if (info->tiling == VK_IMAGE_TILING_OPTIMAL) {
-      format_feature_flags = format_props.optimalTilingFeatures;
-   } else {
-      unreachable("bad VkImageTiling");
-   }
+   format_feature_flags = get_image_format_features(devinfo, info->format,
+                                                    format, info->tiling);
 
    switch (info->type) {
    default:

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to