Commit f2ed2995 by Olli Etuaho Committed by Commit Bot

Add support for EXT_texture_compression_bptc

After validation, the enums are simply forwarded to the native drivers. The BPTC formats are supported on both OpenGL and D3D. The included test coverage covers the API quite well, but only has basic coverage for correct decoding of texture data. More coverage for texture data could be added later. BUG=angleproject:2869 TEST=angle_end2end_tests Change-Id: I3de37972dcf13c6fa3fc1bc429a2627523a4a082 Reviewed-on: https://chromium-review.googlesource.com/c/1261675 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 956ab4d9
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
"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":
"ea6dfe3ebbc86e04f0d4b9f568ba22ae", "be9f9bdbdf785dda05920146e8c55dbb",
"ANGLE format:src/libANGLE/renderer/gen_angle_format_table.py": "ANGLE format:src/libANGLE/renderer/gen_angle_format_table.py":
"9de29b6ca59a05747623c0dc32344b14", "9de29b6ca59a05747623c0dc32344b14",
"ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py": "ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py":
"8afc7eecce2a3ba9f0b4beacb1aa7fe2", "8afc7eecce2a3ba9f0b4beacb1aa7fe2",
"ANGLE load functions table:src/libANGLE/renderer/load_functions_data.json": "ANGLE load functions table:src/libANGLE/renderer/load_functions_data.json":
"21a603f6224d3b6cd606b71dca0ae181", "4253e14cd3217f42b6fec75ee400655a",
"D3D11 format:src/libANGLE/renderer/angle_format.py": "D3D11 format:src/libANGLE/renderer/angle_format.py":
"b18ca0fe4835114a4a2f54977b19e798", "b18ca0fe4835114a4a2f54977b19e798",
"D3D11 format:src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py": "D3D11 format:src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py":
"15fb2a9b3f81e39a22090bce2f071185", "15fb2a9b3f81e39a22090bce2f071185",
"D3D11 format:src/libANGLE/renderer/d3d/d3d11/texture_format_data.json": "D3D11 format:src/libANGLE/renderer/d3d/d3d11/texture_format_data.json":
"fde460b6823388a8f27082ec266ad64f", "70a1798cb4e6ebabe31be5bec40c6d6f",
"D3D11 format:src/libANGLE/renderer/d3d/d3d11/texture_format_map.json": "D3D11 format:src/libANGLE/renderer/d3d/d3d11/texture_format_map.json":
"805d30e2443935e3a3bd68839699e171", "805d30e2443935e3a3bd68839699e171",
"DXGI format support:src/libANGLE/renderer/d3d/d3d11/dxgi_support_data.json": "DXGI format support:src/libANGLE/renderer/d3d/d3d11/dxgi_support_data.json":
...@@ -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":
"ea6dfe3ebbc86e04f0d4b9f568ba22ae", "be9f9bdbdf785dda05920146e8c55dbb",
"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":
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"GL format map:src/libANGLE/es3_format_type_combinations.json": "GL format map:src/libANGLE/es3_format_type_combinations.json":
"a232823cd6430f14e28793ccabb968ee", "a232823cd6430f14e28793ccabb968ee",
"GL format map:src/libANGLE/format_map_data.json": "GL format map:src/libANGLE/format_map_data.json":
"81b2775940d4ba19f874c931dfdc239e", "779798d4879e5f73a5a108e3e3fd3095",
"GL format map:src/libANGLE/gen_format_map.py": "GL format map:src/libANGLE/gen_format_map.py":
"a383ee79a7bf929d145165f3e76c1079", "a383ee79a7bf929d145165f3e76c1079",
"OpenGL dispatch table:scripts/gl.xml": "OpenGL dispatch table:scripts/gl.xml":
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,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":
"ea6dfe3ebbc86e04f0d4b9f568ba22ae", "be9f9bdbdf785dda05920146e8c55dbb",
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"45b9efadef12298527dce8bb5da49178", "45b9efadef12298527dce8bb5da49178",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json": "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
"Vulkan mandatory format support table:src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json": "Vulkan mandatory format support table:src/libANGLE/renderer/vulkan/vk_mandatory_format_support_data.json":
"fa2bd54c1bb0ab2cf1d386061a4bc5c5", "fa2bd54c1bb0ab2cf1d386061a4bc5c5",
"Vulkan mandatory format support table:third_party/vulkan-headers/src/registry/vk.xml": "Vulkan mandatory format support table:third_party/vulkan-headers/src/registry/vk.xml":
"de9fb16e43de8ab4b69f673c2ca03704", "cd73387d7cdaa5d403eab411194342b3",
"packed enum:src/common/gen_packed_gl_enums.py": "packed enum:src/common/gen_packed_gl_enums.py":
"a9b1c38b4e4d8a1038e743be323f1a51", "a9b1c38b4e4d8a1038e743be323f1a51",
"packed enum:src/common/packed_egl_enums.json": "packed enum:src/common/packed_egl_enums.json":
......
...@@ -165,6 +165,7 @@ Extensions::Extensions() ...@@ -165,6 +165,7 @@ Extensions::Extensions()
textureCompressionS3TCsRGB(false), textureCompressionS3TCsRGB(false),
textureCompressionASTCHDR(false), textureCompressionASTCHDR(false),
textureCompressionASTCLDR(false), textureCompressionASTCLDR(false),
textureCompressionBPTC(false),
compressedETC1RGB8Texture(false), compressedETC1RGB8Texture(false),
compressedETC2RGB8Texture(false), compressedETC2RGB8Texture(false),
compressedETC2sRGB8Texture(false), compressedETC2sRGB8Texture(false),
...@@ -715,25 +716,35 @@ static bool DetermineTextureNorm16Support(const TextureCapsMap &textureCaps) ...@@ -715,25 +716,35 @@ static bool DetermineTextureNorm16Support(const TextureCapsMap &textureCaps)
GetFormatSupport(textureCaps, requiredRenderFormats, true, false, true, true); GetFormatSupport(textureCaps, requiredRenderFormats, true, false, true, true);
} }
// Check for EXT_texture_compression_bptc
static bool DetermineBPTCTextureSupport(const TextureCapsMap &textureCaps)
{
constexpr GLenum requiredFormats[] = {
GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT};
return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false);
}
void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
{ {
// TODO(ynovikov): rgb8rgba8, colorBufferHalfFloat, textureHalfFloat, textureHalfFloatLinear, // TODO(ynovikov): rgb8rgba8, colorBufferHalfFloat, textureHalfFloat, textureHalfFloatLinear,
// textureFloat, textureFloatLinear, textureRG, sRGB, colorBufferFloatRGB, colorBufferFloatRGBA // textureFloat, textureFloatLinear, textureRG, sRGB, colorBufferFloatRGB, colorBufferFloatRGBA
// and colorBufferFloat were verified. Verify the rest. // and colorBufferFloat were verified. Verify the rest.
packedDepthStencil = DeterminePackedDepthStencilSupport(textureCaps); packedDepthStencil = DeterminePackedDepthStencilSupport(textureCaps);
rgb8rgba8 = DetermineRGB8AndRGBA8TextureSupport(textureCaps); rgb8rgba8 = DetermineRGB8AndRGBA8TextureSupport(textureCaps);
textureFormatBGRA8888 = DetermineBGRA8TextureSupport(textureCaps); textureFormatBGRA8888 = DetermineBGRA8TextureSupport(textureCaps);
textureHalfFloat = DetermineHalfFloatTextureSupport(textureCaps); textureHalfFloat = DetermineHalfFloatTextureSupport(textureCaps);
textureHalfFloatLinear = textureHalfFloatLinear =
textureHalfFloat && DetermineHalfFloatTextureFilteringSupport(textureCaps); textureHalfFloat && DetermineHalfFloatTextureFilteringSupport(textureCaps);
textureFloat = DetermineFloatTextureSupport(textureCaps); textureFloat = DetermineFloatTextureSupport(textureCaps);
textureFloatLinear = textureFloat && DetermineFloatTextureFilteringSupport(textureCaps); textureFloatLinear = textureFloat && DetermineFloatTextureFilteringSupport(textureCaps);
textureRG = DetermineRGTextureSupport(textureCaps, textureHalfFloat, textureFloat); textureRG = DetermineRGTextureSupport(textureCaps, textureHalfFloat, textureFloat);
colorBufferHalfFloat = colorBufferHalfFloat =
textureHalfFloat && DetermineColorBufferHalfFloatSupport(textureCaps, textureRG); textureHalfFloat && DetermineColorBufferHalfFloatSupport(textureCaps, textureRG);
textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps); textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps);
textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps); textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps);
textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps); textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps);
textureCompressionS3TCsRGB = DetermineS3TCsRGBTextureSupport(textureCaps); textureCompressionS3TCsRGB = DetermineS3TCsRGBTextureSupport(textureCaps);
textureCompressionASTCHDR = DetermineASTCTextureSupport(textureCaps); textureCompressionASTCHDR = DetermineASTCTextureSupport(textureCaps);
textureCompressionASTCLDR = textureCompressionASTCHDR; textureCompressionASTCLDR = textureCompressionASTCHDR;
...@@ -757,6 +768,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) ...@@ -757,6 +768,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
colorBufferFloatRGBA = DetermineColorBufferFloatRGBASupport(textureCaps); colorBufferFloatRGBA = DetermineColorBufferFloatRGBASupport(textureCaps);
colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps); colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps);
textureNorm16 = DetermineTextureNorm16Support(textureCaps); textureNorm16 = DetermineTextureNorm16Support(textureCaps);
textureCompressionBPTC = DetermineBPTCTextureSupport(textureCaps);
} }
const ExtensionInfoMap &GetExtensionInfoMap() const ExtensionInfoMap &GetExtensionInfoMap()
...@@ -809,6 +821,7 @@ const ExtensionInfoMap &GetExtensionInfoMap() ...@@ -809,6 +821,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["OES_compressed_EAC_R11_signed_texture"] = enableableExtension(&Extensions::compressedEACR11SignedTexture); map["OES_compressed_EAC_R11_signed_texture"] = enableableExtension(&Extensions::compressedEACR11SignedTexture);
map["OES_compressed_EAC_RG11_unsigned_texture"] = enableableExtension(&Extensions::compressedEACRG11UnsignedTexture); map["OES_compressed_EAC_RG11_unsigned_texture"] = enableableExtension(&Extensions::compressedEACRG11UnsignedTexture);
map["OES_compressed_EAC_RG11_signed_texture"] = enableableExtension(&Extensions::compressedEACRG11SignedTexture); map["OES_compressed_EAC_RG11_signed_texture"] = enableableExtension(&Extensions::compressedEACRG11SignedTexture);
map["GL_EXT_texture_compression_bptc"] = enableableExtension(&Extensions::textureCompressionBPTC);
map["GL_EXT_sRGB"] = enableableExtension(&Extensions::sRGB); map["GL_EXT_sRGB"] = enableableExtension(&Extensions::sRGB);
map["GL_ANGLE_depth_texture"] = esOnlyExtension(&Extensions::depthTextures); map["GL_ANGLE_depth_texture"] = esOnlyExtension(&Extensions::depthTextures);
map["GL_OES_depth32"] = esOnlyExtension(&Extensions::depth32); map["GL_OES_depth32"] = esOnlyExtension(&Extensions::depth32);
......
...@@ -109,6 +109,7 @@ struct Extensions ...@@ -109,6 +109,7 @@ struct Extensions
// GL_ANGLE_depth_texture, GL_OES_depth32 // GL_ANGLE_depth_texture, GL_OES_depth32
// GL_EXT_color_buffer_float // GL_EXT_color_buffer_float
// GL_EXT_texture_norm16 // GL_EXT_texture_norm16
// GL_EXT_texture_compression_bptc
void setTextureExtensionSupport(const TextureCapsMap &textureCaps); void setTextureExtensionSupport(const TextureCapsMap &textureCaps);
// ES2 Extension support // ES2 Extension support
...@@ -182,6 +183,9 @@ struct Extensions ...@@ -182,6 +183,9 @@ struct Extensions
// GL_KHR_texture_compression_astc_ldr // GL_KHR_texture_compression_astc_ldr
bool textureCompressionASTCLDR; bool textureCompressionASTCLDR;
// GL_EXT_texture_compression_bptc
bool textureCompressionBPTC;
// GL_OES_compressed_ETC1_RGB8_texture // GL_OES_compressed_ETC1_RGB8_texture
// Implies that TextureCaps for GL_ETC1_RGB8_OES exist // Implies that TextureCaps for GL_ETC1_RGB8_OES exist
bool compressedETC1RGB8Texture; bool compressedETC1RGB8Texture;
......
...@@ -52,6 +52,16 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type) ...@@ -52,6 +52,16 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type)
} }
break; break;
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
switch (type)
{
case GL_UNSIGNED_BYTE:
return GL_COMPRESSED_RGBA_BPTC_UNORM_EXT;
default:
break;
}
break;
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
switch (type) switch (type)
{ {
...@@ -82,6 +92,26 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type) ...@@ -82,6 +92,26 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type)
} }
break; break;
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
switch (type)
{
case GL_UNSIGNED_BYTE:
return GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
default:
break;
}
break;
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
switch (type)
{
case GL_UNSIGNED_BYTE:
return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
default:
break;
}
break;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
switch (type) switch (type)
{ {
...@@ -92,6 +122,16 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type) ...@@ -92,6 +122,16 @@ GLenum GetSizedFormatInternal(GLenum format, GLenum type)
} }
break; break;
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
switch (type)
{
case GL_UNSIGNED_BYTE:
return GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
default:
break;
}
break;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
switch (type) switch (type)
{ {
......
...@@ -127,6 +127,18 @@ ...@@ -127,6 +127,18 @@
"GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT": { "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT": {
"GL_UNSIGNED_BYTE": "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT" "GL_UNSIGNED_BYTE": "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"
}, },
"GL_COMPRESSED_RGBA_BPTC_UNORM_EXT": {
"GL_UNSIGNED_BYTE": "GL_COMPRESSED_RGBA_BPTC_UNORM_EXT"
},
"GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT": {
"GL_UNSIGNED_BYTE": "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT"
},
"GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT": {
"GL_UNSIGNED_BYTE": "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT"
},
"GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT": {
"GL_UNSIGNED_BYTE": "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT"
},
"GL_DEPTH_COMPONENT": { "GL_DEPTH_COMPONENT": {
"GL_UNSIGNED_SHORT": "GL_DEPTH_COMPONENT16", "GL_UNSIGNED_SHORT": "GL_DEPTH_COMPONENT16",
"GL_UNSIGNED_INT": "GL_DEPTH_COMPONENT32_OES", "GL_UNSIGNED_INT": "GL_DEPTH_COMPONENT32_OES",
......
...@@ -894,6 +894,13 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -894,6 +894,13 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported);
AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported);
// From EXT_texture_compression_bptc
// | Internal format | W | H | BS |CC| Format | Type | SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer |
AddCompressedFormat(&map, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, 4, 4, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported);
AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, 4, 4, 128, 4, GL_RGBA, GL_UNSIGNED_BYTE, true, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported);
AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, 4, 4, 128, 4, GL_RGB, GL_FLOAT, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported);
AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, 4, 4, 128, 4, GL_RGB, GL_FLOAT, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported);
// For STENCIL_INDEX8 we chose a normalized component type for the following reasons: // For STENCIL_INDEX8 we chose a normalized component type for the following reasons:
// - Multisampled buffer are disallowed for non-normalized integer component types and we want to support it for STENCIL_INDEX8 // - Multisampled buffer are disallowed for non-normalized integer component types and we want to support it for STENCIL_INDEX8
// - All other stencil formats (all depth-stencil) are either float or normalized // - All other stencil formats (all depth-stencil) are either float or normalized
......
...@@ -61,6 +61,10 @@ enum class FormatID ...@@ -61,6 +61,10 @@ enum class FormatID
BC2_RGBA_UNORM_SRGB_BLOCK, BC2_RGBA_UNORM_SRGB_BLOCK,
BC3_RGBA_UNORM_BLOCK, BC3_RGBA_UNORM_BLOCK,
BC3_RGBA_UNORM_SRGB_BLOCK, BC3_RGBA_UNORM_SRGB_BLOCK,
BPTC_RGBA_UNORM_BLOCK,
BPTC_RGB_SIGNED_FLOAT_BLOCK,
BPTC_RGB_UNSIGNED_FLOAT_BLOCK,
BPTC_SRGB_ALPHA_UNORM_BLOCK,
D16_UNORM, D16_UNORM,
D24_UNORM_S8_UINT, D24_UNORM_S8_UINT,
D24_UNORM_X8_UINT, D24_UNORM_X8_UINT,
...@@ -187,6 +191,6 @@ enum class FormatID ...@@ -187,6 +191,6 @@ enum class FormatID
S8_UINT S8_UINT
}; };
constexpr uint32_t kNumANGLEFormats = 173; constexpr uint32_t kNumANGLEFormats = 177;
} // namespace angle } // namespace angle
...@@ -73,6 +73,10 @@ constexpr Format g_formatInfoTable[] = { ...@@ -73,6 +73,10 @@ constexpr Format g_formatInfoTable[] = {
{ FormatID::BC2_RGBA_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true }, { FormatID::BC2_RGBA_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true },
{ FormatID::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 }, { FormatID::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 },
{ FormatID::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 }, { FormatID::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 },
{ FormatID::BPTC_RGBA_UNORM_BLOCK, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true },
{ FormatID::BPTC_RGB_SIGNED_FLOAT_BLOCK, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 0, 0, 0, true },
{ FormatID::BPTC_RGB_UNSIGNED_FLOAT_BLOCK, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_FLOAT, 0, 0, 0, 0, 0, 0, 0, true },
{ FormatID::BPTC_SRGB_ALPHA_UNORM_BLOCK, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, true },
{ FormatID::D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, nullptr, NoCopyFunctions, ReadDepthStencil<D16>, WriteDepthStencil<D16>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 16, 0, 2, false }, { FormatID::D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, nullptr, NoCopyFunctions, ReadDepthStencil<D16>, WriteDepthStencil<D16>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 16, 0, 2, false },
{ FormatID::D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, nullptr, NoCopyFunctions, ReadDepthStencil<D24S8>, WriteDepthStencil<D24S8>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 8, 4, false }, { FormatID::D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, nullptr, NoCopyFunctions, ReadDepthStencil<D24S8>, WriteDepthStencil<D24S8>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 8, 4, false },
{ FormatID::D24_UNORM_X8_UINT, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT24, nullptr, NoCopyFunctions, ReadDepthStencil<D24>, WriteDepthStencil<D24>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 0, 4, false }, { FormatID::D24_UNORM_X8_UINT, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT24, nullptr, NoCopyFunctions, ReadDepthStencil<D24>, WriteDepthStencil<D24>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 24, 0, 4, false },
...@@ -267,12 +271,18 @@ FormatID Format::InternalFormatToID(GLenum internalFormat) ...@@ -267,12 +271,18 @@ FormatID Format::InternalFormatToID(GLenum internalFormat)
return FormatID::ASTC_8x6_UNORM_BLOCK; return FormatID::ASTC_8x6_UNORM_BLOCK;
case GL_COMPRESSED_RGBA_ASTC_8x8_KHR: case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
return FormatID::ASTC_8x8_UNORM_BLOCK; return FormatID::ASTC_8x8_UNORM_BLOCK;
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
return FormatID::BPTC_RGBA_UNORM_BLOCK;
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
return FormatID::BC1_RGBA_UNORM_BLOCK; return FormatID::BC1_RGBA_UNORM_BLOCK;
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
return FormatID::BC2_RGBA_UNORM_BLOCK; return FormatID::BC2_RGBA_UNORM_BLOCK;
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
return FormatID::BC3_RGBA_UNORM_BLOCK; return FormatID::BC3_RGBA_UNORM_BLOCK;
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
return FormatID::BPTC_RGB_SIGNED_FLOAT_BLOCK;
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
return FormatID::BPTC_RGB_UNSIGNED_FLOAT_BLOCK;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
return FormatID::BC1_RGB_UNORM_BLOCK; return FormatID::BC1_RGB_UNORM_BLOCK;
case GL_COMPRESSED_SIGNED_R11_EAC: case GL_COMPRESSED_SIGNED_R11_EAC:
...@@ -313,6 +323,8 @@ FormatID Format::InternalFormatToID(GLenum internalFormat) ...@@ -313,6 +323,8 @@ FormatID Format::InternalFormatToID(GLenum internalFormat)
return FormatID::ETC2_R8G8B8_SRGB_BLOCK; return FormatID::ETC2_R8G8B8_SRGB_BLOCK;
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
return FormatID::ETC2_R8G8B8A1_SRGB_BLOCK; return FormatID::ETC2_R8G8B8A1_SRGB_BLOCK;
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
return FormatID::BPTC_SRGB_ALPHA_UNORM_BLOCK;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
return FormatID::BC1_RGBA_UNORM_SRGB_BLOCK; return FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
......
...@@ -54,6 +54,10 @@ ...@@ -54,6 +54,10 @@
[ "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", "BC2_RGBA_UNORM_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", "BC2_RGBA_UNORM_SRGB_BLOCK" ],
[ "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", "BC3_RGBA_UNORM_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", "BC3_RGBA_UNORM_SRGB_BLOCK" ],
[ "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT", "BC1_RGB_UNORM_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT", "BC1_RGB_UNORM_SRGB_BLOCK" ],
[ "GL_COMPRESSED_RGBA_BPTC_UNORM_EXT", "BPTC_RGBA_UNORM_BLOCK" ],
[ "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT", "BPTC_SRGB_ALPHA_UNORM_BLOCK" ],
[ "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT", "BPTC_RGB_SIGNED_FLOAT_BLOCK" ],
[ "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT", "BPTC_RGB_UNSIGNED_FLOAT_BLOCK" ],
[ "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" ],
......
...@@ -171,6 +171,34 @@ ...@@ -171,6 +171,34 @@
"componentType": "unorm", "componentType": "unorm",
"swizzleFormat": "GL_RGBA8" "swizzleFormat": "GL_RGBA8"
}, },
"BPTC_RGBA_UNORM_BLOCK": {
"texFormat": "DXGI_FORMAT_BC7_UNORM",
"srvFormat": "DXGI_FORMAT_BC7_UNORM",
"channels": "rgba",
"componentType": "unorm",
"swizzleFormat": "GL_RGBA8"
},
"BPTC_SRGB_ALPHA_UNORM_BLOCK": {
"texFormat": "DXGI_FORMAT_BC7_UNORM_SRGB",
"srvFormat": "DXGI_FORMAT_BC7_UNORM_SRGB",
"channels": "rgba",
"componentType": "unorm",
"swizzleFormat": "GL_SRGB8_ALPHA8"
},
"BPTC_RGB_SIGNED_FLOAT_BLOCK": {
"texFormat": "DXGI_FORMAT_BC6H_SF16",
"srvFormat": "DXGI_FORMAT_BC6H_SF16",
"channels": "rgb",
"componentType": "float",
"swizzleFormat": "GL_RGBA32F"
},
"BPTC_RGB_UNSIGNED_FLOAT_BLOCK": {
"texFormat": "DXGI_FORMAT_BC6H_UF16",
"srvFormat": "DXGI_FORMAT_BC6H_UF16",
"channels": "rgb",
"componentType": "float",
"swizzleFormat": "GL_RGBA32F"
},
"D24_UNORM_S8_UINT": { "D24_UNORM_S8_UINT": {
"FL10Plus": { "FL10Plus": {
"texFormat": "DXGI_FORMAT_R24G8_TYPELESS", "texFormat": "DXGI_FORMAT_R24G8_TYPELESS",
......
...@@ -504,6 +504,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev ...@@ -504,6 +504,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
nullptr); nullptr);
return info; return info;
} }
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
{
static constexpr Format info(GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
angle::FormatID::BPTC_RGBA_UNORM_BLOCK,
DXGI_FORMAT_BC7_UNORM,
DXGI_FORMAT_BC7_UNORM,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_BC7_UNORM,
GL_RGBA8,
nullptr);
return info;
}
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
{ {
static constexpr Format info(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, static constexpr Format info(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
...@@ -546,6 +560,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev ...@@ -546,6 +560,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
nullptr); nullptr);
return info; return info;
} }
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
{
static constexpr Format info(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
angle::FormatID::BPTC_RGB_SIGNED_FLOAT_BLOCK,
DXGI_FORMAT_BC6H_SF16,
DXGI_FORMAT_BC6H_SF16,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_BC6H_SF16,
GL_RGBA32F,
nullptr);
return info;
}
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
{
static constexpr Format info(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
angle::FormatID::BPTC_RGB_UNSIGNED_FLOAT_BLOCK,
DXGI_FORMAT_BC6H_UF16,
DXGI_FORMAT_BC6H_UF16,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_BC6H_UF16,
GL_RGBA32F,
nullptr);
return info;
}
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
{ {
static constexpr Format info(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, static constexpr Format info(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
...@@ -854,6 +896,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev ...@@ -854,6 +896,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
nullptr); nullptr);
return info; return info;
} }
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
{
static constexpr Format info(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
angle::FormatID::BPTC_SRGB_ALPHA_UNORM_BLOCK,
DXGI_FORMAT_BC7_UNORM_SRGB,
DXGI_FORMAT_BC7_UNORM_SRGB,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_BC7_UNORM_SRGB,
GL_SRGB8_ALPHA8,
nullptr);
return info;
}
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
{ {
static constexpr Format info(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, static constexpr Format info(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
......
...@@ -279,6 +279,13 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -279,6 +279,13 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() ); InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() ); InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
// EXT_texture_compression_bptc formats
// | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, VersionOrExts(4, 2, "GL_ARB_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), NeverSupported() );
InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, VersionOrExts(4, 2, "GL_ARB_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), NeverSupported() );
InsertFormatMapping(&map, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, VersionOrExts(4, 2, "GL_ARB_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), NeverSupported() );
InsertFormatMapping(&map, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, VersionOrExts(4, 2, "GL_ARB_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_bptc"), AlwaysSupported(), NeverSupported(), NeverSupported() );
// Compressed formats, From ES 3.0.1 spec, table 3.16 // Compressed formats, From ES 3.0.1 spec, table 3.16
// | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support | // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
InsertFormatMapping(&map, GL_COMPRESSED_R11_EAC, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "OES_compressed_EAC_R11_unsigned_texture"), AlwaysSupported(), NeverSupported(), NeverSupported() ); InsertFormatMapping(&map, GL_COMPRESSED_R11_EAC, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "OES_compressed_EAC_R11_unsigned_texture"), AlwaysSupported(), NeverSupported(), NeverSupported() );
......
...@@ -613,5 +613,25 @@ ...@@ -613,5 +613,25 @@
"NONE": { "NONE": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>"
} }
},
"GL_COMPRESSED_RGBA_BPTC_UNORM_EXT": {
"NONE": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>"
}
},
"GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT": {
"NONE": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>"
}
},
"GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT": {
"NONE": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>"
}
},
"GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT": {
"NONE": {
"GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>"
}
} }
} }
...@@ -311,6 +311,18 @@ LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM(GLenum type) ...@@ -311,6 +311,18 @@ LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM(GLenum type)
} }
} }
LoadImageFunctionInfo COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default(GLenum type) LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default(GLenum type)
{ {
switch (type) switch (type)
...@@ -347,6 +359,30 @@ LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default(GLenum type) ...@@ -347,6 +359,30 @@ LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default(GLenum type)
} }
} }
LoadImageFunctionInfo COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type) LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type)
{ {
switch (type) switch (type)
...@@ -446,6 +482,18 @@ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_S ...@@ -446,6 +482,18 @@ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_S
} }
} }
LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type) LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type)
{ {
switch (type) switch (type)
...@@ -1740,12 +1788,18 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat) ...@@ -1740,12 +1788,18 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat)
} }
break; break;
} }
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
return COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default;
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
return COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default; return COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default;
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
return COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default; return COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default;
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
return COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default; return COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default;
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
return COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default;
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
return COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
return COMPRESSED_RGB_S3TC_DXT1_EXT_to_default; return COMPRESSED_RGB_S3TC_DXT1_EXT_to_default;
case GL_COMPRESSED_SIGNED_R11_EAC: case GL_COMPRESSED_SIGNED_R11_EAC:
...@@ -1825,6 +1879,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat) ...@@ -1825,6 +1879,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat)
} }
break; break;
} }
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
return COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
return COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default; return COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
......
...@@ -502,6 +502,22 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an ...@@ -502,6 +502,22 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
// This format is not implemented in Vulkan. // This format is not implemented in Vulkan.
break; break;
case angle::FormatID::BPTC_RGBA_UNORM_BLOCK:
// This format is not implemented in Vulkan.
break;
case angle::FormatID::BPTC_RGB_SIGNED_FLOAT_BLOCK:
// This format is not implemented in Vulkan.
break;
case angle::FormatID::BPTC_RGB_UNSIGNED_FLOAT_BLOCK:
// This format is not implemented in Vulkan.
break;
case angle::FormatID::BPTC_SRGB_ALPHA_UNORM_BLOCK:
// This format is not implemented in Vulkan.
break;
case angle::FormatID::D16_UNORM: case angle::FormatID::D16_UNORM:
internalFormat = GL_DEPTH_COMPONENT16; internalFormat = GL_DEPTH_COMPONENT16;
textureFormatID = angle::FormatID::D16_UNORM; textureFormatID = angle::FormatID::D16_UNORM;
......
...@@ -56,6 +56,10 @@ bool CompressedTextureFormatRequiresExactSize(GLenum internalFormat) ...@@ -56,6 +56,10 @@ bool CompressedTextureFormatRequiresExactSize(GLenum internalFormat)
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
case GL_COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE: case GL_COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE:
case GL_COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE: case GL_COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE:
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
return true; return true;
default: default:
......
...@@ -576,6 +576,10 @@ bool ValidateES2CopyTexImageParameters(Context *context, ...@@ -576,6 +576,10 @@ bool ValidateES2CopyTexImageParameters(Context *context,
case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE: case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE: case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidFormat); ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidFormat);
return false; return false;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
......
...@@ -10,6 +10,7 @@ angle_end2end_tests_sources = [ ...@@ -10,6 +10,7 @@ angle_end2end_tests_sources = [
"gl_tests/BlendFuncExtendedTest.cpp", "gl_tests/BlendFuncExtendedTest.cpp",
"gl_tests/BlendMinMaxTest.cpp", "gl_tests/BlendMinMaxTest.cpp",
"gl_tests/BlitFramebufferANGLETest.cpp", "gl_tests/BlitFramebufferANGLETest.cpp",
"gl_tests/BPTCCompressedTextureTest.cpp",
"gl_tests/BufferDataTest.cpp", "gl_tests/BufferDataTest.cpp",
"gl_tests/BuiltinVariableTest.cpp", "gl_tests/BuiltinVariableTest.cpp",
"gl_tests/ClearTest.cpp", "gl_tests/ClearTest.cpp",
......
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