Start removing uses of VkFormatToPixelConfig in vulkan backend
Bug: skia:
Change-Id: I2c8e86b9e8ca6a33913be347a3c65af963c5fd12
Reviewed-on: https://skia-review.googlesource.com/84341
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
index 3517749..711791d 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -185,10 +185,10 @@
auto srgbColorSpace = SkColorSpace::MakeSRGB();
bool wantSRGB = srgbColorSpace == params.fColorSpace;
for (uint32_t i = 0; i < surfaceFormatCount; ++i) {
- GrPixelConfig config = GrVkFormatToPixelConfig(surfaceFormats[i].format);
- if (kUnknown_GrPixelConfig != config &&
- GrPixelConfigIsSRGB(config) == wantSRGB) {
- surfaceFormat = surfaceFormats[i].format;
+ VkFormat localFormat = surfaceFormats[i].format;
+ if (GrVkFormatIsSupported(localFormat) &&
+ GrVkFormatIsSRGB(localFormat, nullptr) == wantSRGB) {
+ surfaceFormat = localFormat;
colorSpace = surfaceFormats[i].colorSpace;
break;
}