Hash :
40f4de8f
Author :
Date :
2023-12-15T10:17:32
Vulkan: Ensure we use cached memory for readPixels stagingBuffer Previous CL crrev.com/c/5112759 does not solve the performance issue for ChromeOS. The reason is that on more recent intel GPU, there is no hostVisibleCachedCoherent heap. When we allocate staging buffer, we specify CachedCoherent as the preferredFlags instead of requiredFlags. This means we still end up getting UncachedCoherent since VMA tries to respect coherent bits as first priority. This CL Changes CachedCoherent to CachedPreferCoherent, and made Cached as required bit, thus ensures the memory allocated is cached. Since coherent bit may not be honored, thus we have to call invalidate/flush (which underline implementation will check the bit and early out if no need). Somehow on ARM GPU using cachedNonCoherent staging buffer causing many test failures, even though we do call invalidate() after allocation, and tests pass on all other GPUs. It almost indicates ARM driver have a bug with invalidate() that it is not doing expected. But before I can be sure and fixed, I added feature bit to keep ARM the old behavior, which uses UnCached memory for readPixels which should suffer the performance as well. Bug: b/315836169 Bug: b/310701311 Change-Id: I1eec6105ce74275faa893b0206be8470f0cde72f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5122318 Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>