diff options
author | Rafael Antognolli <[email protected]> | 2019-08-13 14:47:27 -0700 |
---|---|---|
committer | Rafael Antognolli <[email protected]> | 2019-10-30 19:41:29 +0000 |
commit | e51722a7c79e64057a68ae16eee4735b9b190c7d (patch) | |
tree | a395a917bedb568df893552ade51c57febcecef2 /src/intel | |
parent | 477f0198129abd768cb6d201d4319cdb5fc1d568 (diff) |
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: Nanley Chery <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index c34cf209e75..998cfa75522 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -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; |