mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 03:30:10 +01:00
anv: Handle transitioning depth from UNDEFINED to other layouts
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "17.1" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
75edecf502
commit
cc45c4bb80
2 changed files with 19 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue