The ETC2 format is backwards compatible with ETC1.  ETC1 RGB8 is thus
supported by implicitly using the ETC2 RGB8 Vulkan format.

Bug: angleproject:2670
Change-Id: I59a112da5ed3a0b90f90a8b4c350c94d43b31120
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520987
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This commit is contained in:
Shahbaz Youssefi 2019-03-18 16:48:45 -04:00 коммит произвёл Commit Bot
Родитель 7d53c60b1a
Коммит cf8735dcde
5 изменённых файлов: 34 добавлений и 5 удалений

Просмотреть файл

@ -14,9 +14,9 @@
"ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py": "ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py":
"2dcc3aa0cd700165b588cf53441e243b", "2dcc3aa0cd700165b588cf53441e243b",
"ANGLE load functions table:src/libANGLE/renderer/load_functions_data.json": "ANGLE load functions table:src/libANGLE/renderer/load_functions_data.json":
"eaca9d5068380214c416bb8e23ca2f99", "5f26e468153a98121f7a9c03eea9999e",
"ANGLE load functions table:src/libANGLE/renderer/load_functions_table_autogen.cpp": "ANGLE load functions table:src/libANGLE/renderer/load_functions_table_autogen.cpp":
"da4924c3be631b8c2abed3023860299b", "28991ca4bb52f7cce520d2fb4882eb0d",
"D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/Blit11Helper_autogen.inc": "D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/Blit11Helper_autogen.inc":
"f69cf03a3d868a977fad9e9c0eb0652a", "f69cf03a3d868a977fad9e9c0eb0652a",
"D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/d3d11_blit_shaders_autogen.gni": "D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/d3d11_blit_shaders_autogen.gni":
@ -188,9 +188,9 @@
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"9937d3c942f0a5fe08f1ca080d40d47e", "9937d3c942f0a5fe08f1ca080d40d47e",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json": "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
"992749b88763adb66003fe5d801b5ded", "9b5a784d36ea31610e143d23860425d7",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp": "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp":
"1d22113470fbe8506e1264923f1793d2", "ef0ea80cf33e60f76391bcfed10b3c0a",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py": "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
"e5fa1f79a91ff812f24b5755eba8e145", "e5fa1f79a91ff812f24b5755eba8e145",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/gen/BufferUtils.comp.00000000.inc": "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/gen/BufferUtils.comp.00000000.inc":

Просмотреть файл

@ -719,6 +719,9 @@
}, },
"ETC1_R8G8B8_UNORM_BLOCK": { "ETC1_R8G8B8_UNORM_BLOCK": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>"
},
"ETC2_R8G8B8_UNORM_BLOCK": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>"
} }
}, },
"GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": { "GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": {

Просмотреть файл

@ -1184,6 +1184,18 @@ LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK(GLenum type)
} }
} }
LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo ETC1_RGB8_OES_to_R8G8B8A8_UNORM(GLenum type) LoadImageFunctionInfo ETC1_RGB8_OES_to_R8G8B8A8_UNORM(GLenum type)
{ {
switch (type) switch (type)
@ -3016,6 +3028,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat)
{ {
case FormatID::ETC1_R8G8B8_UNORM_BLOCK: case FormatID::ETC1_R8G8B8_UNORM_BLOCK:
return ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK; return ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK;
case FormatID::ETC2_R8G8B8_UNORM_BLOCK:
return ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK;
case FormatID::R8G8B8A8_UNORM: case FormatID::R8G8B8A8_UNORM:
return ETC1_RGB8_OES_to_R8G8B8A8_UNORM; return ETC1_RGB8_OES_to_R8G8B8A8_UNORM;
default: default:

Просмотреть файл

@ -224,6 +224,10 @@
"buffer": "NONE", "buffer": "NONE",
"texture": "D24_UNORM_S8_UINT" "texture": "D24_UNORM_S8_UINT"
}, },
"ETC1_R8G8B8_UNORM_BLOCK": {
"buffer": "NONE",
"texture": "ETC2_R8G8B8_UNORM_BLOCK"
},
"R32_FIXED": { "R32_FIXED": {
"buffer": "R32_FLOAT" "buffer": "R32_FLOAT"
}, },

Просмотреть файл

@ -751,7 +751,15 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat)
break; break;
case angle::FormatID::ETC1_R8G8B8_UNORM_BLOCK: case angle::FormatID::ETC1_R8G8B8_UNORM_BLOCK:
// This format is not implemented in Vulkan. internalFormat = GL_ETC1_RGB8_OES;
textureFormatID = angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK;
vkTextureFormat = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
textureInitializerFunction = nullptr;
bufferFormatID = angle::FormatID::NONE;
vkBufferFormat = VK_FORMAT_UNDEFINED;
vkBufferFormatIsPacked = false;
vertexLoadFunction = nullptr;
vertexLoadRequiresConversion = true;
break; break;
case angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK: case angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK: