anv/formats: Add a tiling parameter to get_isl_format
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 1 Jan 2016 02:31:31 +0000 (18:31 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Jan 2016 00:08:05 +0000 (16:08 -0800)
Currently, this parameter does nothing.

src/vulkan/anv_formats.c
src/vulkan/anv_image.c
src/vulkan/anv_meta.c
src/vulkan/anv_private.h
src/vulkan/gen7_pipeline.c
src/vulkan/gen8_pipeline.c

index 6465fabd5b559e98390374a4645362ab068447b6..7aacc4f94d214ddc4fcbfb36527d550628b8efcd 100644 (file)
@@ -237,7 +237,8 @@ anv_format_for_vk_format(VkFormat format)
  * Exactly one bit must be set in \a aspect.
  */
 enum isl_format
-anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect)
+anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect,
+                   VkImageTiling tiling)
 {
    const struct anv_format *anv_fmt = &anv_formats[format];
 
index 1cb860f75f5df8013d4528d6e5690291094ebb4d..5a9f826ec435b777a93442df5c48e16c17291ddd 100644 (file)
@@ -133,7 +133,7 @@ make_surface(const struct anv_device *dev,
 
    ok = isl_surf_init(&dev->isl_dev, &anv_surf->isl,
       .dim = vk_to_isl_surf_dim[vk_info->imageType],
-      .format = anv_get_isl_format(vk_info->format, aspect),
+      .format = anv_get_isl_format(vk_info->format, aspect, vk_info->tiling),
       .width = vk_info->extent.width,
       .height = vk_info->extent.height,
       .depth = vk_info->extent.depth,
index a435c26ee592040245a360b8de5f42dade0f2cf9..bb37899ce3756f59de80b2cfcd96c36fe16162ee 100644 (file)
@@ -877,7 +877,8 @@ choose_buffer_format(struct anv_image *image, VkImageAspectFlagBits aspect)
     * an RGB format here even if the tiled image is RGBA. XXX: This doesn't
     * work if the buffer is the destination.
     */
-   enum isl_format linear_format = anv_get_isl_format(image->vk_format, aspect);
+   enum isl_format linear_format = anv_get_isl_format(image->vk_format, aspect,
+                                                      VK_IMAGE_TILING_LINEAR);
 
    return vk_format_for_size(isl_format_layouts[linear_format].bs);
 }
index 187a6e822b2e2e55c491866ae217c7f52e3df1e4..d915f6943477a085d72d27b82d33568ec3000a5d 100644 (file)
@@ -1415,7 +1415,8 @@ const struct anv_format *
 anv_format_for_vk_format(VkFormat format);
 
 enum isl_format
-anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect);
+anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect,
+                   VkImageTiling tiling);
 
 static inline bool
 anv_format_is_color(const struct anv_format *format)
index f40707437109c4a3a8ac20694a1826f7b9fddcea..7dedcac08af98a7612061c05fbbe8d8209492c08 100644 (file)
@@ -74,7 +74,8 @@ emit_vertex_input(struct anv_pipeline *pipeline,
       const VkVertexInputAttributeDescription *desc =
          &info->pVertexAttributeDescriptions[i];
       enum isl_format format = anv_get_isl_format(desc->format,
-                                                  VK_IMAGE_ASPECT_COLOR_BIT);
+                                                  VK_IMAGE_ASPECT_COLOR_BIT,
+                                                  VK_IMAGE_TILING_LINEAR);
 
       assert(desc->binding < 32);
 
index 827a013ebdcfdde1563ed2cfecc7226f3ed364cc..a405d290d50c2cb52fcdfe35751c96c747765228 100644 (file)
@@ -70,7 +70,8 @@ emit_vertex_input(struct anv_pipeline *pipeline,
       const VkVertexInputAttributeDescription *desc =
          &info->pVertexAttributeDescriptions[i];
       enum isl_format format = anv_get_isl_format(desc->format,
-                                                  VK_IMAGE_ASPECT_COLOR_BIT);
+                                                  VK_IMAGE_ASPECT_COLOR_BIT,
+                                                  VK_IMAGE_TILING_LINEAR);
 
       assert(desc->binding < 32);