src/image_util/imageformats.cpp


Log

Author Commit Date CI Message
Amirali Abdolrashidi e04b7198 2025-08-28T14:58:08 Fix BGR565 pixel functions It seems that the B5G6R5 read/write pixels switch the red and blue components due to them being based on D3D11, which does not seem to have native support for R5G6B5, instead using B5G6R5 and using the related loading functions to switch the two components. However, Vulkan supports both native R5G6B5 and B5G6R5, and using the latter format (e.g., using BGR565 in the backend instead of RGB565) causes errors in the tests. * e.g., the test BlendPackedTest.RGB565/ES2_D3D11 would fail if the readColor() for B5G6R5 is changed to switch red and blue, although the test is regarding RGB565. This does not affect Vulkan, but if BGR565 is used in Vulkan, the test would fail without this switch. * Fixed the order of the component values in B5G6R5 read/write functions. * Updated packPixels() in D3D11 renderer to use R5G6B5's functions when the internal format is GL_RGB565 and the texture's format is BGR565. Bug: b/441803462 Bug: b/409867243 Change-Id: Ia4883f6dfb5d96e77bbdc087f48e7ffca42a5657 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6847283 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Xin Yuan cdcf6a63 2025-04-22T10:19:33 Add R10X6G10X6B10X6A10X6 support on angle Bug: angleproject:409355677 Change-Id: I8115ca73a038360f673552532e9d9b87ff846867 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6438114 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev f5196a27 2024-11-29T00:00:00 Fix normalizedToFloat for signed types * Ensured that INT_MIN is converted to -1. * Fixed max value computation when the input bit width is not type-aligned. * Cleaned up D24X8::ReadDepthStencil to match the updated semantics. * Added tests for all variants. Fixed: angleproject:352963106 Change-Id: I8b9f60d3364331567ad3b55276666bb416c3c6ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6072233 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Panfeng Hou a504b6a2 2024-11-25T15:59:05 Support GL_OES_required_internalformat Enable GL_OES_required_internalformat GLES extension. Bug: angleproject:364069034 Change-Id: Ia57548469abff189472aa20b13ca99179c45f2c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038448 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Panfeng Hou <panfeng.hou@arm.com>
Alexey Knyazev b42c2332 2023-02-20T00:00:00 Refine sRGB mipmap generation Compute average of the decoded floating-point values instead of the truncated 8-bit values. Fixed: angleproject:8034 Change-Id: I1ad9c98ff6bbebe63912fb3339faa471c30f43be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4279710 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexis Hetu c0aa6108 2021-09-17T16:22:55 Add new GL_RGBX8_ANGLEX format Currently, IOSurface objects using {GL_RGB, GL_UNSIGNED_BYTE} are natively represented with GL_BGRX8_ANGLEX, which we use instead of other RGBA formats in order to avoid issues when a canvas uses 'no alpha': https://source.chromium.org/chromium/chromium/src/+/main:third_party/swiftshader/third_party/angle/angle/src/libANGLE/renderer/vulkan/mac/IOSurfaceSurfaceVkMac.mm;l=44 This unfortunately causes some other issues because of the implicit RGB <-> BGR conversion like type mismatches in subresource updates. This CL adds a new type, RGBX8, which will be usable by IOSurface objects and which behaves exactly like the BGRX8 format with the B and R channels flipped. Bug: chromium:1209250 Change-Id: I345eadc8addd05a0964cae30d89c20005479e37b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3188910 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 49108a12 2020-06-30T11:53:23 Support BGRA_1010102 IOSurfaces in CGL and Vulkan. Bug: chromium:1100599 Change-Id: I7bc2c2e35490e28e9f6fe8f2e0c26cdea50650b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2275731 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Anders Leino 6820f77a 2020-05-22T17:50:03 Fix issue where last 8 bits of D24X8 influence depth calculation. Bug: angleproject:4573 Change-Id: If33737cf6ae660b8df58c06a08df32dade472540 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211768 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Le Hoang Quyen d1860ea1 2019-11-19T23:04:00 Metal: support OES_depth_texture Also added Depth32 & Depth16 texture data upload tests. Bug: angleproject:2634 Change-Id: I103f1cda1dc915f0dc8b04f7aaa2d8c0f9220cda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919281 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jaedon Lee 3b46885e 2019-07-30T16:50:36 Vulkan: Implement EXT_texture_type_2_10_10_10_REV - Expose GLES 3.0 feature of 2_10_10_10_REV texture type on GLES 2.0 as EXT. - Handle alpha channel value as 1.0 when used with RGB format. - Add test for "RGB+UNSIGNED_INT_2_10_10_10_REV" case into TextureUploadFormatTest. BUG=angleproject:3232. Test: dEQP-GLES2.capability.extensions.uncompressed_texture_formats.GL_EXT_texture_type_2_10_10_10_REV dEQP-GLES2.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev dEQP-GLES3.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev KHR-GLES2.core.internalformat.*2_10_10_10_rev* KHR-GLES3.core.internalformat.*2_10_10_10_rev* Change-Id: Iac00517971f9242161115c7256117a69093fb5df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1732618 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b436aac3 2018-07-18T17:23:48 Vulkan: Support inverted blit for depth/stencil. Depth/stencil formats are packed tightly when reading back Images with vkCmdCopyImageToBuffer. Same for the reverse. Thus we need to take this into account when doing our blitWithReadback implementation. This splits the depth/stencil blit into two separate steps. Fixes all the remaining blit failures in BlitFramebufferANGLETest. Bug: angleproject:2673 Change-Id: Ie9f43f782a82b5a0746d00122b24f81088d57c4c Reviewed-on: https://chromium-review.googlesource.com/1140740 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 95fb2a17 2018-05-27T20:17:05 Add vertex formats and lookup function. Add an angle::Format for each ES2 vertex data format. Add function GetVertexFormatID() to get the angle::Format for a vertex attribute. These will be used later to support vertex formats in Vulkan (by mapping angle::Format to Vulkan format) and to eliminate the redundant enum gl::VertexFormatType. No functional change. BUG=angleproject:2405 BUG=angleproject:2531 Change-Id: I871ae23ce9fba57d90c554376e84b03f8514f7fc Reviewed-on: https://chromium-review.googlesource.com/1044874 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 80616218 2017-05-17T15:40:03 Support CHROMIUM_copy_texture for all formats on D3D11. Adds a CPU readback and conversion path when the destination texture is not renderable. BUG=angleproject:1932 Change-Id: I71461ca991dc10dd636ff38e1ae20db2be0f8d63 Reviewed-on: https://chromium-review.googlesource.com/508308 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 451b2b7f 2017-05-15T15:32:02 Correctly generate mipmaps for sRGB textures. sRGB textures need to linearize their data before averaging, this worked correctly on the GPU mipmap generation functions but not the CPU ones. BUG=angleproject:2019 TEST=conformance/extensions/ext-sRGB Change-Id: I554dac89b12acf5ebf5b7cab6f6faf0bce5168a6 Reviewed-on: https://chromium-review.googlesource.com/506241 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 6e4cfceb 2016-06-13T15:06:31 Refactor ANGLE's image manipulation code into a static library. Allows for chromium to make use of some of the functionality. BUG=612205 Change-Id: Ib4435ca44775a3a554b0fb3bd384bd4d31d7952d Reviewed-on: https://chromium-review.googlesource.com/351753 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>