From 9819e9ed7b1069dbfd63d23a052d4b72b26416dd Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Wed, 15 Jan 2020 17:13:32 -0500 Subject: [PATCH] GL_EXT_read_format_bgra support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented DetermineBGRAReadFormatSupport in order to allow enabling readFormat when possible with the Vulkan backend. While reading the spec, I realized that ANGLE only seems to care about BGRA8888 and not the new types mentioned in the extension. Logged a new issue (http://anglebug.com/4302) to track this. Bug: angleproject:4294 Change-Id: I071ed89574de9b4088df2301c317d3769cb31ce6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003237 Commit-Queue: Alexis Hétu Reviewed-by: Jamie Madill --- src/libANGLE/Caps.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libANGLE/Caps.cpp b/src/libANGLE/Caps.cpp index 8c1b4fd66..843a82241 100644 --- a/src/libANGLE/Caps.cpp +++ b/src/libANGLE/Caps.cpp @@ -262,7 +262,13 @@ static bool DetermineBGRA8TextureSupport(const TextureCapsMap &textureCaps) // Checks for GL_EXT_read_format_bgra support static bool DetermineBGRAReadFormatSupport(const TextureCapsMap &textureCaps) { - return false; + constexpr GLenum requiredFormats[] = { + GL_BGRA8_EXT, + // TODO(http://anglebug.com/4302): GL_EXT_read_format_bgra specifies 2 more types, which are + // currently ignored. The equivalent formats would be: GL_BGRA4_ANGLEX, GL_BGR5_A1_ANGLEX + }; + + return GetFormatSupport(textureCaps, requiredFormats, true, false, true, true, false); } // Checks for GL_OES_color_buffer_half_float support