summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-11-02 18:26:23 -0700
committerChad Versace <[email protected]>2017-11-09 16:01:59 -0800
commit096fc6915b580b496aa785d5d44499cdbc28137b (patch)
treeea41f68965d731c4754d7985bbb51151093dc8a7 /src/intel
parent8ae4e97536476b1a6f6e36c7c73e00d09940e5b3 (diff)
anv: Refactor get_image_format_properties() - ASTC
Teach it to calculate the format features for ASTC. The goal is to incrementally fix get_image_format_properties() to return a correct result. Currently, it returns incorrect VkFormatFeatureFlags which the caller must clean up. v2: New commit message Reviewed-by: Jason Ekstrand <[email protected]> (v1) Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_formats.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 8c9f5a46d2c..eaf6093a4f8 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -497,6 +497,11 @@ get_image_format_properties(const struct gen_device_info *devinfo,
return flags;
}
+ /* ASTC textures must be in Y-tiled memory */
+ if (vk_tiling == VK_IMAGE_TILING_LINEAR &&
+ isl_format_get_layout(format.isl_format)->txc == ISL_TXC_ASTC)
+ return 0;
+
if (isl_format_supports_sampling(devinfo, format.isl_format)) {
flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
VK_FORMAT_FEATURE_BLIT_SRC_BIT;
@@ -615,10 +620,6 @@ anv_physical_device_get_format_properties(struct anv_physical_device *physical_d
tiled &= ~VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT &
~VK_FORMAT_FEATURE_BLIT_DST_BIT;
}
-
- /* ASTC textures must be in Y-tiled memory */
- if (isl_format_get_layout(linear_fmt.isl_format)->txc == ISL_TXC_ASTC)
- linear = 0;
}
if (format && format->can_ycbcr) {