diff --git a/scripts/code_generation_hashes/ANGLE_format.json b/scripts/code_generation_hashes/ANGLE_format.json index 336b56c9f..ab9dc470e 100644 --- a/scripts/code_generation_hashes/ANGLE_format.json +++ b/scripts/code_generation_hashes/ANGLE_format.json @@ -1,14 +1,14 @@ { "src/libANGLE/renderer/FormatID_autogen.h": - "083c08bb743bf72a900079890b14184f", + "5e017d47bc2eb942cf5717e05e7d072a", "src/libANGLE/renderer/Format_table_autogen.cpp": - "24a7e010def51eb4342caa5392536ea9", + "d696378917e290bc41487a7e2311d555", "src/libANGLE/renderer/angle_format.py": "7ce0869650454e1eebc93658d4d96844", "src/libANGLE/renderer/angle_format_data.json": - "288d2f350948f8b1928c249234a44b25", + "e39704d451d108335e737c39ad423113", "src/libANGLE/renderer/angle_format_map.json": - "be9f9bdbdf785dda05920146e8c55dbb", + "947fe0a2c3ca1a819a68b4a94bfcf614", "src/libANGLE/renderer/gen_angle_format_table.py": "37f4654bca2bebc7fdec1fc7ca9bc622" } \ No newline at end of file diff --git a/scripts/code_generation_hashes/ANGLE_load_functions_table.json b/scripts/code_generation_hashes/ANGLE_load_functions_table.json index 8c811ba93..dec8ef275 100644 --- a/scripts/code_generation_hashes/ANGLE_load_functions_table.json +++ b/scripts/code_generation_hashes/ANGLE_load_functions_table.json @@ -2,7 +2,7 @@ "src/libANGLE/renderer/gen_load_functions_table.py": "e65c50e84fc38ad34d0eb0bebb84aab6", "src/libANGLE/renderer/load_functions_data.json": - "6469fb3220567099b8488ecbfc7bdcf5", + "f32172c72959103dd38d044c8865ac2d", "src/libANGLE/renderer/load_functions_table_autogen.cpp": - "65043394689d85281597ab377bc88175" + "6ae60fe18896d4898d569cf791cf81db" } \ No newline at end of file diff --git a/scripts/code_generation_hashes/D3D11_format.json b/scripts/code_generation_hashes/D3D11_format.json index b53e26065..30cd9c2e7 100644 --- a/scripts/code_generation_hashes/D3D11_format.json +++ b/scripts/code_generation_hashes/D3D11_format.json @@ -6,7 +6,7 @@ "src/libANGLE/renderer/d3d/d3d11/texture_format_data.json": "d7483ece817e819588f4ca157716dc7b", "src/libANGLE/renderer/d3d/d3d11/texture_format_map.json": - "805d30e2443935e3a3bd68839699e171", + "511730c698bfc3da18f745d2036c70c7", "src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp": - "7c42f9e538cb675d13f8b5d2f248ef84" + "2e6fef6d2b8bfb0da5a90f5e6aa550b8" } \ No newline at end of file diff --git a/scripts/code_generation_hashes/DXGI_format.json b/scripts/code_generation_hashes/DXGI_format.json index a6e211fb8..51875ea85 100644 --- a/scripts/code_generation_hashes/DXGI_format.json +++ b/scripts/code_generation_hashes/DXGI_format.json @@ -2,7 +2,7 @@ "src/libANGLE/renderer/angle_format.py": "7ce0869650454e1eebc93658d4d96844", "src/libANGLE/renderer/angle_format_map.json": - "be9f9bdbdf785dda05920146e8c55dbb", + "947fe0a2c3ca1a819a68b4a94bfcf614", "src/libANGLE/renderer/d3d/d3d11/dxgi_format_data.json": "24f525b05dc665fbbc8c6d68fb863719", "src/libANGLE/renderer/d3d/d3d11/dxgi_format_map_autogen.cpp": diff --git a/scripts/code_generation_hashes/Vulkan_format.json b/scripts/code_generation_hashes/Vulkan_format.json index 791787e11..de5a4fd36 100644 --- a/scripts/code_generation_hashes/Vulkan_format.json +++ b/scripts/code_generation_hashes/Vulkan_format.json @@ -2,11 +2,11 @@ "src/libANGLE/renderer/angle_format.py": "7ce0869650454e1eebc93658d4d96844", "src/libANGLE/renderer/angle_format_map.json": - "be9f9bdbdf785dda05920146e8c55dbb", + "947fe0a2c3ca1a819a68b4a94bfcf614", "src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "09340e3ba114b4acef6460ac8b242040", "src/libANGLE/renderer/vulkan/vk_format_map.json": "9e0a57bee62f7b0603c7431c815d1be2", "src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp": - "8d7f42c646e4b05017552e5af1b3bc84" + "90a43248b071bf880aaa43a0142eac1b" } \ No newline at end of file diff --git a/src/image_util/loadimage.h b/src/image_util/loadimage.h index 12d4c182a..1b997bab7 100644 --- a/src/image_util/loadimage.h +++ b/src/image_util/loadimage.h @@ -488,7 +488,7 @@ void LoadRGB32FToRGB16F(size_t width, size_t outputRowPitch, size_t outputDepthPitch); -template +template inline void LoadCompressedToNative(size_t width, size_t height, size_t depth, diff --git a/src/image_util/loadimage.inc b/src/image_util/loadimage.inc index b8d590ca1..58886a00a 100644 --- a/src/image_util/loadimage.inc +++ b/src/image_util/loadimage.inc @@ -112,15 +112,16 @@ inline void Load32FTo16F(size_t width, size_t height, size_t depth, } } -template +template inline void LoadCompressedToNative(size_t width, size_t height, size_t depth, const uint8_t *input, size_t inputRowPitch, size_t inputDepthPitch, uint8_t *output, size_t outputRowPitch, size_t outputDepthPitch) { const size_t columns = (width + (blockWidth - 1)) / blockWidth; const size_t rows = (height + (blockHeight - 1)) / blockHeight; + const size_t layers = (depth + (blockDepth - 1)) / blockDepth; - for (size_t z = 0; z < depth; ++z) + for (size_t z = 0; z < layers; ++z) { for (size_t y = 0; y < rows; ++y) { diff --git a/src/libANGLE/Caps.cpp b/src/libANGLE/Caps.cpp index 9b20682b4..8c78f7f90 100644 --- a/src/libANGLE/Caps.cpp +++ b/src/libANGLE/Caps.cpp @@ -363,8 +363,8 @@ static bool DetermineS3TCsRGBTextureSupport(const TextureCapsMap &textureCaps) return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false); } -// Check for GL_KHR_texture_compression_astc_hdr and GL_KHR_texture_compression_astc_ldr -static bool DetermineASTCTextureSupport(const TextureCapsMap &textureCaps) +// Check for GL_KHR_texture_compression_astc_ldr +static bool DetermineASTCLDRTextureSupport(const TextureCapsMap &textureCaps) { constexpr GLenum requiredFormats[] = { GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, @@ -386,6 +386,31 @@ static bool DetermineASTCTextureSupport(const TextureCapsMap &textureCaps) return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false); } +// Check for GL_OES_texture_compression_astc +static bool DetermineASTCOESTExtureSupport(const TextureCapsMap &textureCaps) +{ + if (!DetermineASTCLDRTextureSupport(textureCaps)) + { + return false; + } + + // The OES version of the extension also requires the 3D ASTC formats + constexpr GLenum requiredFormats[] = { + GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, + GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, + GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, + GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, + GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, + }; + + return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false); +} + // Check for GL_ETC1_RGB8_OES static bool DetermineETC1RGB8TextureSupport(const TextureCapsMap &textureCaps) { @@ -647,12 +672,12 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps); textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps); textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps); - textureCompressionS3TCsRGB = DetermineS3TCsRGBTextureSupport(textureCaps); - textureCompressionASTCHDR = DetermineASTCTextureSupport(textureCaps); - textureCompressionASTCLDR = textureCompressionASTCHDR; - compressedETC1RGB8Texture = DetermineETC1RGB8TextureSupport(textureCaps); - compressedETC2RGB8Texture = DetermineETC2RGB8TextureSupport(textureCaps); - compressedETC2sRGB8Texture = DetermineETC2sRGB8TextureSupport(textureCaps); + textureCompressionS3TCsRGB = DetermineS3TCsRGBTextureSupport(textureCaps); + textureCompressionASTCLDRKHR = DetermineASTCLDRTextureSupport(textureCaps); + textureCompressionASTCOES = DetermineASTCOESTExtureSupport(textureCaps); + compressedETC1RGB8Texture = DetermineETC1RGB8TextureSupport(textureCaps); + compressedETC2RGB8Texture = DetermineETC2RGB8TextureSupport(textureCaps); + compressedETC2sRGB8Texture = DetermineETC2sRGB8TextureSupport(textureCaps); compressedETC2PunchthroughARGB8Texture = DetermineETC2PunchthroughARGB8TextureSupport(textureCaps); compressedETC2PunchthroughAsRGB8AlphaTexture = @@ -712,8 +737,9 @@ const ExtensionInfoMap &GetExtensionInfoMap() map["GL_ANGLE_texture_compression_dxt3"] = enableableExtension(&Extensions::textureCompressionDXT3); map["GL_ANGLE_texture_compression_dxt5"] = enableableExtension(&Extensions::textureCompressionDXT5); map["GL_EXT_texture_compression_s3tc_srgb"] = enableableExtension(&Extensions::textureCompressionS3TCsRGB); - map["GL_KHR_texture_compression_astc_hdr"] = enableableExtension(&Extensions::textureCompressionASTCHDR); - map["GL_KHR_texture_compression_astc_ldr"] = enableableExtension(&Extensions::textureCompressionASTCLDR); + map["GL_KHR_texture_compression_astc_ldr"] = enableableExtension(&Extensions::textureCompressionASTCLDRKHR); + map["GL_KHR_texture_compression_astc_hdr"] = enableableExtension(&Extensions::textureCompressionASTCHDRKHR); + map["GL_OES_texture_compression_astc"] = enableableExtension(&Extensions::textureCompressionASTCOES); map["GL_EXT_texture_compression_bptc"] = enableableExtension(&Extensions::textureCompressionBPTC); map["GL_OES_compressed_ETC1_RGB8_texture"] = enableableExtension(&Extensions::compressedETC1RGB8Texture); map["OES_compressed_ETC2_RGB8_texture"] = enableableExtension(&Extensions::compressedETC2RGB8Texture); diff --git a/src/libANGLE/Caps.h b/src/libANGLE/Caps.h index b47b3261b..8e013c711 100644 --- a/src/libANGLE/Caps.h +++ b/src/libANGLE/Caps.h @@ -106,7 +106,9 @@ struct Extensions // GL_EXT_texture_rg // GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3, // GL_ANGLE_texture_compression_dxt5 - // GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr + // GL_KHR_texture_compression_astc_ldr, GL_OES_texture_compression_astc. + // NOTE: GL_KHR_texture_compression_astc_hdr must be enabled separately. Support for the + // HDR profile cannot be determined from the format enums alone. // GL_OES_compressed_ETC1_RGB8_texture // GL_EXT_sRGB // GL_ANGLE_depth_texture, GL_OES_depth32 @@ -183,11 +185,14 @@ struct Extensions // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT bool textureCompressionS3TCsRGB = false; - // GL_KHR_texture_compression_astc_hdr - bool textureCompressionASTCHDR = false; - // GL_KHR_texture_compression_astc_ldr - bool textureCompressionASTCLDR = false; + bool textureCompressionASTCLDRKHR = false; + + // GL_KHR_texture_compression_astc_hdr + bool textureCompressionASTCHDRKHR = false; + + // GL_OES_texture_compression_astc + bool textureCompressionASTCOES = false; // GL_EXT_texture_compression_bptc bool textureCompressionBPTC = false; diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp index 0ac5cbbb9..c65eb122f 100644 --- a/src/libANGLE/Context.cpp +++ b/src/libANGLE/Context.cpp @@ -3189,6 +3189,9 @@ Extensions Context::generateSupportedExtensions() const supportedExtensions.copyTexture3d = false; supportedExtensions.textureMultisample = false; + // Requires glCompressedTexImage3D + supportedExtensions.textureCompressionASTCOES = false; + // Don't expose GL_EXT_texture_sRGB_decode without sRGB texture support if (!supportedExtensions.sRGB) { @@ -3268,6 +3271,22 @@ Extensions Context::generateSupportedExtensions() const // GL_CHROMIUM_lose_context is implemented in the frontend supportedExtensions.loseContextCHROMIUM = true; + // The ASTC texture extensions have dependency requirements. + if (supportedExtensions.textureCompressionASTCHDRKHR) + { + // GL_KHR_texture_compression_astc_hdr cannot be exposed without also exposing + // GL_KHR_texture_compression_astc_ldr + ASSERT(supportedExtensions.textureCompressionASTCLDRKHR); + } + + if (supportedExtensions.textureCompressionASTCOES) + { + // GL_OES_texture_compression_astc cannot be exposed without also exposing + // GL_KHR_texture_compression_astc_ldr and GL_KHR_texture_compression_astc_hdr + ASSERT(supportedExtensions.textureCompressionASTCLDRKHR); + ASSERT(supportedExtensions.textureCompressionASTCHDRKHR); + } + return supportedExtensions; } diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp index 69ef9c548..800e8050d 100644 --- a/src/libANGLE/formatutils.cpp +++ b/src/libANGLE/formatutils.cpp @@ -334,6 +334,7 @@ InternalFormat::InternalFormat() compressed(false), compressedBlockWidth(0), compressedBlockHeight(0), + compressedBlockDepth(0), format(GL_NONE), type(GL_NONE), componentType(GL_NONE), @@ -673,6 +674,7 @@ void AddCompressedFormat(InternalFormatInfoMap *map, GLenum internalFormat, GLuint compressedBlockWidth, GLuint compressedBlockHeight, + GLuint compressedBlockDepth, GLuint compressedBlockSize, GLuint componentCount, bool srgb, @@ -687,6 +689,7 @@ void AddCompressedFormat(InternalFormatInfoMap *map, formatInfo.sizedInternalFormat = internalFormat; formatInfo.compressedBlockWidth = compressedBlockWidth; formatInfo.compressedBlockHeight = compressedBlockHeight; + formatInfo.compressedBlockDepth = compressedBlockDepth; formatInfo.pixelBytes = compressedBlockSize / 8; formatInfo.componentCount = componentCount; formatInfo.format = internalFormat; @@ -815,77 +818,99 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() AddLUMAFormat(&map, GL_LUMINANCE_ALPHA32F_EXT, true, 32, 32, GL_LUMINANCE_ALPHA, GL_FLOAT, GL_FLOAT, RequireExtAndExt<&Extensions::textureStorage, &Extensions::textureFloat>, RequireExt<&Extensions::textureFloatLinear>, NeverSupported, NeverSupported); // Compressed formats, From ES 3.0.1 spec, table 3.16 - // | Internal format |W |H | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_COMPRESSED_R11_EAC, 4, 4, 64, 1, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACR11UnsignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SIGNED_R11_EAC, 4, 4, 64, 1, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACR11SignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RG11_EAC, 4, 4, 128, 2, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACRG11UnsignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SIGNED_RG11_EAC, 4, 4, 128, 2, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACRG11SignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB8_ETC2, 4, 4, 64, 3, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2RGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ETC2, 4, 4, 64, 3, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2sRGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, 4, 4, 64, 3, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2PunchthroughARGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 4, 4, 64, 3, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2PunchthroughAsRGB8AlphaTexture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, 4, 4, 128, 4, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2RGBA8Texture>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, 4, 4, 128, 4, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2sRGB8Alpha8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + // | Internal format |W |H |D | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_COMPRESSED_R11_EAC, 4, 4, 1, 64, 1, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACR11UnsignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SIGNED_R11_EAC, 4, 4, 1, 64, 1, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACR11SignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RG11_EAC, 4, 4, 1, 128, 2, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACRG11UnsignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SIGNED_RG11_EAC, 4, 4, 1, 128, 2, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedEACRG11SignedTexture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB8_ETC2, 4, 4, 1, 64, 3, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2RGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ETC2, 4, 4, 1, 64, 3, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2sRGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, 4, 4, 1, 64, 3, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2PunchthroughARGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 4, 4, 1, 64, 3, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2PunchthroughAsRGB8AlphaTexture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, 4, 4, 1, 128, 4, false, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2RGBA8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, 4, 4, 1, 128, 4, true, RequireESOrExtOrExt<3, 0, &Extensions::compressedTextureETC, &Extensions::compressedETC2sRGB8Alpha8Texture>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_EXT_texture_compression_dxt1 - // | Internal format |W |H | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 64, 3, false, RequireExt<&Extensions::textureCompressionDXT1>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 4, 4, 64, 4, false, RequireExt<&Extensions::textureCompressionDXT1>, AlwaysSupported, NeverSupported, NeverSupported); + // | Internal format |W |H |D | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 1, 64, 3, false, RequireExt<&Extensions::textureCompressionDXT1>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 4, 4, 1, 64, 4, false, RequireExt<&Extensions::textureCompressionDXT1>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_ANGLE_texture_compression_dxt3 - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionDXT3>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionDXT3>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_ANGLE_texture_compression_dxt5 - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionDXT5>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionDXT5>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_OES_compressed_ETC1_RGB8_texture - AddCompressedFormat(&map, GL_ETC1_RGB8_OES, 4, 4, 64, 3, false, RequireExt<&Extensions::compressedETC1RGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_ETC1_RGB8_OES, 4, 4, 1, 64, 3, false, RequireExt<&Extensions::compressedETC1RGB8Texture>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_EXT_texture_compression_s3tc_srgb - // | Internal format |W |H | BS |CC|SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, 4, 4, 64, 3, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 4, 4, 64, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 4, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 4, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); + // | Internal format |W |H |D | BS |CC|SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, 4, 4, 1, 64, 3, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 4, 4, 1, 64, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 4, 4, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 4, 4, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionS3TCsRGB>, AlwaysSupported, NeverSupported, NeverSupported); - // From KHR_texture_compression_astc_hdr - // | Internal format | W | H | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, 4, 4, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, 5, 4, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, 5, 5, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, 6, 5, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, 6, 6, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, 8, 5, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, 8, 6, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x8_KHR, 8, 8, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, 10, 5, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x6_KHR, 10, 6, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x8_KHR, 10, 8, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 128, 4, false, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); + // From GL_KHR_texture_compression_astc_ldr and KHR_texture_compression_astc_hdr and GL_OES_texture_compression_astc + // | Internal format | W | H |D | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, 5, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, 5, 5, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, 6, 5, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, 6, 6, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, 8, 5, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, 8, 6, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_8x8_KHR, 8, 8, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, 10, 5, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x6_KHR, 10, 6, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x8_KHR, 10, 8, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, 4, 4, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, 5, 4, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, 5, 5, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, 6, 5, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, 6, 6, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, 8, 5, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, 8, 6, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, 8, 8, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, 10, 5, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, 10, 6, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, 10, 8, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 10, 10, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 128, 4, true, RequireExtOrExt<&Extensions::textureCompressionASTCHDR, &Extensions::textureCompressionASTCLDR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, 4, 4, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, 5, 4, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, 5, 5, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, 6, 5, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, 6, 6, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, 8, 5, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, 8, 6, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, 8, 8, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, 10, 5, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, 10, 6, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, 10, 8, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 10, 10, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCLDRKHR>, AlwaysSupported, NeverSupported, NeverSupported); + + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, 3, 3, 3, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, 4, 3, 3, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, 4, 4, 3, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, 4, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, 5, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, 5, 5, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, 5, 5, 5, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, 6, 5, 5, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, 6, 6, 5, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, 6, 6, 6, 128, 4, false, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, 3, 3, 3, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, 4, 3, 3, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, 4, 4, 3, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, 4, 4, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, 5, 4, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, 5, 5, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, 5, 5, 5, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, 6, 5, 5, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, 6, 6, 5, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, 6, 6, 6, 128, 4, true, RequireExt<&Extensions::textureCompressionASTCOES>, AlwaysSupported, NeverSupported, NeverSupported); // From EXT_texture_compression_bptc - // | Internal format | W | H | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, 4, 4, 128, 4, true, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, 4, 4, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); + // | Internal format | W | H |D | BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, 4, 4, 1, 128, 4, true, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, 4, 4, 1, 128, 4, false, RequireExt<&Extensions::textureCompressionBPTC>, AlwaysSupported, NeverSupported, NeverSupported); // 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 @@ -895,12 +920,12 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() AddDepthStencilFormat(&map, GL_STENCIL_INDEX8, true, 0, 8, 0, GL_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, NeverSupported, RequireES<1, 0>, RequireES<1, 0>); // From GL_ANGLE_lossy_etc_decode - // | Internal format |W |H |BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | - AddCompressedFormat(&map, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, 4, 4, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 64, 3, true, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); - AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 64, 3, true, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); + // | Internal format |W |H |D |BS |CC| SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | + AddCompressedFormat(&map, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, 4, 4, 1, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 1, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 1, 64, 3, true, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 1, 64, 3, false, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); + AddCompressedFormat(&map, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, 4, 4, 1, 64, 3, true, RequireExt<&Extensions::lossyETCDecode>, AlwaysSupported, NeverSupported, NeverSupported); // From GL_EXT_texture_norm16 // | Internal format |sized| R | G | B | A |S | Format | Type | Component type | SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | diff --git a/src/libANGLE/formatutils.h b/src/libANGLE/formatutils.h index 27eb060ab..98af2330a 100644 --- a/src/libANGLE/formatutils.h +++ b/src/libANGLE/formatutils.h @@ -153,6 +153,7 @@ struct InternalFormat bool compressed; GLuint compressedBlockWidth; GLuint compressedBlockHeight; + GLuint compressedBlockDepth; GLenum format; GLenum type; diff --git a/src/libANGLE/renderer/FormatID_autogen.h b/src/libANGLE/renderer/FormatID_autogen.h index beab70e3e..1652004d0 100644 --- a/src/libANGLE/renderer/FormatID_autogen.h +++ b/src/libANGLE/renderer/FormatID_autogen.h @@ -34,16 +34,36 @@ enum class FormatID ASTC_12x10_UNORM_BLOCK, ASTC_12x12_SRGB_BLOCK, ASTC_12x12_UNORM_BLOCK, + ASTC_3x3x3_UNORM_BLOCK, + ASTC_3x3x3_UNORM_SRGB_BLOCK, + ASTC_4x3x3_UNORM_BLOCK, + ASTC_4x3x3_UNORM_SRGB_BLOCK, ASTC_4x4_SRGB_BLOCK, ASTC_4x4_UNORM_BLOCK, + ASTC_4x4x3_UNORM_BLOCK, + ASTC_4x4x3_UNORM_SRGB_BLOCK, + ASTC_4x4x4_UNORM_BLOCK, + ASTC_4x4x4_UNORM_SRGB_BLOCK, ASTC_5x4_SRGB_BLOCK, ASTC_5x4_UNORM_BLOCK, + ASTC_5x4x4_UNORM_BLOCK, + ASTC_5x4x4_UNORM_SRGB_BLOCK, ASTC_5x5_SRGB_BLOCK, ASTC_5x5_UNORM_BLOCK, + ASTC_5x5x4_UNORM_BLOCK, + ASTC_5x5x4_UNORM_SRGB_BLOCK, + ASTC_5x5x5_UNORM_BLOCK, + ASTC_5x5x5_UNORM_SRGB_BLOCK, ASTC_6x5_SRGB_BLOCK, ASTC_6x5_UNORM_BLOCK, + ASTC_6x5x5_UNORM_BLOCK, + ASTC_6x5x5_UNORM_SRGB_BLOCK, ASTC_6x6_SRGB_BLOCK, ASTC_6x6_UNORM_BLOCK, + ASTC_6x6x5_UNORM_BLOCK, + ASTC_6x6x5_UNORM_SRGB_BLOCK, + ASTC_6x6x6_UNORM_BLOCK, + ASTC_6x6x6_UNORM_SRGB_BLOCK, ASTC_8x5_SRGB_BLOCK, ASTC_8x5_UNORM_BLOCK, ASTC_8x6_SRGB_BLOCK, @@ -196,7 +216,7 @@ enum class FormatID S8_UINT }; -constexpr uint32_t kNumANGLEFormats = 177; +constexpr uint32_t kNumANGLEFormats = 197; } // namespace angle diff --git a/src/libANGLE/renderer/Format_table_autogen.cpp b/src/libANGLE/renderer/Format_table_autogen.cpp index 98cf3405e..5753f268c 100644 --- a/src/libANGLE/renderer/Format_table_autogen.cpp +++ b/src/libANGLE/renderer/Format_table_autogen.cpp @@ -41,16 +41,36 @@ const Format gFormatInfoTable[] = { { FormatID::ASTC_12x10_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_12x12_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_12x12_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_3x3x3_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_3x3x3_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x3x3_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x3x3_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_4x4_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_4x4_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x4x3_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x4x3_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x4x4_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_4x4x4_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_5x4_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_5x4_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x4x4_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x4x4_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_5x5_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_5x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x5x4_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x5x4_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x5x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_5x5x5_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_6x5_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_6x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x5x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x5x5_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_6x6_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_6x6_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x6x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x6x5_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x6x6_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, + { FormatID::ASTC_6x6x6_UNORM_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_8x5_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_8x5_UNORM_BLOCK, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, { FormatID::ASTC_8x6_SRGB_BLOCK, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 16, std::numeric_limits::max(), true, false, false, gl::VertexAttribType::InvalidEnum }, @@ -255,16 +275,36 @@ FormatID Format::InternalFormatToID(GLenum internalFormat) return FormatID::ASTC_12x10_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_12x12_KHR: return FormatID::ASTC_12x12_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_3x3x3_OES: + return FormatID::ASTC_3x3x3_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_4x3x3_OES: + return FormatID::ASTC_4x3x3_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: return FormatID::ASTC_4x4_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_4x4x3_OES: + return FormatID::ASTC_4x4x3_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_4x4x4_OES: + return FormatID::ASTC_4x4x4_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: return FormatID::ASTC_5x4_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_5x4x4_OES: + return FormatID::ASTC_5x4x4_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: return FormatID::ASTC_5x5_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_5x5x4_OES: + return FormatID::ASTC_5x5x4_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_5x5x5_OES: + return FormatID::ASTC_5x5x5_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_6x5_KHR: return FormatID::ASTC_6x5_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_6x5x5_OES: + return FormatID::ASTC_6x5x5_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_6x6_KHR: return FormatID::ASTC_6x6_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_6x6x5_OES: + return FormatID::ASTC_6x6x5_UNORM_BLOCK; + case GL_COMPRESSED_RGBA_ASTC_6x6x6_OES: + return FormatID::ASTC_6x6x6_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_8x5_KHR: return FormatID::ASTC_8x5_UNORM_BLOCK; case GL_COMPRESSED_RGBA_ASTC_8x6_KHR: @@ -301,16 +341,36 @@ FormatID Format::InternalFormatToID(GLenum internalFormat) return FormatID::ASTC_12x10_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: return FormatID::ASTC_12x12_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES: + return FormatID::ASTC_3x3x3_UNORM_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES: + return FormatID::ASTC_4x3x3_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: return FormatID::ASTC_4x4_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES: + return FormatID::ASTC_4x4x3_UNORM_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES: + return FormatID::ASTC_4x4x4_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: return FormatID::ASTC_5x4_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES: + return FormatID::ASTC_5x4x4_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: return FormatID::ASTC_5x5_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES: + return FormatID::ASTC_5x5x4_UNORM_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES: + return FormatID::ASTC_5x5x5_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: return FormatID::ASTC_6x5_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES: + return FormatID::ASTC_6x5x5_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: return FormatID::ASTC_6x6_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES: + return FormatID::ASTC_6x6x5_UNORM_SRGB_BLOCK; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES: + return FormatID::ASTC_6x6x6_UNORM_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: return FormatID::ASTC_8x5_SRGB_BLOCK; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: diff --git a/src/libANGLE/renderer/angle_format_data.json b/src/libANGLE/renderer/angle_format_data.json index 5d3840ac2..4f8175495 100644 --- a/src/libANGLE/renderer/angle_format_data.json +++ b/src/libANGLE/renderer/angle_format_data.json @@ -117,6 +117,66 @@ "ASTC_12x12_UNORM_BLOCK": { "blockPixelBytes": "16" }, + "ASTC_3x3x3_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x3x3_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x4x3_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x4x4_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x4x4_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x5x4_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x5x5_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x5x5_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x6x5_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x6x6_UNORM_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_3x3x3_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x3x3_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x4x3_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_4x4x4_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x4x4_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x5x4_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_5x5x5_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x5x5_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x6x5_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, + "ASTC_6x6x6_UNORM_SRGB_BLOCK": { + "blockPixelBytes": "16" + }, "BC1_RGB_UNORM_BLOCK": { "blockPixelBytes": "8" }, diff --git a/src/libANGLE/renderer/angle_format_map.json b/src/libANGLE/renderer/angle_format_map.json index 0475550c7..e928d0ba9 100644 --- a/src/libANGLE/renderer/angle_format_map.json +++ b/src/libANGLE/renderer/angle_format_map.json @@ -47,6 +47,26 @@ [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR", "ASTC_10x10_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR", "ASTC_12x10_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR", "ASTC_12x12_SRGB_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES", "ASTC_3x3x3_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES", "ASTC_4x3x3_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES", "ASTC_4x4x3_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES", "ASTC_4x4x4_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES", "ASTC_5x4x4_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES", "ASTC_5x5x4_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES", "ASTC_5x5x5_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES", "ASTC_6x5x5_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES", "ASTC_6x6x5_UNORM_BLOCK" ], + [ "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES", "ASTC_6x6x6_UNORM_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES", "ASTC_3x3x3_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES", "ASTC_4x3x3_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES", "ASTC_4x4x3_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES", "ASTC_4x4x4_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES", "ASTC_5x4x4_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES", "ASTC_5x5x4_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES", "ASTC_5x5x5_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES", "ASTC_6x5x5_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES", "ASTC_6x6x5_UNORM_SRGB_BLOCK" ], + [ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES", "ASTC_6x6x6_UNORM_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", "ETC2_R8G8B8A8_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB8_ETC2", "ETC2_R8G8B8_SRGB_BLOCK" ], [ "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", "ETC2_R8G8B8A1_SRGB_BLOCK" ], diff --git a/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json b/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json index baa2cf7d1..2d7875ae3 100644 --- a/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json +++ b/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json @@ -39,6 +39,26 @@ "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR": "NONE", + "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES": "NONE", + "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES": "NONE", + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC": "R8G8B8A8_UNORM_SRGB", "GL_COMPRESSED_SRGB8_ETC2": "R8G8B8A8_UNORM_SRGB", "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2": "R8G8B8A8_UNORM_SRGB", diff --git a/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp b/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp index 0c94b4ea0..594ee848c 100644 --- a/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp @@ -392,6 +392,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_3x3x3_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_RGBA_ASTC_4x3x3_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_4x4_KHR, @@ -406,6 +434,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_4x4x3_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_RGBA_ASTC_4x4x4_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_5x4_KHR, @@ -420,6 +476,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_5x4x4_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_5x5_KHR, @@ -434,6 +504,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_5x5x4_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_RGBA_ASTC_5x5x5_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_6x5_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_6x5_KHR, @@ -448,6 +546,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_6x5x5_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_6x6_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_6x6_KHR, @@ -462,6 +574,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_RGBA_ASTC_6x6x5_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_RGBA_ASTC_6x6x6_OES: + { + static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_RGBA_ASTC_8x5_KHR: { static constexpr Format info(GL_COMPRESSED_RGBA_ASTC_8x5_KHR, @@ -714,6 +854,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, @@ -728,6 +896,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, @@ -742,6 +938,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, @@ -756,6 +966,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, @@ -770,6 +1008,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, @@ -784,6 +1036,34 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev nullptr); return info; } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES: + { + static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, + angle::FormatID::NONE, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + DXGI_FORMAT_UNKNOWN, + GL_NONE, + nullptr); + return info; + } case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: { static constexpr Format info(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, diff --git a/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp b/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp index 74fd87352..826b44695 100644 --- a/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp @@ -331,10 +331,10 @@ static D3D9FormatMap BuildD3D9FormatMap() InsertD3D9FormatInfo(&map, GL_BGRA4_ANGLEX, D3DFMT_A8R8G8B8, D3DFMT_A8R8G8B8, LoadBGRA4ToBGRA8 ); InsertD3D9FormatInfo(&map, GL_BGR5_A1_ANGLEX, D3DFMT_A8R8G8B8, D3DFMT_A8R8G8B8, LoadBGR5A1ToBGRA8 ); - InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, D3DFMT_DXT1, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 8> ); - InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, D3DFMT_DXT1, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 8> ); - InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, D3DFMT_DXT3, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 16> ); - InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, D3DFMT_DXT5, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 16> ); + InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, D3DFMT_DXT1, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 1, 8> ); + InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, D3DFMT_DXT1, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 1, 8> ); + InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, D3DFMT_DXT3, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 1, 16> ); + InsertD3D9FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, D3DFMT_DXT5, D3DFMT_UNKNOWN, LoadCompressedToNative<4, 4, 1, 16> ); // These formats require checking if the renderer supports D3DFMT_L8 or D3DFMT_A8L8 and // then changing the format and loading function appropriately. diff --git a/src/libANGLE/renderer/gl/formatutilsgl.cpp b/src/libANGLE/renderer/gl/formatutilsgl.cpp index fa267c772..3b5b2bdbd 100644 --- a/src/libANGLE/renderer/gl/formatutilsgl.cpp +++ b/src/libANGLE/renderer/gl/formatutilsgl.cpp @@ -308,6 +308,57 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() // From GL_ETC1_RGB8_OES InsertFormatMapping(&map, GL_ETC1_RGB8_OES, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_ETC1_RGB8_OES"), AlwaysSupported(), NeverSupported(), NeverSupported() ); + + // From GL_OES_texture_compression_astc + // | Format | OpenGL texture | Filter | Render | OpenGL ES texture support | Filter | ES attachment | ES renderbuffer | + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_8x8_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_10x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_10x8_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_10x10_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_KHR_texture_compression_astc_ldr"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_3x3x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_4x3x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_4x4x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_4x4x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_5x4x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_5x5x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_5x5x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_6x5x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_6x6x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_RGBA_ASTC_6x6x6_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); + InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES, NeverSupported(), NeverSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_compression_astc"), AlwaysSupported(), NeverSupported(), NeverSupported()); // clang-format on diff --git a/src/libANGLE/renderer/gl/renderergl_utils.cpp b/src/libANGLE/renderer/gl/renderergl_utils.cpp index f09440839..319986eb0 100644 --- a/src/libANGLE/renderer/gl/renderergl_utils.cpp +++ b/src/libANGLE/renderer/gl/renderergl_utils.cpp @@ -1091,6 +1091,9 @@ void GenerateCaps(const FunctionsGL *functions, // Extension support extensions->setTextureExtensionSupport(*textureCapsMap); + extensions->textureCompressionASTCHDRKHR = + extensions->textureCompressionASTCLDRKHR && + functions->hasGLESExtension("GL_KHR_texture_compression_astc_hdr"); extensions->elementIndexUint = functions->standard == STANDARD_GL_DESKTOP || functions->isAtLeastGLES(gl::Version(3, 0)) || functions->hasGLESExtension("GL_OES_element_index_uint"); diff --git a/src/libANGLE/renderer/load_functions_data.json b/src/libANGLE/renderer/load_functions_data.json index 078b33f04..c6323f1fc 100644 --- a/src/libANGLE/renderer/load_functions_data.json +++ b/src/libANGLE/renderer/load_functions_data.json @@ -34,7 +34,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2SRGBA8ToSRGBA8" }, "ETC2_R8G8B8A8_SRGB_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2": { @@ -42,7 +42,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2RGB8A1ToRGBA8" }, "ETC2_R8G8B8A1_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_RGB32UI": { @@ -76,7 +76,7 @@ "GL_UNSIGNED_BYTE": "LoadEACR11ToR16" }, "EAC_R11_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_RGBA32UI": { @@ -99,7 +99,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2SRGB8A1ToRGBA8" }, "ETC2_R8G8B8A1_SRGB_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_R16F": { @@ -131,7 +131,7 @@ }, "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_RGB": { @@ -175,7 +175,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2RGB8ToRGBA8" }, "ETC2_R8G8B8_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_RGBA32F": { @@ -211,7 +211,7 @@ "GL_UNSIGNED_BYTE": "LoadEACRG11SToRG16" }, "EAC_R11G11_SNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_DEPTH_COMPONENT16": { @@ -325,7 +325,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2RGBA8ToRGBA8" }, "ETC2_R8G8B8A8_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_RGB8I": { @@ -341,7 +341,7 @@ "GL_UNSIGNED_BYTE": "LoadETC2SRGB8ToRGBA8" }, "ETC2_R8G8B8_SRGB_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_DEPTH32F_STENCIL8": { @@ -506,7 +506,7 @@ "GL_UNSIGNED_BYTE": "LoadEACRG11ToRG16" }, "EAC_R11G11_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_SRGB8_ALPHA8": { @@ -577,17 +577,17 @@ "GL_UNSIGNED_BYTE": "LoadEACR11SToR16" }, "EAC_R11_SNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_STENCIL_INDEX8": { @@ -665,7 +665,7 @@ }, "GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_RG16I": { @@ -721,10 +721,10 @@ "GL_UNSIGNED_BYTE": "LoadETC1RGB8ToRGBA8" }, "ETC1_R8G8B8_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" }, "ETC2_R8G8B8_UNORM_BLOCK": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": { @@ -800,182 +800,282 @@ }, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 8>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 8>" } }, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGBA_BPTC_UNORM_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_4x4_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_5x4_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_5x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_6x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_6x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_8x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 5, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_8x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 6, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_8x8_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 8, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 8, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_10x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 5, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_10x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 6, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_10x8_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 8, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 8, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_10x10_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 10, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 10, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_12x10_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 10, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 10, 1, 16>" } }, "GL_COMPRESSED_RGBA_ASTC_12x12_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 12, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 12, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 5, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 6, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 8, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<8, 8, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 5, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 5, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 6, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 6, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 8, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 8, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 10, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<10, 10, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 10, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 10, 1, 16>" } }, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR": { "NONE": { - "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 12, 16>" + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<12, 12, 1, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<3, 3, 3, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 3, 3, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 3, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 4, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 4, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 4, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 5, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 5, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 5, 16>" + } + }, + "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 6, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<3, 3, 3, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 3, 3, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 3, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<4, 4, 4, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 4, 4, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 4, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<5, 5, 5, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 5, 5, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 5, 16>" + } + }, + "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES": { + "NONE": { + "GL_UNSIGNED_BYTE": "LoadCompressedToNative<6, 6, 6, 16>" } } } diff --git a/src/libANGLE/renderer/load_functions_table_autogen.cpp b/src/libANGLE/renderer/load_functions_table_autogen.cpp index 59120493d..a06b12e78 100644 --- a/src/libANGLE/renderer/load_functions_table_autogen.cpp +++ b/src/libANGLE/renderer/load_functions_table_autogen.cpp @@ -281,7 +281,7 @@ LoadImageFunctionInfo COMPRESSED_R11_EAC_to_EAC_R11_UNORM_BLOCK(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -305,7 +305,7 @@ LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_EAC_R11G11_UNORM_BLOCK(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -329,7 +329,7 @@ LoadImageFunctionInfo COMPRESSED_RGB8_ETC2_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -366,7 +366,7 @@ LoadImageFunctionInfo COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -403,7 +403,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_ETC2_R8G8B8A8_UNORM_BLOCK(GLe switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -427,7 +427,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x10_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -439,7 +439,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x5_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -451,7 +451,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x6_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -463,7 +463,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x8_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -475,7 +475,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_12x10_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -487,7 +487,31 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_12x12_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_3x3x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<3, 3, 3, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x3x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 3, 3, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -499,7 +523,31 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 3, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 4, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -511,7 +559,19 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x4_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x4x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 4, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -523,7 +583,31 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 4, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 5, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -535,7 +619,19 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x5_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x5x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 5, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -547,7 +643,31 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 5, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6x6_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 6, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -559,7 +679,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x5_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -571,7 +691,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x6_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -583,7 +703,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x8_KHR_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -595,7 +715,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -607,7 +727,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -619,7 +739,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -631,7 +751,7 @@ LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -643,7 +763,7 @@ LoadImageFunctionInfo COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -655,7 +775,7 @@ LoadImageFunctionInfo COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default(GLenum t switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -667,7 +787,7 @@ LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -679,7 +799,7 @@ LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_EAC_R11_SNORM_BLOCK(GLenum ty switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -703,7 +823,7 @@ LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_EAC_R11G11_SNORM_BLOCK(GLenu switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -727,7 +847,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR_to_default(GLenum t switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -739,7 +859,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR_to_default(GLenum ty switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -751,7 +871,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR_to_default(GLenum ty switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -763,7 +883,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR_to_default(GLenum ty switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -775,7 +895,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR_to_default(GLenum t switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -787,7 +907,31 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR_to_default(GLenum t switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<3, 3, 3, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 3, 3, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -799,7 +943,31 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 3, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 4, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -811,7 +979,19 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 4, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -823,7 +1003,31 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 4, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 5, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -835,7 +1039,19 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 5, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -847,7 +1063,31 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 1, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 5, 16>, true); + default: + UNREACHABLE(); + return LoadImageFunctionInfo(UnreachableLoadFunction, true); + } +} + +LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES_to_default(GLenum type) +{ + switch (type) + { + case GL_UNSIGNED_BYTE: + return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 6, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -859,7 +1099,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -871,7 +1111,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -883,7 +1123,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -895,7 +1135,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_ETC2_R8G8B8A8_SRGB_BLO switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -919,7 +1159,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ETC2_to_ETC2_R8G8B8_SRGB_BLOCK(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -957,7 +1197,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1 switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -995,7 +1235,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default(GLenum typ switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1007,7 +1247,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1019,7 +1259,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT_to_default(GLenum type switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1031,7 +1271,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT_to_default(GLenum type switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 16>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1043,7 +1283,7 @@ LoadImageFunctionInfo COMPRESSED_SRGB_S3TC_DXT1_EXT_to_default(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1177,7 +1417,7 @@ LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -1189,7 +1429,7 @@ LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type) switch (type) { case GL_UNSIGNED_BYTE: - return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 8>, true); + return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true); default: UNREACHABLE(); return LoadImageFunctionInfo(UnreachableLoadFunction, true); @@ -2799,16 +3039,36 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat) return COMPRESSED_RGBA_ASTC_12x10_KHR_to_default; case GL_COMPRESSED_RGBA_ASTC_12x12_KHR: return COMPRESSED_RGBA_ASTC_12x12_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_3x3x3_OES: + return COMPRESSED_RGBA_ASTC_3x3x3_OES_to_default; + case GL_COMPRESSED_RGBA_ASTC_4x3x3_OES: + return COMPRESSED_RGBA_ASTC_4x3x3_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: return COMPRESSED_RGBA_ASTC_4x4_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_4x4x3_OES: + return COMPRESSED_RGBA_ASTC_4x4x3_OES_to_default; + case GL_COMPRESSED_RGBA_ASTC_4x4x4_OES: + return COMPRESSED_RGBA_ASTC_4x4x4_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: return COMPRESSED_RGBA_ASTC_5x4_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_5x4x4_OES: + return COMPRESSED_RGBA_ASTC_5x4x4_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: return COMPRESSED_RGBA_ASTC_5x5_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_5x5x4_OES: + return COMPRESSED_RGBA_ASTC_5x5x4_OES_to_default; + case GL_COMPRESSED_RGBA_ASTC_5x5x5_OES: + return COMPRESSED_RGBA_ASTC_5x5x5_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_6x5_KHR: return COMPRESSED_RGBA_ASTC_6x5_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_6x5x5_OES: + return COMPRESSED_RGBA_ASTC_6x5x5_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_6x6_KHR: return COMPRESSED_RGBA_ASTC_6x6_KHR_to_default; + case GL_COMPRESSED_RGBA_ASTC_6x6x5_OES: + return COMPRESSED_RGBA_ASTC_6x6x5_OES_to_default; + case GL_COMPRESSED_RGBA_ASTC_6x6x6_OES: + return COMPRESSED_RGBA_ASTC_6x6x6_OES_to_default; case GL_COMPRESSED_RGBA_ASTC_8x5_KHR: return COMPRESSED_RGBA_ASTC_8x5_KHR_to_default; case GL_COMPRESSED_RGBA_ASTC_8x6_KHR: @@ -2867,16 +3127,36 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat) return COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES_to_default; + case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES: + return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: return COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR_to_default; case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: diff --git a/src/libANGLE/renderer/null/ContextNULL.cpp b/src/libANGLE/renderer/null/ContextNULL.cpp index 4fec18ee9..d4b6775f3 100644 --- a/src/libANGLE/renderer/null/ContextNULL.cpp +++ b/src/libANGLE/renderer/null/ContextNULL.cpp @@ -81,17 +81,18 @@ ContextNULL::ContextNULL(const gl::State &state, mExtensions.debugMarker = true; mExtensions.translatedShaderSource = true; - mExtensions.textureStorage = true; - mExtensions.rgb8rgba8 = true; - mExtensions.textureCompressionDXT1 = true; - mExtensions.textureCompressionDXT3 = true; - mExtensions.textureCompressionDXT5 = true; - mExtensions.textureCompressionS3TCsRGB = true; - mExtensions.textureCompressionASTCHDR = true; - mExtensions.textureCompressionASTCLDR = true; - mExtensions.compressedETC1RGB8Texture = true; - mExtensions.lossyETCDecode = true; - mExtensions.geometryShader = true; + mExtensions.textureStorage = true; + mExtensions.rgb8rgba8 = true; + mExtensions.textureCompressionDXT1 = true; + mExtensions.textureCompressionDXT3 = true; + mExtensions.textureCompressionDXT5 = true; + mExtensions.textureCompressionS3TCsRGB = true; + mExtensions.textureCompressionASTCHDRKHR = true; + mExtensions.textureCompressionASTCLDRKHR = true; + mExtensions.textureCompressionASTCOES = true; + mExtensions.compressedETC1RGB8Texture = true; + mExtensions.lossyETCDecode = true; + mExtensions.geometryShader = true; mExtensions.eglImage = true; mExtensions.eglImageExternal = true; diff --git a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp index 098a1edc0..1c0d0fa77 100644 --- a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp +++ b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp @@ -38,6 +38,10 @@ void RendererVk::ensureCapsInitialized() const mNativeExtensions.setTextureExtensionSupport(mNativeTextureCaps); + // Vulkan technically only supports the LDR profile but driver all appear to support the HDR + // profile as well. http://anglebug.com/1185#c8 + mNativeExtensions.textureCompressionASTCHDRKHR = mNativeExtensions.textureCompressionASTCLDRKHR; + // Enable this for simple buffer readback testing, but some functionality is missing. // TODO(jmadill): Support full mapBufferRange extension. mNativeExtensions.mapBuffer = true; diff --git a/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp b/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp index 5cfa71d55..a0dec9634 100644 --- a/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp +++ b/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp @@ -206,6 +206,22 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_3x3x3_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_3x3x3_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_4x3x3_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_4x3x3_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_4x4_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; imageFormatID = angle::FormatID::ASTC_4x4_SRGB_BLOCK; @@ -230,6 +246,22 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_4x4x3_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_4x4x3_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_4x4x4_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_4x4x4_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_5x4_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR; imageFormatID = angle::FormatID::ASTC_5x4_SRGB_BLOCK; @@ -254,6 +286,14 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_5x4x4_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_5x4x4_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_5x5_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR; imageFormatID = angle::FormatID::ASTC_5x5_SRGB_BLOCK; @@ -278,6 +318,22 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_5x5x4_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_5x5x4_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_5x5x5_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_5x5x5_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_6x5_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR; imageFormatID = angle::FormatID::ASTC_6x5_SRGB_BLOCK; @@ -302,6 +358,14 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_6x5x5_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_6x5x5_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_6x6_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR; imageFormatID = angle::FormatID::ASTC_6x6_SRGB_BLOCK; @@ -326,6 +390,22 @@ void Format::initialize(RendererVk *renderer, const angle::Format &angleFormat) vertexLoadRequiresConversion = false; break; + case angle::FormatID::ASTC_6x6x5_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_6x6x5_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_6x6x6_UNORM_BLOCK: + // This format is not implemented in Vulkan. + break; + + case angle::FormatID::ASTC_6x6x6_UNORM_SRGB_BLOCK: + // This format is not implemented in Vulkan. + break; + case angle::FormatID::ASTC_8x5_SRGB_BLOCK: internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR; imageFormatID = angle::FormatID::ASTC_8x5_SRGB_BLOCK; diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.cpp b/src/libANGLE/renderer/vulkan/vk_helpers.cpp index 1a74afdbb..b7104ca2d 100644 --- a/src/libANGLE/renderer/vulkan/vk_helpers.cpp +++ b/src/libANGLE/renderer/vulkan/vk_helpers.cpp @@ -2085,12 +2085,14 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, size_t stencilAllocationSize = 0; uint32_t bufferRowLength; uint32_t bufferImageHeight; + size_t allocationSize; if (storageFormat.isBlock) { const gl::InternalFormat &storageFormatInfo = vkFormat.getInternalFormatInfo(type); GLuint rowPitch; GLuint depthPitch; + GLuint totalSize; ANGLE_VK_CHECK_MATH(contextVk, storageFormatInfo.computeCompressedImageSize( gl::Extents(extents.width, 1, 1), &rowPitch)); @@ -2098,6 +2100,9 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, storageFormatInfo.computeCompressedImageSize( gl::Extents(extents.width, extents.height, 1), &depthPitch)); + ANGLE_VK_CHECK_MATH(contextVk, + storageFormatInfo.computeCompressedImageSize(extents, &totalSize)); + outputRowPitch = rowPitch; outputDepthPitch = depthPitch; @@ -2111,6 +2116,7 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, bufferRowLength = checkedRowLength.ValueOrDie(); bufferImageHeight = checkedImageHeight.ValueOrDie(); + allocationSize = totalSize; } else { @@ -2122,6 +2128,8 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, bufferRowLength = extents.width; bufferImageHeight = extents.height; + allocationSize = outputDepthPitch * extents.depth; + // Note: because the LoadImageFunctionInfo functions are limited to copying a single // component, we have to special case packed depth/stencil use and send the stencil as a // separate chunk. @@ -2130,6 +2138,7 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, { // Note: Stencil is always one byte stencilAllocationSize = extents.width * extents.height * extents.depth; + allocationSize += stencilAllocationSize; } } @@ -2137,7 +2146,6 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk, uint8_t *stagingPointer = nullptr; VkDeviceSize stagingOffset = 0; - size_t allocationSize = outputDepthPitch * extents.depth + stencilAllocationSize; ANGLE_TRY(mStagingBuffer.allocate(contextVk, allocationSize, &stagingPointer, &bufferHandle, &stagingOffset, nullptr)); diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp index 9761afd61..c91d004b6 100644 --- a/src/libANGLE/validationES.cpp +++ b/src/libANGLE/validationES.cpp @@ -836,7 +836,8 @@ bool ValidCompressedImageSize(const Context *context, GLenum internalFormat, GLint level, GLsizei width, - GLsizei height) + GLsizei height, + GLsizei depth) { const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalFormat); if (!formatInfo.compressed) @@ -859,6 +860,8 @@ bool ValidCompressedImageSize(const Context *context, if (!ValidCompressedDimension(width, formatInfo.compressedBlockWidth, smallerThanBlockSizeAllowed) || !ValidCompressedDimension(height, formatInfo.compressedBlockHeight, + smallerThanBlockSizeAllowed) || + !ValidCompressedDimension(depth, formatInfo.compressedBlockDepth, smallerThanBlockSizeAllowed)) { return false; @@ -872,10 +875,13 @@ bool ValidCompressedSubImageSize(const Context *context, GLenum internalFormat, GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, GLsizei height, + GLsizei depth, size_t textureWidth, - size_t textureHeight) + size_t textureHeight, + size_t textureDepth) { const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalFormat); if (!formatInfo.compressed) @@ -883,7 +889,7 @@ bool ValidCompressedSubImageSize(const Context *context, return false; } - if (xoffset < 0 || yoffset < 0 || width < 0 || height < 0) + if (xoffset < 0 || yoffset < 0 || zoffset < 0 || width < 0 || height < 0 || depth < 0) { return false; } @@ -891,7 +897,8 @@ bool ValidCompressedSubImageSize(const Context *context, if (CompressedSubTextureFormatRequiresExactSize(internalFormat)) { if (xoffset % formatInfo.compressedBlockWidth != 0 || - yoffset % formatInfo.compressedBlockHeight != 0) + yoffset % formatInfo.compressedBlockHeight != 0 || + zoffset % formatInfo.compressedBlockDepth != 0) { return false; } @@ -900,9 +907,11 @@ bool ValidCompressedSubImageSize(const Context *context, // size but fills the entire mip bool fillsEntireMip = xoffset == 0 && yoffset == 0 && static_cast(width) == textureWidth && - static_cast(height) == textureHeight; + static_cast(height) == textureHeight && + static_cast(depth) == textureDepth; bool sizeMultipleOfBlockSize = (width % formatInfo.compressedBlockWidth) == 0 && - (height % formatInfo.compressedBlockHeight) == 0; + (height % formatInfo.compressedBlockHeight) == 0 && + (depth % formatInfo.compressedBlockDepth) == 0; if (!sizeMultipleOfBlockSize && !fillsEntireMip) { return false; diff --git a/src/libANGLE/validationES.h b/src/libANGLE/validationES.h index 4b06d2890..b6aeb2683 100644 --- a/src/libANGLE/validationES.h +++ b/src/libANGLE/validationES.h @@ -59,15 +59,19 @@ bool ValidCompressedImageSize(const Context *context, GLenum internalFormat, GLint level, GLsizei width, - GLsizei height); + GLsizei height, + GLsizei depth); bool ValidCompressedSubImageSize(const Context *context, GLenum internalFormat, GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, GLsizei height, + GLsizei depth, size_t textureWidth, - size_t textureHeight); + size_t textureHeight, + size_t textureDepth); bool ValidImageDataSize(Context *context, TextureType texType, GLsizei width, diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp index 49ee47da0..3bc09702c 100644 --- a/src/libANGLE/validationES2.cpp +++ b/src/libANGLE/validationES2.cpp @@ -1310,9 +1310,10 @@ bool ValidateES2TexImageParametersBase(Context *context, return false; } - if (!ValidCompressedSubImageSize(context, actualInternalFormat, xoffset, yoffset, width, - height, texture->getWidth(target, level), - texture->getHeight(target, level))) + if (!ValidCompressedSubImageSize(context, actualInternalFormat, xoffset, yoffset, 0, + width, height, 1, texture->getWidth(target, level), + texture->getHeight(target, level), + texture->getDepth(target, level))) { context->validationError(GL_INVALID_OPERATION, kInvalidCompressedImageSize); return false; @@ -1326,7 +1327,7 @@ bool ValidateES2TexImageParametersBase(Context *context, } else { - if (!ValidCompressedImageSize(context, actualInternalFormat, level, width, height)) + if (!ValidCompressedImageSize(context, actualInternalFormat, level, width, height, 1)) { context->validationError(GL_INVALID_OPERATION, kInvalidCompressedImageSize); return false; diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp index ef611d8ca..f9d79226d 100644 --- a/src/libANGLE/validationES3.cpp +++ b/src/libANGLE/validationES3.cpp @@ -468,8 +468,9 @@ bool ValidateES3TexImageParametersBase(Context *context, if (isSubImage) { if (!ValidCompressedSubImageSize( - context, actualFormatInfo.internalFormat, xoffset, yoffset, width, height, - texture->getWidth(target, level), texture->getHeight(target, level))) + context, actualFormatInfo.internalFormat, xoffset, yoffset, zoffset, width, + height, depth, texture->getWidth(target, level), + texture->getHeight(target, level), texture->getDepth(target, level))) { context->validationError(GL_INVALID_OPERATION, kInvalidCompressedImageSize); return false; @@ -489,7 +490,8 @@ bool ValidateES3TexImageParametersBase(Context *context, } else { - if (!ValidCompressedImageSize(context, actualInternalFormat, level, width, height)) + if (!ValidCompressedImageSize(context, actualInternalFormat, level, width, height, + depth)) { context->validationError(GL_INVALID_OPERATION, kInvalidCompressedImageSize); return false; @@ -507,6 +509,13 @@ bool ValidateES3TexImageParametersBase(Context *context, context->validationError(GL_INVALID_OPERATION, kInvalidTextureTarget); return false; } + + // Disallow 3D-only compressed formats from being set on 2D textures + if (actualFormatInfo.compressedBlockDepth > 1 && texType != TextureType::_2DArray) + { + context->validationError(GL_INVALID_OPERATION, kInvalidTextureTarget); + return false; + } } else {