Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3f61e90

Browse files
committed
fuchsia: Use BGRA8 on non-ARM devices.
Change #23488 has switched all the Vulkan surfaces on Fuchsia to use RGBA8 color type. However, Using RGBA8 format on Intel GPUs has caused graphical artifacts on emulators (See http://fxbug.dev/70232). This change reverts the default vulkan format of Vulkan surfaces to BGRA8 for non-ARM devices to fix the artifacts. Bug: fxbug.dev/70232
1 parent 5c0b530 commit 3f61e90

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

shell/platform/fuchsia/flutter/vulkan_surface.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,21 @@ namespace flutter_runner {
2626

2727
namespace {
2828

29+
// Immutable format is technically limited to R8G8B8A8_SRGB but
30+
// R8G8B8A8_UNORM works with existing ARM drivers so we allow that
31+
// until we have a more reliable API for creating external Vulkan
32+
// images using sysmem. TODO(fxb/52835)
33+
#if defined(__aarch64__)
2934
constexpr SkColorType kSkiaColorType = kRGBA_8888_SkColorType;
3035
constexpr VkFormat kVulkanFormat = VK_FORMAT_R8G8B8A8_UNORM;
3136
constexpr VkImageCreateFlags kVulkanImageCreateFlags = 0;
37+
#else
38+
constexpr SkColorType kSkiaColorType = kBGRA_8888_SkColorType;
39+
constexpr VkFormat kVulkanFormat = VK_FORMAT_B8G8R8A8_UNORM;
40+
constexpr VkImageCreateFlags kVulkanImageCreateFlags =
41+
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
42+
#endif
43+
3244
// TODO: We should only keep usages that are actually required by Skia.
3345
constexpr VkImageUsageFlags kVkImageUsage =
3446
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT |

0 commit comments

Comments
 (0)