Fix vulkan unmapping of buffers during release.

When we free a vk buffer cause of memory budget, we need to make sure the
buffer is unmapped before calling free on it. However, the old code was
calling unmap even on cpu backed vk buffers. The cpu data gets uploaded
during the unmap call via a transfer buffer. This puts us in a death spiril
of creating and trying to free resources due to budget issues.

This hopefully fixes the attached chromium bugs. I am not sure why the
allocator was eventually crashing but before the crash we ended up in this
craziness of creating and destroying buffers. Maybe we ended un OOMing and
messing with the allocator? Anyways getting rid of the spiril hopefully
gets rid of the crash.

Bug: chromium:1107173, chromium:1106889
Change-Id: I225738df092b4cf5f8b3c97123e06d82358c9b8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303917
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
1 file changed