Commit 41bffe09 authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Marge Bot
Browse files

anv: Replace aux_surface.isl.size_B checks with aux_usage checks



Now that aux_usage has a unified meaning, aux_usage == NONE if and only
if aux_surface.isl.size_B > 0.  In most of these cases, the question
we're asking is "does have compression?" and not "have we allocated an
aux surface for compression?".
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <mesa/mesa!3556>
Part-of: <mesa/mesa!3556>
parent e693a572
Pipeline #101262 passed with stages
in 14 minutes and 59 seconds
......@@ -251,7 +251,7 @@ add_aux_state_tracking_buffer(struct anv_image *image,
const struct anv_device *device)
{
assert(image && device);
assert(image->planes[plane].aux_surface.isl.size_B > 0 &&
assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE &&
image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
/* Compressed images must be tiled and therefore everything should be 4K
......@@ -532,7 +532,7 @@ make_surface(struct anv_device *dev,
image->planes[plane].surface.isl.size_B)) <=
(image->planes[plane].offset + image->planes[plane].size));
if (image->planes[plane].aux_surface.isl.size_B) {
if (image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE) {
/* assert(image->planes[plane].fast_clear_state_offset == */
/* (image->planes[plane].aux_surface.offset + image->planes[plane].aux_surface.isl.size_B)); */
assert(image->planes[plane].fast_clear_state_offset <
......@@ -1121,7 +1121,7 @@ anv_layout_to_aux_state(const struct gen_device_info * const devinfo,
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
/* If we don't have an aux buffer then aux state makes no sense */
assert(image->planes[plane].aux_surface.isl.size_B > 0);
assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE);
/* All images that use an auxiliary surface are required to be tiled. */
assert(image->planes[plane].surface.isl.tiling != ISL_TILING_LINEAR);
......@@ -1309,7 +1309,7 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
/* If there is no auxiliary surface allocated, we must use the one and only
* main buffer.
*/
if (image->planes[plane].aux_surface.isl.size_B == 0)
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
return ISL_AUX_USAGE_NONE;
enum isl_aux_state aux_state =
......@@ -1381,7 +1381,7 @@ anv_layout_to_fast_clear_type(const struct gen_device_info * const devinfo,
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
/* If there is no auxiliary surface allocated, there are no fast-clears */
if (image->planes[plane].aux_surface.isl.size_B == 0)
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
return ANV_FAST_CLEAR_NONE;
/* We don't support MSAA fast-clears on Ivybridge or Bay Trail because they
......
......@@ -3487,15 +3487,13 @@ anv_image_aux_levels(const struct anv_image * const image,
VkImageAspectFlagBits aspect)
{
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
return 0;
/* The Gen12 CCS aux surface is represented with only one level. */
const uint8_t aux_logical_levels =
image->planes[plane].aux_surface.isl.tiling == ISL_TILING_GEN12_CCS ?
image->planes[plane].surface.isl.levels :
image->planes[plane].aux_surface.isl.levels;
return image->planes[plane].aux_surface.isl.size_B > 0 ?
aux_logical_levels : 0;
return image->planes[plane].aux_surface.isl.tiling == ISL_TILING_GEN12_CCS ?
image->planes[plane].surface.isl.levels :
image->planes[plane].aux_surface.isl.levels;
}
/* Returns the number of auxiliary buffer layers attached to an image. */
......
......@@ -4827,7 +4827,7 @@ cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
if (GEN_GEN < 10 &&
(att_state->pending_load_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) &&
image->planes[0].aux_surface.isl.size_B > 0 &&
image->planes[0].aux_usage != ISL_AUX_USAGE_NONE &&
iview->planes[0].isl.base_level == 0 &&
iview->planes[0].isl.base_array_layer == 0) {
if (att_state->aux_usage != ISL_AUX_USAGE_NONE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment