summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.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/genX_cmd_buffer.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/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 79af9aad82c..0bb6d8e782c 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -355,15 +355,8 @@ transition_depth_buffer(struct anv_cmd_buffer *cmd_buffer,
* The undefined layout indicates that the user doesn't care about the data
* that's currently in the buffer. Therefore, a data-preserving resolve
* operation is not needed.
- *
- * The pre-initialized layout is equivalent to the undefined layout for
- * optimally-tiled images. Anv only exposes support for optimally-tiled
- * depth buffers.
*/
- if (image->aux_usage != ISL_AUX_USAGE_HIZ ||
- initial_layout == final_layout ||
- initial_layout == VK_IMAGE_LAYOUT_UNDEFINED ||
- initial_layout == VK_IMAGE_LAYOUT_PREINITIALIZED)
+ if (image->aux_usage != ISL_AUX_USAGE_HIZ || initial_layout == final_layout)
return;
const bool hiz_enabled = ISL_AUX_USAGE_HIZ ==
@@ -404,6 +397,11 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
return;
#if GEN_GEN >= 9
+ /* We're transitioning from an undefined layout so it doesn't really matter
+ * what data ends up in the color buffer. We do, however, need to ensure
+ * that the CCS has valid data in it. One easy way to do that is to
+ * fast-clear the specified range.
+ */
anv_image_ccs_clear(cmd_buffer, image, view, subresourceRange);
#endif
}