Reland "Add support for RGB config to Vulkan."
This reverts commit f18c297cfb74a48b748bc7909991f98dabb8d460.
Reason for revert: fix
Original change's description:
> Revert "Add support for RGB config to Vulkan."
>
> This reverts commit a8b20a1af7a529a8ecdb0cccc5012fa79fed2605.
>
> Reason for revert: breaking some bots
>
> Original change's description:
> > Add support for RGB config to Vulkan.
> >
> > This adds support for RGB, but from investigating, most desktops don't
> > support RGB at all, and on Android it is usually support as a linear
> > format and not necessarily an optimal one. So until we get better support
> > for linear formats this CL doesn't necessarily add more feature support to
> > our vulkan backend.
> >
> > Bug: skia:8349
> > Change-Id: I1066ddafa660a1ef1d90dbf3e127e067d6132d45
> > Reviewed-on: https://skia-review.googlesource.com/156600
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=egdaniel@google.com,robertphillips@google.com
>
> Change-Id: Ibb7b67c36a1dbcf0d670e0ff293003eac23b5ac4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8349
> Reviewed-on: https://skia-review.googlesource.com/156940
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:8349
Change-Id: Ica68753c0a113b742d1a9abc4a6ac49414c1fe84
Reviewed-on: https://skia-review.googlesource.com/157570
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index b0aa3d4..71279cd 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -23,8 +23,8 @@
*format = VK_FORMAT_R8G8B8A8_UNORM;
return true;
case kRGB_888_GrPixelConfig:
- // TODO: VK_FORMAT_R8G8B8_UNORM
- return false;
+ *format = VK_FORMAT_R8G8B8_UNORM;
+ return true;
case kBGRA_8888_GrPixelConfig:
*format = VK_FORMAT_B8G8R8A8_UNORM;
return true;
@@ -85,6 +85,8 @@
return kSRGBA_8888_GrPixelConfig == config;
case VK_FORMAT_B8G8R8A8_SRGB:
return kSBGRA_8888_GrPixelConfig == config;
+ case VK_FORMAT_R8G8B8_UNORM:
+ return kRGB_888_GrPixelConfig == config;
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
return kRGBA_1010102_GrPixelConfig == config;
case VK_FORMAT_R5G6B5_UNORM_PACK16:
@@ -119,6 +121,7 @@
case VK_FORMAT_R8G8B8A8_SRGB:
case VK_FORMAT_B8G8R8A8_SRGB:
case VK_FORMAT_R8G8B8A8_SINT:
+ case VK_FORMAT_R8G8B8_UNORM:
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
case VK_FORMAT_R5G6B5_UNORM_PACK16:
case VK_FORMAT_B4G4R4A4_UNORM_PACK16: