Skip to content
Snippets Groups Projects
Commit e51722a7 authored by Rafael Antognolli's avatar Rafael Antognolli
Browse files

anv: Align fast clear color state buffer to a page.


On gen11 and older, compressed images are tiled and aligned to 4K. On
gen12 this 4K alignment restriction was removed. However, only aligning
the fast clear color buffer to 64B (a cacheline, as it's on the
documentation) is causing some bugs where the fast clear color is not
converted during the fast clear operation. Aligning things to 4K seems
to fix it.

v2: Assert that image->planes[plane].offset is 4K aligned (Nanley)

Reviewed-by: default avatarNanley Chery <nanley.g.chery@intel.com>
parent 477f0198
No related branches found
No related tags found
No related merge requests found
......@@ -285,6 +285,15 @@ add_aux_state_tracking_buffer(struct anv_image *image,
}
}
/* Add some padding to make sure the fast clear color state buffer starts at
* a 4K alignment. We believe that 256B might be enough, but due to lack of
* testing we will leave this as 4K for now.
*/
image->planes[plane].size = ALIGN(image->planes[plane].size, 4096);
image->size = ALIGN(image->size, 4096);
assert(image->planes[plane].offset % 4096 == 0);
image->planes[plane].fast_clear_state_offset =
image->planes[plane].offset + image->planes[plane].size;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment