mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
anv: Don't resolve or ambiguate non-existent layers
The previous code was trying to avoid non-existent layers by taking a
MAX with anv_image_aux_layers. Unfortunately, it wasn't taking into
account that layer_count starts at base_layer which may not be zero.
Instead, we need to subtract base_layer from anv_image_aux_layers with
a guard against roll-over.
Fixes: de3be61801 "anv/cmd_buffer: Rework aux tracking"
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
parent
c2c4e5bae3
commit
f37bd726c7
1 changed files with 10 additions and 2 deletions
|
|
@ -883,8 +883,12 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
|
|||
if (image->samples == 1) {
|
||||
for (uint32_t l = 0; l < level_count; l++) {
|
||||
const uint32_t level = base_level + l;
|
||||
|
||||
uint32_t aux_layers = anv_image_aux_layers(image, aspect, level);
|
||||
if (base_layer >= aux_layers)
|
||||
break; /* We will only get fewer layers as level increases */
|
||||
uint32_t level_layer_count =
|
||||
MIN2(layer_count, anv_image_aux_layers(image, aspect, level));
|
||||
MIN2(layer_count, aux_layers - base_layer);
|
||||
|
||||
anv_image_ccs_op(cmd_buffer, image, aspect, level,
|
||||
base_layer, level_layer_count,
|
||||
|
|
@ -972,8 +976,12 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
|
|||
|
||||
for (uint32_t l = 0; l < level_count; l++) {
|
||||
uint32_t level = base_level + l;
|
||||
|
||||
uint32_t aux_layers = anv_image_aux_layers(image, aspect, level);
|
||||
if (base_layer >= aux_layers)
|
||||
break; /* We will only get fewer layers as level increases */
|
||||
uint32_t level_layer_count =
|
||||
MIN2(layer_count, anv_image_aux_layers(image, aspect, level));
|
||||
MIN2(layer_count, aux_layers - base_layer);
|
||||
|
||||
for (uint32_t a = 0; a < level_layer_count; a++) {
|
||||
uint32_t array_layer = base_layer + a;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue