Commit 799e075a by Jamie Madill Committed by Commit Bot

Replace D24_UNORM with a packed version.

Adding an explicit X8 channel packs the format into 32 bits. This gives the correct 4-byte alignment instead of a mysterious 3-byte version. Bug: angleproject:2729 Change-Id: Id38f74db4ba61c500baeb6526a9d14e1d31d4363 Reviewed-on: https://chromium-review.googlesource.com/1140739Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e2c00841
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"ANGLE format:src/libANGLE/renderer/angle_format_data.json": "ANGLE format:src/libANGLE/renderer/angle_format_data.json":
"1ab73531d2d9655e669b5560fb43c698", "1ab73531d2d9655e669b5560fb43c698",
"ANGLE format:src/libANGLE/renderer/angle_format_map.json": "ANGLE format:src/libANGLE/renderer/angle_format_map.json":
"82d80c3be2cdfcc17aec07cf2223907f", "ea6dfe3ebbc86e04f0d4b9f568ba22ae",
"ANGLE format:src/libANGLE/renderer/gen_angle_format_table.py": "ANGLE format:src/libANGLE/renderer/gen_angle_format_table.py":
"dcb81c64e2c89f57a7105ab07ef0ffd0", "dcb81c64e2c89f57a7105ab07ef0ffd0",
"ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py": "ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py":
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"DXGI format:src/libANGLE/renderer/angle_format.py": "DXGI format:src/libANGLE/renderer/angle_format.py":
"b18ca0fe4835114a4a2f54977b19e798", "b18ca0fe4835114a4a2f54977b19e798",
"DXGI format:src/libANGLE/renderer/angle_format_map.json": "DXGI format:src/libANGLE/renderer/angle_format_map.json":
"82d80c3be2cdfcc17aec07cf2223907f", "ea6dfe3ebbc86e04f0d4b9f568ba22ae",
"DXGI format:src/libANGLE/renderer/d3d/d3d11/dxgi_format_data.json": "DXGI format:src/libANGLE/renderer/d3d/d3d11/dxgi_format_data.json":
"24f525b05dc665fbbc8c6d68fb863719", "24f525b05dc665fbbc8c6d68fb863719",
"DXGI format:src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py": "DXGI format:src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py":
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"Vulkan format:src/libANGLE/renderer/angle_format.py": "Vulkan format:src/libANGLE/renderer/angle_format.py":
"b18ca0fe4835114a4a2f54977b19e798", "b18ca0fe4835114a4a2f54977b19e798",
"Vulkan format:src/libANGLE/renderer/angle_format_map.json": "Vulkan format:src/libANGLE/renderer/angle_format_map.json":
"82d80c3be2cdfcc17aec07cf2223907f", "ea6dfe3ebbc86e04f0d4b9f568ba22ae",
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"2ecc99c12cd41bda7107a7d9ffe3786c", "2ecc99c12cd41bda7107a7d9ffe3786c",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json": "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
......
...@@ -62,8 +62,8 @@ enum class Format::ID ...@@ -62,8 +62,8 @@ enum class Format::ID
BC3_RGBA_UNORM_BLOCK, BC3_RGBA_UNORM_BLOCK,
BC3_RGBA_UNORM_SRGB_BLOCK, BC3_RGBA_UNORM_SRGB_BLOCK,
D16_UNORM, D16_UNORM,
D24_UNORM,
D24_UNORM_S8_UINT, D24_UNORM_S8_UINT,
D24_UNORM_X8_UINT,
D32_FLOAT, D32_FLOAT,
D32_FLOAT_S8X24_UINT, D32_FLOAT_S8X24_UINT,
D32_UNORM, D32_UNORM,
......
...@@ -74,8 +74,8 @@ constexpr Format g_formatInfoTable[] = { ...@@ -74,8 +74,8 @@ constexpr Format g_formatInfoTable[] = {
{ Format::ID::BC3_RGBA_UNORM_BLOCK, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true }, { Format::ID::BC3_RGBA_UNORM_BLOCK, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true },
{ Format::ID::BC3_RGBA_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true }, { Format::ID::BC3_RGBA_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true },
{ Format::ID::D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 16, 0, 2, false }, { Format::ID::D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 16, 0, 2, false },
{ Format::ID::D24_UNORM, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT24, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 0, 3, false },
{ Format::ID::D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 8, 4, false }, { Format::ID::D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 8, 4, false },
{ Format::ID::D24_UNORM_X8_UINT, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT24, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 0, 4, false },
{ Format::ID::D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 32, 0, 4, false }, { Format::ID::D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 32, 0, 4, false },
{ Format::ID::D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 32, 8, 8, false }, { Format::ID::D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 32, 8, 8, false },
{ Format::ID::D32_UNORM, GL_DEPTH_COMPONENT32_OES, GL_DEPTH_COMPONENT32_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 32, 0, 4, false }, { Format::ID::D32_UNORM, GL_DEPTH_COMPONENT32_OES, GL_DEPTH_COMPONENT32_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 32, 0, 4, false },
...@@ -328,7 +328,7 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat) ...@@ -328,7 +328,7 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
return Format::ID::D16_UNORM; return Format::ID::D16_UNORM;
case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT24:
return Format::ID::D24_UNORM; return Format::ID::D24_UNORM_X8_UINT;
case GL_DEPTH_COMPONENT32F: case GL_DEPTH_COMPONENT32F:
return Format::ID::D32_FLOAT; return Format::ID::D32_FLOAT;
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
[ "GL_DEPTH24_STENCIL8", "D24_UNORM_S8_UINT" ], [ "GL_DEPTH24_STENCIL8", "D24_UNORM_S8_UINT" ],
[ "GL_DEPTH32F_STENCIL8", "D32_FLOAT_S8X24_UINT" ], [ "GL_DEPTH32F_STENCIL8", "D32_FLOAT_S8X24_UINT" ],
[ "GL_DEPTH_COMPONENT16", "D16_UNORM" ], [ "GL_DEPTH_COMPONENT16", "D16_UNORM" ],
[ "GL_DEPTH_COMPONENT24", "D24_UNORM" ], [ "GL_DEPTH_COMPONENT24", "D24_UNORM_X8_UINT" ],
[ "GL_DEPTH_COMPONENT32F", "D32_FLOAT" ], [ "GL_DEPTH_COMPONENT32F", "D32_FLOAT" ],
[ "GL_DEPTH_COMPONENT32_OES", "D32_UNORM" ], [ "GL_DEPTH_COMPONENT32_OES", "D32_UNORM" ],
[ "GL_ETC1_RGB8_OES", "ETC1_R8G8B8_UNORM_BLOCK" ], [ "GL_ETC1_RGB8_OES", "ETC1_R8G8B8_UNORM_BLOCK" ],
......
...@@ -478,10 +478,6 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an ...@@ -478,10 +478,6 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
vertexLoadRequiresConversion = false; vertexLoadRequiresConversion = false;
break; break;
case angle::Format::ID::D24_UNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::D24_UNORM_S8_UINT: case angle::Format::ID::D24_UNORM_S8_UINT:
internalFormat = GL_DEPTH24_STENCIL8; internalFormat = GL_DEPTH24_STENCIL8;
initTextureFallback(physicalDevice, angle::Format::ID::D24_UNORM_S8_UINT, initTextureFallback(physicalDevice, angle::Format::ID::D24_UNORM_S8_UINT,
...@@ -494,6 +490,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an ...@@ -494,6 +490,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
vertexLoadRequiresConversion = false; vertexLoadRequiresConversion = false;
break; break;
case angle::Format::ID::D24_UNORM_X8_UINT:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::D32_FLOAT: case angle::Format::ID::D32_FLOAT:
internalFormat = GL_DEPTH_COMPONENT32F; internalFormat = GL_DEPTH_COMPONENT32F;
textureFormatID = angle::Format::ID::D32_FLOAT; textureFormatID = angle::Format::ID::D32_FLOAT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment