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

Commit ca04de8

Browse files
courtney-gCommit Bot
authored andcommitted
Vulkan: blacklist VK_FORMAT_R8G8B8_UNORM
Chrome makes assumptions that depend on ANGLE implementing 24bit RGB as 32 RGBX. Since that was the behavior of ANGLE for a while, remove those formats from the VK format table to force that behavior again. Test: Chrome on Fuchsia Bug: angleproject:4282 Change-Id: I22a3f07b00d7870044ed6b3326dd528721b89af8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2085043 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
1 parent e682bc5 commit ca04de8

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

scripts/code_generation_hashes/Vulkan_format.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
77
"d8a0f2278c09a49049a73930b9da3719",
88
"src/libANGLE/renderer/vulkan/vk_format_map.json":
9-
"e203fb283bfb2f0c446d523f7b290af6",
9+
"cc593afd850712a04600c9badf1544a6",
1010
"src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp":
11-
"a77060d7b772d1a94bdd32ce4b31399e"
11+
"0b818cbddfa88311b853eb1c30eb137d"
1212
}

src/libANGLE/renderer/vulkan/vk_format_map.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"R8G8_SINT": "VK_FORMAT_R8G8_SINT",
4141
"R8G8_USCALED": "VK_FORMAT_R8G8_USCALED",
4242
"R8G8_SSCALED": "VK_FORMAT_R8G8_SSCALED",
43-
"R8G8B8_UNORM": "VK_FORMAT_R8G8B8_UNORM",
4443
"R8G8B8_SNORM": "VK_FORMAT_R8G8B8_SNORM",
4544
"R8G8B8_UINT": "VK_FORMAT_R8G8B8_UINT",
4645
"R8G8B8_SINT": "VK_FORMAT_R8G8B8_SINT",

src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,22 +2273,15 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
22732273
break;
22742274

22752275
case angle::FormatID::R8G8B8_UNORM:
2276-
internalFormat = GL_RGB8;
2277-
{
2278-
static constexpr ImageFormatInitInfo kInfo[] = {
2279-
{angle::FormatID::R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM, nullptr},
2280-
{angle::FormatID::R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM,
2281-
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
2282-
initImageFallback(renderer, kInfo, ArraySize(kInfo));
2283-
}
2284-
{
2285-
static constexpr BufferFormatInitInfo kInfo[] = {
2286-
{angle::FormatID::R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM, false,
2287-
CopyNativeVertexData<GLubyte, 3, 3, 0>, false},
2288-
{angle::FormatID::R32G32B32_FLOAT, VK_FORMAT_R32G32B32_SFLOAT, false,
2289-
CopyTo32FVertexData<GLubyte, 3, 3, true>, true}};
2290-
initBufferFallback(renderer, kInfo, ArraySize(kInfo));
2291-
}
2276+
internalFormat = GL_RGB8;
2277+
actualImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
2278+
vkImageFormat = VK_FORMAT_R8G8B8A8_UNORM;
2279+
imageInitializerFunction = Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>;
2280+
actualBufferFormatID = angle::FormatID::R32G32B32_FLOAT;
2281+
vkBufferFormat = VK_FORMAT_R32G32B32_SFLOAT;
2282+
vkBufferFormatIsPacked = false;
2283+
vertexLoadFunction = CopyTo32FVertexData<GLubyte, 3, 3, true>;
2284+
vertexLoadRequiresConversion = true;
22922285
break;
22932286

22942287
case angle::FormatID::R8G8B8_UNORM_SRGB:

0 commit comments

Comments
 (0)