Mesa (staging/19.2): anv: Properly allocate aux-tracking space for CCS_E
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Oct 29 15:19:42 UTC 2019
Module: Mesa
Branch: staging/19.2
Commit: d8847c2f286da1f708e77104394515f522631de9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8847c2f286da1f708e77104394515f522631de9
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Mon Oct 21 12:56:00 2019 -0700
anv: Properly allocate aux-tracking space for CCS_E
add_aux_state_tracking_buffer() actually checks the aux usage when
determining how many dwords to allocate for state tracking. Move the
function call to the point after the CCS_E aux usage is assigned.
Fixes: de3be618016 ("anv/cmd_buffer: Rework aux tracking")
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit d0fcc2dd503f734f10f879ad666c27fd81c44262)
---
src/intel/vulkan/anv_image.c | 6 +++---
src/intel/vulkan/anv_private.h | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 66116a8a67d..01aea3245ed 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -468,9 +468,6 @@ make_surface(const struct anv_device *dev,
return VK_SUCCESS;
}
- add_surface(image, &image->planes[plane].aux_surface, plane);
- add_aux_state_tracking_buffer(image, plane, dev);
-
/* For images created without MUTABLE_FORMAT_BIT set, we know that
* they will always be used with the original format. In
* particular, they will always be used with a format that
@@ -483,6 +480,9 @@ make_surface(const struct anv_device *dev,
image->ccs_e_compatible) {
image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;
}
+
+ add_surface(image, &image->planes[plane].aux_surface, plane);
+ add_aux_state_tracking_buffer(image, plane, dev);
}
}
} else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->samples > 1) {
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 9298ed88a49..1f10838c73b 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3276,6 +3276,8 @@ anv_image_get_compression_state_addr(const struct anv_device *device,
}
addr.offset += array_layer * 4;
+ assert(addr.offset <
+ image->planes[plane].address.offset + image->planes[plane].size);
return addr;
}
More information about the mesa-commit
mailing list