[bazel] GaneshVulkanSurfaceManager.cpp: Implement.

This CL defines Vulkan configurations that mimic the DM/nanobench configurations defined in //tools/flags/CommonFlagsConfig.cpp[1]. The only exceptions are vkddl and vktestpersistentcache, which use the GPUDDLSink[2] and GPUPersistentCacheTestingSink[3] GM sinks, respectively. All other configs use the "vanilla" GPUSink[4]. Under BazelGMTestRunner, we currently do not support sinks, but I believe the behaviors in GPUDDLSink and GPUPersistentCacheTestingSink can be implemented as vias. We should discuss this.

One important observation is that GaneshVulkanSurfaceManager.cpp does not currently depend on any Vulkan-specific code or imports. Aside from the "vk*" configurations, it is virtually identical to GaneshGLSurfaceManager.cpp. This suggests it could be possible to merge them and have just one single GaneshSurfaceManager.cpp. We should consider this in the future after things are more settled.

Unlike GaneshGLSurfaceManager.cpp, I decided to have makeVulkanSurfaceManager() take all configuration options as arguments from the get-go, even though some options are always the same across configs. This makes it easy to quickly see all the "ingredients" that go into making a surface, at the expense of slightly more verbose config definitions. I think this is the right tradeoff. In a follow-up CL (https://skia-review.googlesource.com/c/skia/+/811244) I'll rewrite GaneshGLSurfaceManager.cpp's makeGLESSurfaceManager() function to be like makeVulkanSurfaceManager().

This CL also defines one GM and benchmark test for each configuration. I was able to test these targets on my workstation with Bazel invocations such as:

    $ bazel test \
          --config=linux_rbe \
          --config=vulkan_ganesh \
          --nocache_test_results --test_output=streamed \
          --strategy=TestRunner=local \
          --test_env=DISPLAY=:20 \
          --test_env=XDG_RUNTIME_DIR \
          //gm:gpu_vk_test

    $ bazel test \
          --config=linux_rbe \
          --config=vulkan_ganesh \
          --strategy=TestRunner=local \
          --nocache_test_results \
          --test_output=streamed \
          --test_env=DISPLAY=:20 \
          --test_env=XDG_RUNTIME_DIR \
          //bench:gpu_vk_test

[1] https://skia.googlesource.com/skia/+/8da85ea79d1ba2b3f32d25178eb21f2ebda83437/tools/flags/CommonFlagsConfig.cpp#103

[2] https://skia.googlesource.com/skia/+/8da85ea79d1ba2b3f32d25178eb21f2ebda83437/dm/DMSrcSink.h#475

[3] https://skia.googlesource.com/skia/+/8da85ea79d1ba2b3f32d25178eb21f2ebda83437/dm/DMSrcSink.h#435

[4] https://skia.googlesource.com/skia/+/8da85ea79d1ba2b3f32d25178eb21f2ebda83437/dm/DMSrcSink.h#367

Bug: b/40045301
Change-Id: Ia60b759efce61e6c05120579f430a6566d7cec59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/811033
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
5 files changed