aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-05-18 11:30:47 -0700
committerJason Ekstrand <[email protected]>2017-05-23 16:46:20 -0700
commitcc45c4bb8072b6593812f9b68a7b3d2d00bfb9f0 (patch)
tree2b18d3cdec09d33e69b0b5a5591dc32f0fded65e /src/intel/vulkan/anv_image.c
parent75edecf5020a9b833ff7e2929f64ceb11c9df679 (diff)
anv: Handle transitioning depth from UNDEFINED to other layouts
Reviewed-by: Nanley Chery <[email protected]> Cc: "17.1" <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index d21e055f020..c3e2cb51d8e 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -423,12 +423,10 @@ void anv_GetImageSubresourceLayout(
}
/**
- * This function determines the optimal buffer to use for device
- * accesses given a VkImageLayout and other pieces of information needed to
- * make that determination. This does not determine the optimal buffer to
- * use during a resolve operation.
- *
- * NOTE: Some layouts do not support device access.
+ * This function determines the optimal buffer to use for a given
+ * VkImageLayout and other pieces of information needed to make that
+ * determination. This does not determine the optimal buffer to use
+ * during a resolve operation.
*
* @param devinfo The device information of the Intel GPU.
* @param image The image that may contain a collection of buffers.
@@ -484,15 +482,19 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
switch (layout) {
/* Invalid Layouts */
+ case VK_IMAGE_LAYOUT_RANGE_SIZE:
+ case VK_IMAGE_LAYOUT_MAX_ENUM:
+ unreachable("Invalid image layout.");
- /* According to the Vulkan Spec, the following layouts are valid only as
- * initial layouts in a layout transition and don't support device access.
+ /* Undefined layouts
+ *
+ * The pre-initialized layout is equivalent to the undefined layout for
+ * optimally-tiled images. We can only do color compression (CCS or HiZ)
+ * on tiled images.
*/
case VK_IMAGE_LAYOUT_UNDEFINED:
case VK_IMAGE_LAYOUT_PREINITIALIZED:
- case VK_IMAGE_LAYOUT_RANGE_SIZE:
- case VK_IMAGE_LAYOUT_MAX_ENUM:
- unreachable("Invalid image layout for device access.");
+ return ISL_AUX_USAGE_NONE;
/* Transfer Layouts