summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-24 19:35:34 -0700
committerJason Ekstrand <[email protected]>2016-11-17 12:03:24 -0800
commita512565b2b9f991729d747a7fefc1f89d68894d2 (patch)
tree70ba4ce3b6e9f7c1ce88eb09fa3e0997b7afc0eb
parentc3eb58664e5e537b21a75172916b42bd4b5504b3 (diff)
anv/image: Memset all aux surfaces (not just HiZ) to 0
Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/intel/vulkan/anv_image.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index cea46cefe02..b9bf6b81799 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -297,7 +297,7 @@ VkResult anv_BindImageMemory(
image->offset = 0;
}
- if (anv_image_has_hiz(image)) {
+ if (image->aux_surface.isl.size > 0) {
/* The offset and size must be a multiple of 4K or else the
* anv_gem_mmap call below will return NULL.
@@ -305,9 +305,11 @@ VkResult anv_BindImageMemory(
assert((image->offset + image->aux_surface.offset) % 4096 == 0);
assert(image->aux_surface.isl.size % 4096 == 0);
- /* HiZ surfaces need to have their memory cleared to 0 before they
- * can be used. If we let it have garbage data, it can cause GPU
- * hangs on some hardware.
+ /* Auxiliary surfaces need to have their memory cleared to 0 before they
+ * can be used. For CCS surfaces, this puts them in the "resolved"
+ * state so they can be used with CCS enabled before we ever touch it
+ * from the GPU. For HiZ, we need something valid or else we may get
+ * GPU hangs on some hardware and 0 works fine.
*/
void *map = anv_gem_mmap(device, image->bo->gem_handle,
image->offset + image->aux_surface.offset,