[Mesa-dev] [PATCH 2/4] anv/image: Simplify initialization of the isl_tiling

Nanley Chery nanleychery at gmail.com
Mon Jun 27 23:35:26 UTC 2016


Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/intel/vulkan/anv_image.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 77d9931..b3f5f5c 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -120,10 +120,6 @@ make_surface(const struct anv_device *dev,
       [VK_IMAGE_TYPE_3D] = ISL_SURF_DIM_3D,
    };
 
-   isl_tiling_flags_t tiling_flags = anv_info->isl_tiling_flags;
-   if (vk_info->tiling == VK_IMAGE_TILING_LINEAR)
-      tiling_flags = ISL_TILING_LINEAR_BIT;
-
    struct anv_surface *anv_surf = get_surface(image, aspect);
 
    image->extent = anv_sanitize_image_extent(vk_info->imageType,
@@ -142,7 +138,7 @@ make_surface(const struct anv_device *dev,
       .min_alignment = 0,
       .min_pitch = anv_info->stride,
       .usage = choose_isl_surf_usage(image->usage, aspect),
-      .tiling_flags = tiling_flags);
+      .tiling_flags = anv_info->isl_tiling_flags);
 
    /* isl_surf_init() will fail only if provided invalid input. Invalid input
     * is illegal in Vulkan.
@@ -260,7 +256,9 @@ anv_CreateImage(VkDevice device,
    return anv_image_create(device,
       &(struct anv_image_create_info) {
          .vk_info = pCreateInfo,
-         .isl_tiling_flags = ISL_TILING_ANY_MASK,
+         .isl_tiling_flags = (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) ?
+                             ISL_TILING_LINEAR_BIT : ISL_TILING_ANY_MASK,
+
       },
       pAllocator,
       pImage);
-- 
2.9.0



More information about the mesa-dev mailing list