[bazel] Add sk_gpu_test::VkTestMemoryAllocator class, and use it in sk_gpu_test::CreateVkBackendContext().

Today, our Vulkan tests (both Bazel and DM/nanobench) do not explicitly provide a Vulkan memory allocator. Instead, they delegate that responsibility to GrVkGpu::Make(). If the skgpu::VulkanBackendContext's fMemoryAllocator field is empty, GrVkGpu::Make() attempts to populate[1] it with skgpu::VulkanAMDMemoryAllocator::Make()[2]. This function returns an skgpu::VulkanAMDMemoryAllocator if SK_USE_VMA is set, or a nullptr otherwise[3].

This is problematic for the following reasons:

- Currently Vulkan tests only work if SK_USE_VMA is set.

- Defines are not good for the modular Bazel build (e.g. see discussion here: https://skia-review.googlesource.com/c/skia/+/815097/7/src/gpu/ganesh/vk/BUILD.bazel#171)

- As per today's (2024-02-16) chat with egdaniel@, nicolettep@ and kjlubick@, we want clients to provide their own Vulkan memory allocator (including our own tests).

This CL addresses the above concerns by introducing sk_gpu_test::VkTestMemoryAllocator, a new Vulkan memory allocator meant to be used exclusively by Skia tests. This class is an almost-verbatim copy of skgpu::VulkanAMDMemoryAllocator.

This CL changes sk_gpu_test::CreateVkBackendContext() so that it populates the skgpu::VulkanBackendContext's fMemoryAllocator field with an sk_gpu_test::VkTestMemoryAllocator. This allows us to unset SK_USE_VMA in Bazel tests, and it paves the way to eventually unset said define for DM and Nanobench (via GN, i.e. outside of Bazel) and remove skgpu::VulkanAMDMemoryAllocator from Skia.

Tested on my workstation with:

    $ bazel test //bench:ganesh_vk_test \
          --config=linux_rbe \
          --strategy=TestRunner=local \
          --test_env=DISPLAY=:20 \
          --test_output=streamed

[1] https://skia.googlesource.com/skia/+/c3fbd20fbc7d3662dd31a0e4139226d2951d1ae4/src/gpu/ganesh/vk/GrVkGpu.cpp#190

[2] https://skia.googlesource.com/skia/+/c3fbd20fbc7d3662dd31a0e4139226d2951d1ae4/src/gpu/vk/VulkanAMDMemoryAllocator.cpp#29

[3] https://skia.googlesource.com/skia/+/c3fbd20fbc7d3662dd31a0e4139226d2951d1ae4/src/gpu/vk/VulkanAMDMemoryAllocator.cpp#16

Bug: b/40045064
Bug: b/40045301
Change-Id: Id065a98505e0b0d72bff594c0996d0885ded0f41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/815106
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
7 files changed