src/image_util


Log

Author Commit Date CI Message
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>
Takuto Ikuta e0fafcdf 2024-12-10T17:46:44 add missing includes for the build with use_libcxx_modules This is to fix build error when we set use_libcxx_modules=true in chromium build. Bug: chromium:40440396 Change-Id: Ic1f2655b91eaf949150d61a9a42c0ee0221afac9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6084012 Auto-Submit: Takuto Ikuta <tikuta@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
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>
Liza Burakova 4f498eaa 2024-07-24T14:31:23 WebGPU: Add more format support This CL adds a new FormatTable class that initializes webgpu texture and vertex formats. It also adds this class to the display so it can be used in the ImageHelper. This CL changes the previously hardcoded RGBA8 texture format that was initially used when creating textures to use the format passed into the methods. Bug: angleproject:344814096 Change-Id: I768b85335329116496dbf721aac54d1137aaae9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5660397 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Roman Lavrov 21fc5e87 2024-07-09T09:30:23 Move loadimage SSE includes/defines out of common headers Including x86intrin.h from common headers appears to be making the "include analysis" tool unhappy. Doesn't look like we actually need it, the only possibly relevant place I could find is the loadimage SSE implementation - but even that wasn't enabled outside of Windows anyways. It is not clear there is a need for the ANGLE_USE_SSE define in other places, at least not at this point. The current implementation also appears to be only for Windows. Move all related code to where it is used - loadimage implementation. Bug: angleproject:42266508 Change-Id: I1eac1510e7515cb6cc85c0332f5de91e0494d3da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5688790 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 0ac0603e 2024-05-14T00:00:00 Fold nested std::max calls When a maximum of three values is needed, an initializer list with all three values is more readable than two std::max calls. Fixed: angleproject:8695 Change-Id: I073ea1af07b215610c85981eea03f6e73107bce6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5541974 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi c3a1cae4 2024-04-15T14:58:55 Use angle::SimpleMutex everywhere in libGLESv2 Only cases left that use std::mutex are: - Share group and the context ErrorSet mutexes as they need try_lock() - Anywhere mutexes are used in conjunction with std::condition_variables (as they explicitly require std::mutex) Bug: angleproject:8667 Change-Id: Ib6d68938b0886f9e7c43e023162557990ecfb300 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5453294 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi ed97adba 2024-01-05T17:00:03 Add more RGB-to-RGBA byte loading functions Following the optimization of RGB8-to-RGBA8 for ubytes with 0xFF as the fourth component, the other byte functions can be optimized in a similar fashion. * Added the following specialized template functions for byte loads: (based on 3To4 byte loading functions in load_functions_table*.cpp) * GLubyte, 0x01 * GLbyte, 0x7F * GLbyte, 0x01 * Renamed LoadToNativeUbyte3To4Impl() to *Byte*. * For the unit tests, refactored some of the repeated test code into functions. Bug: b/313526661 Change-Id: I017829bf765f0b417448bd5dca59be26c1665379 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372971 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 151c1571 2024-01-12T16:40:38 Vulkan: Clean up RGB8-to-RGBA8 ubyte function Some platforms encounter issues in this function, possibly when the dest pointer is accessed directly when it is cast to uint32_t. * Coalesced the 32-bit accesses into memcpy(). * Simplified the implementation to contain less variables and indices. * The function updates the source and dest pointers directly instead of using separate indices. After this, the next pixel components would be accessible using constant offsets (0-3). * It does not seem to have an impact performance-wise. * Tested on Windows, which showed the most improvement in the first CL. Bug: b/308177124 Bug: b/319128304 Change-Id: I9807fd5331db487f9f0a03faa457ee0a8343d59c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5195125 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Hailin Zhang 536042b6 2023-12-20T12:26:00 vulkan: fix etc2 srgb8_alpha8 alpha decode issue. for etc2_srgb8_alpha8 format, we should not use signed alpha decoder. Bug: b/314875175 Change-Id: I89f7eaf71e31f279da08c83989f8d692a8ba2c81 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5142566 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Amirali Abdolrashidi 716c5d00 2023-11-13T10:23:10 Vulkan: Add RGB8-to-RGBA8 ubyte loading function Currently, to update RGB8 on desktop, ANGLE uses memcpy for each pixel, which is suboptimal. This CL adds a loading function to improve the copy time for RGB textures where RGBA is needed on the hardware. * Added a specialization to LoadToNative3To4() for unsigned bytes using 0xFF as the fourth component. * It is optimized for unsigned bytes when converting an RGB format to its corresponding RGBA format, e.g., RGB8 to RGBA8. * It uses uint32_t operations to speed up the process. * Added unit tests for the specialized LoadToNative3To4. * LoadToNative_unittest.cpp * Added perf test for RGB8 image allocation and loading. * RGBImageAllocationBenchmark in RGBImageAllocation.cpp. * RGBImageAllocationBenchmark shows some improvement in cpu_time and wall_time on a Linux and a Windows device. (Results below using aligned source pointer and texture size of 2048): * On Windows: +~85% cpu_time, +~71% wall_time * On Linux: +~26% cpu_time, +~27% wall_time Bug: b/308177124 Change-Id: I421d83f75fdc513b0111dffb0a5d5e74682dd6fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4995489 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Hailin Zhang 76608554 2023-10-02T15:07:45 Vulkan: use cpu transcoding for small texture size. Bug: b/250042517 Change-Id: I9a70fb7d4823d10b09f498bfc01b5384951e2ce4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4908660 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Shahbaz Youssefi d4e1493c 2023-09-11T22:38:32 Optimize compressed texture loads Similar to LoadToNative, which has a fast-path for when the pitches align (and a single memcpy is used), LoadCompressedToNative is made to use a single memcpy when the pitches align. Bug: angleproject:8341 Change-Id: I4893f9ec26bb80d83593fc102990bd84c38bd12b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4856674 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Constantine Shablya e975f9dc 2022-11-09T06:44:06 Capture/Replay: handle paletted textures Add a method for recompressing paletted textures on capture. Bug: angleproject:7710 Change-Id: I11af0c1cd7c3b63850c5daf96eafcd3efce65f16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178311 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Saifuddin Hitawala 877cd04c 2023-03-02T10:24:14 Reland "Add vulkan format image fallback for R16G16B16" Suppressed misbehaving trace test in https://crrev.com/c/4317088 This is a reland of commit 71f6d54c8d3662693283281651e57c994a10cf08 Original change's description: > Add vulkan format image fallback for R16G16B16 > > This change adds a vulkan format image mapping fallback from R16G16B16 > to R16G16B16A16, R32G32B32_FLOAT and R32G32B32A32_FLOAT for both > UNORM and SNORM variants. > > This is done because in Chrome we want to use R16/RG16 formats which > are exposed to Skia over the EXT_texture_norm16. Currently, > EXT_texture_norm16 requires RGB16_EXT which if not present is not > supported even if R16_EXT and RG16_EXT are supported. This fallback > helps us support R16/RG16 as well over RGBA16. > > It also updates validationES checks for GL_RGBA signed and unsigned > normalized checking if type is GL_SHORT or GL_UNSIGNED_SHORT. > > It adds a method LoadToFloat that allows a type (GLushort or GLshort) > to be loaded into float format types. This is then used as part of > fallbacks for load_functions_data.json. > > Bug: None > Change-Id: I5c6879cd2ed5dd6e3440877f4891f269d96d88a1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4294694 > Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: None Change-Id: I101dd9e8c62e6794692c9f89c4944297e195f710 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4317089 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Roman Lavrov b3178411 2023-03-07T15:08:46 Revert "Add vulkan format image fallback for R16G16B16" This reverts commit 71f6d54c8d3662693283281651e57c994a10cf08. Reason for revert: crashing win-trace https://ci.chromium.org/ui/p/angle/builders/ci/win-trace/3527/overview Also reproducible on Linux: % src/tests/capture_replay_tests.py --gtest_filter="Texture2DNorm16TestES3.TextureNorm16R16 Original change's description: > Add vulkan format image fallback for R16G16B16 > > This change adds a vulkan format image mapping fallback from R16G16B16 > to R16G16B16A16, R32G32B32_FLOAT and R32G32B32A32_FLOAT for both > UNORM and SNORM variants. > > This is done because in Chrome we want to use R16/RG16 formats which > are exposed to Skia over the EXT_texture_norm16. Currently, > EXT_texture_norm16 requires RGB16_EXT which if not present is not > supported even if R16_EXT and RG16_EXT are supported. This fallback > helps us support R16/RG16 as well over RGBA16. > > It also updates validationES checks for GL_RGBA signed and unsigned > normalized checking if type is GL_SHORT or GL_UNSIGNED_SHORT. > > It adds a method LoadToFloat that allows a type (GLushort or GLshort) > to be loaded into float format types. This is then used as part of > fallbacks for load_functions_data.json. > > Bug: None > Change-Id: I5c6879cd2ed5dd6e3440877f4891f269d96d88a1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4294694 > Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: None Change-Id: I8373aee3a1d2c2279a3882ff7203d88483e29f4e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4316422 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Saifuddin Hitawala 71f6d54c 2023-03-02T10:24:14 Add vulkan format image fallback for R16G16B16 This change adds a vulkan format image mapping fallback from R16G16B16 to R16G16B16A16, R32G32B32_FLOAT and R32G32B32A32_FLOAT for both UNORM and SNORM variants. This is done because in Chrome we want to use R16/RG16 formats which are exposed to Skia over the EXT_texture_norm16. Currently, EXT_texture_norm16 requires RGB16_EXT which if not present is not supported even if R16_EXT and RG16_EXT are supported. This fallback helps us support R16/RG16 as well over RGBA16. It also updates validationES checks for GL_RGBA signed and unsigned normalized checking if type is GL_SHORT or GL_UNSIGNED_SHORT. It adds a method LoadToFloat that allows a type (GLushort or GLshort) to be loaded into float format types. This is then used as part of fallbacks for load_functions_data.json. Bug: None Change-Id: I5c6879cd2ed5dd6e3440877f4891f269d96d88a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4294694 Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
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>
Alexey Knyazev 17931e23 2023-01-27T00:00:00 Fix stencil and depth/stencil data uploads Multiple changes were made to depth and stencil load functions, removing redundant code and fixing issues. Failures were caused by incorrect assumptions about component locations in combined formats. * D32_FLOAT_S8X24_UINT has the same layout as GL_FLOAT_32_UNSIGNED_INT_24_8_REV * D24_UNORM_S8_UINT has stencil data in its MSBs, while GL_UNSIGNED_INT_24_8 puts it in LSBs. Bugfixes * Added LoadD24S8ToS8D24 that swaps D24 and S8 components * Added LoadS8ToS8X24 for stencil-only uploads on D3D * Replaced LoadD24S8ToD32F with LoadD32ToD32F * Fixed D and S extraction in LoadD24S8ToD32FS8X24 * Fixed stencil load and store in LoadD32FS8X24ToS8D24 and LoadD32FS8X24ToD32FS8X24 * Fixed S8_UINT subresource updates in Vulkan * Fixed D24_UNORM_S8_UINT subresource updates from GL_FLOAT_32_UNSIGNED_INT_24_8_REV data in Vulkan Cleanup * Renamed LoadUNorm16To32F to LoadD16ToD32F * Removed LoadUNorm32To32F, replaced it with LoadD32ToD32F * Renamed LoadR32ToR24G8 to LoadD32ToX8D24 * Renamed LoadD32FS8X24ToD24S8 to LoadD32FS8X24ToS8D24 * Removed unused LoadG8R24ToR24G8 * Removed Metal-specific LoadS8D24S8ToD32FX24S8, made use of the fixed LoadD24S8ToD32FS8X24 instead * Simplifed LoadD24S8ToD32F Added Texture2DTestES3.TexImageWithStencilData. Fixed: chromium:1408004 Fixed: angleproject:5317 Change-Id: I231345353aa4a7cebe46ded8458ac80de2c59e01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4203427 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Greg Schlomoff 81a244de 2022-10-10T15:32:25 Adding a class to perform ASTC texture decompression on the CPU This significantly improves performance by caching and re-using the ASTC decoder context, and using multi-threaded decompression. This code was originally written for gfxstream. Bug: b/250688943 Change-Id: I1727447907f2e25cf9b854ffcc9ccfc04db2fb91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3929008 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 025504b9 2022-10-17T17:03:03 Pass worker pools to image load functions In preparation for the ASTC decoder using threaded decoding. Bug: b/250688943 Change-Id: I70d669bcb57b900dbb633304182e174aec362203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961339 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Greg Schlomoff <gregschlom@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Constantine Shablya ff7aa214 2022-09-29T19:56:28 GL_PALETTE* sampling Implement GL_PALETTE* formats by decoding them into a R8G8B8A8_UNORM image at load time. Test: angle_end2end_tests --gtest_filter="PalettedTextureTest.*" Bug: angleproject:7599 Bug: angleproject:7688 Bug: angleproject:7710 Change-Id: I94d51e2c480fcdd39f1a0ad241b311d3b4de1579 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863251 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Constantine Shablya <constantine.shablya@collabora.com>
Constantine Shablya e82eaff9 2022-09-22T16:01:06 Stubs for paletted images Bug: angleproject:7599 Change-Id: Idb49f8ba07ebd3b6cad461fa9e90b856af666183 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3909396 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Constantine Shablya <constantine.shablya@collabora.com>
Lubosz Sarnecki 45e5cf01 2022-06-03T14:29:23 Vulkan: Implement ASTC emulation. Implement ASTC emulation using the astc-encoder library. Add copy_image tests to deqp_gles31_test_expectations for desktop cards. Add emulatedAstc limitation. Don't expose emulated ASTC from WebGL contexts. Introduce ANGLE_HAS_ASTCENC define to check for build availability. Only build on angle_standalone configurations. DEPS: Add astc-encoder. image_util: Decode ASTC to RGBA. TracePerfTest: Skip car_chase and genshin_impact on NVIDIA. Bug: angleproject:7415 Change-Id: Ib2f3fd3f710164a2ecd5d5edf780227031bbfb84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697999 Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gregg Tavares 985d4293 2022-04-08T11:47:34 Metal:Speed up BGRA8 to RGBA8 copy for readPixels On a 2048x2048 texture on Intel this goes from 26-27ms to 17-18ms Bug: angleproject:7117 Change-Id: I4f48521b64e54669d180f0d2d8fdda78f83f89b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579510 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Mohan Maiya 3bdbfbf8 2022-03-25T16:34:51 Vulkan: Adjust border color Some border color tests used to fail due to either unclamped color values or not accounting for depth, stencil or luma formats. We now adjust the border color value according to the sampler's format. Test: dEQP-GLES31.functional.texture.border_clamp.* Bug: angleproject:3577 Bug: angleproject:6213 Change-Id: Ib38ce2374622bfafde69fe3fa2d7227d60043954 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3551895 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares 604610b4 2021-11-01T12:03:31 Metal: Use Depth32F for DEPTH_COMPONENT16 depth16unorm is broken on Metal. This is a workaround. Bug: angleproject:6597 Change-Id: I1748f9fab587b22980d13e8a141fa880eb6f9db0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3255666 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
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>
Mohan Maiya 5c8bf081 2021-06-08T13:12:24 Vulkan: Add support for YUV internal format extension 1. Add a function to upload YUV image data to textures 2. Modify stageSubresourceUpdate method to account for YUV images 3. Create VkSamplerYcbcrConversion when initializing ImageHelper 4. Update hasImmutableSampler to account for native YUV format support 5. Skip initializeNonZeroMemory for YUV formats Bug: angleproject:5773 Test: Texture2DTestES3.TexStorage2D*Yuv*Vulkan* Change-Id: I270f04bbf903cf2bf19f100eb95f32953d491c39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2947767 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Cheryl Wei 45965e72 2021-06-17T10:21:26 Vulkan: Translate border color's channel by image view format ANGLE implementes some formats as other formats,such as ALPHA8 to R8, this caused some tests failed due to missing border color's channel translation,this change add a new textureBorderLoadFunction to translate channels of border color by image view format. Bug: angleproject:6046 Change-Id: I94ce719b4db3724ffd3dc862b51a412b5d9f3cce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2972328 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Pujun Lun ca5dbef0 2021-03-11T00:40:39 Micro-optimization for loading 3-channel images. This reduced the total time spent in LoadToNative3To4 by 10% in our micro-benchmark. Test: passed the CQ dry run. Bug: b/182513949 Change-Id: I5d1b1975f64e5b08bd0e65abc8f94fe62ef54321 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2752347 Commit-Queue: Pujun Lun <lunpujun@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Trevor David Black e815afbf 2020-09-07T22:09:22 First pass at increasing inclusivity Link to the inclusivity rules https://source.android.com/setup/contribute/respectful-code Bug: b/162834212 Bug: chromium:1097198 Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Trevor Black <vantablack@google.com>
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>
Courtney Goeltzenleuchter cb2b5136 2020-01-10T11:04:38 Vulkan: Simplify format table generation Remove the "override" table. That gets in the way of some solutions. If a format cannot be supported by a native Vulkan format as indicated in the "map" table, then check fallbacks. Also add support for native RGBA4 and R5G5B5A1 support. Previously those formats would be emulated with RGBA8 due to the override, but now code will check if the native format is available and use it. Bug: angleproject:4282 Change-Id: Ib33ea40543d91a2c2a95075b277f825a8822037c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1994538 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
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>
Jamie Madill 155947fc 2019-10-24T12:55:11 Enable "-Wconditional-uninitialized". This is a final warning used by Skia. Bug: angleproject:4046 Change-Id: I3970e30e4bd2aef07cddadd7322ef120ac857493 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877481 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 2fa9d734 2019-10-07T16:35:38 Partially Revert "Convert DXT1 RGB data to DXT3 RGBA when uploading to the GPU." This reverts commit e6582161b04beaa368f3081897912ede89d7800d. Remove the DXT1->DXT3 transcoding but leave in the MacOS workarounds for fixing the alpha channel of DXT1 textures. BUG=angleproject:3729 Change-Id: Ib276c1e4a58155866da8c661cba2063a4e4304fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1846015 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Courtney Goeltzenleuchter a333b87c 2019-09-27T14:00:14 Vulkan: Handle D24 -> D32FS8X24 depth fallback Swiftshader's depth support requires that ANGLE fall back to using the D32FS8X24 depth format. Some conversion routines needed to be added to support that use. Test: dEQP.GLES3/functional_texture_format_sized_* Bug: angleproject/3937 Change-Id: I979dc5e9b01dac40f564daad4f4817b61bd056ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829170 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e6582161 2019-09-16T12:39:18 Convert DXT1 RGB data to DXT3 RGBA when uploading to the GPU. DXT1 has a specific 'BLACK' code that results in transparent black pixels when sampled. D3D does not have specific RGB-only DXT1 formats like OpenGL does so when this code is encountered, we sample 0 alpha for these pixels when GL would expect 1 because the alpha channel should not exist. Work around this by converting to DXT3 RGBA, adding an extra block of 1.0 alpha pixels for each color block. Mac Intel OpenGL requires additional workarounds to always sample 1.0 alpha. Set the texture swizzle parameters to force it. BUG=angleproject:3729 Change-Id: Ia3647085acd97bb01af4e95ef3f6f21dcfb6a554 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1804880 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
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>
Courtney Goeltzenleuchter 01867144 2019-07-19T14:51:29 Vulkan: Add support for D32F_S8 depth_texture Test: angle_deqp_khr_gles3_tests --deqp-egl-display-type=angle-vulkan --gtest_filter=dEQP.KHR_GLES3/packed_depth_stencil_verify_read_pixels_depth24_stencil8 angle_deqp_khr_gles3_tests --deqp-egl-display-type=angle-vulkan --gtest_filter=dEQP.KHR_GLES3/packed_depth_stencil_clear_buffer_depth32f_stencil8 Full passing results are blocked by suspected driver issues: Bug: angleproject:3683 Bug: angleproject:3689 Bug: angleproject:3457 Change-Id: I7ce1a7824802ebca2c0479a3467fac26013829eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1704791 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten cbabea73 2019-07-11T17:24:17 Vulkan: Desktop ETC/EAC formats support Initial attempt to give desktop ETC/EAC formats support. Bug: angleproject:3676 Change-Id: Id147b0c1808e30df77097d0c7ff6a06534554b93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699307 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang d9c17107 2019-07-10T14:56:26 Add support for GL_OES_texture_compression_astc This extension adds 3D compressed texture formats, something ANGLE has not seen before. This requires tracking a compressed block depth for validation and image size computations. Update the ldr and hdr extension checks to be in line with the spec. HDR requires LDR and is not detectable by texture formats alone. Expose all of the ASTC extensions on the GL backend. BUG=angleproject:3675 Change-Id: Id04c7c8ef8541e9556579536cdba899b64303caf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1695923 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Courtney Goeltzenleuchter 943fe34e 2019-06-24T16:51:57 Vulkan: Upload packed depth-stencil Bug: angleproject:3437 Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.VerifyStencilData/* Change-Id: Iffab48eaea6aa35888560859e9f502a4f814b833 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1674663 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Tom Anderson 08146a27 2019-05-17T10:40:44 Remove non-source sources from binary targets No behavior changes. BUG=chromium:964411 Change-Id: I843757e65f110882c01514fe6bf4aed28e07dd21 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1617011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 507e8d30 2019-03-15T16:49:48 Add missing entries in texture load functions map GetLoadFunctionsMap() is expected to cover all possible combinations of texture internalformat and upload data format. Several of these combinations were missing, especially w.r.t to compressed types. This change adds the missing combinations that are hit on any of the configurations being tested. An assert is added to catch missing conversion functions in the future. Bug: angleproject:2670 Change-Id: I793ac2c57f65eeb1cc8da8f1b223f6a9a44c7708 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524462 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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 44dcb911 2018-02-02T12:51:41 Decode R11 and RG11 EAC formats into 16-bit textures. 8-bit textures are not precise enough but no tests were failing because dEQP was using 4-bit backbuffers. Preserve the old decode-to-8-bits paths because they are still used by Chrome. BUG=angleproject:2336 Change-Id: Ieb651325e2a05c85bcc97f8e6d868afaf37aff0d Reviewed-on: https://chromium-review.googlesource.com/899701 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He 4f285443 2017-04-21T12:15:49 Refactoring: replace NULL by nullptr for pointers (2nd CL). This CL mainly handles the pointer comparisons (== or !=). BUG=angleproject:2001 Change-Id: I25ac3b61032e7ad91459a1c6541cadc87cf9b160 Reviewed-on: https://chromium-review.googlesource.com/483935 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Minmin Gong 390208b5 2017-02-28T18:03:06 Implements ETC lossy decode for ETC2 formats. This is the 2nd payload of GL_ANGLE_lossy_etc_decode feature. In this change, RGB8, SRGB8, RGB8A1, and SRGB8A1 formats in ETC2 family can be converted to BC1. BUG=angleproject:1285 Change-Id: I96fe2f07c62716a31d37f20a202b6cabbb4ebbd2 Reviewed-on: https://chromium-review.googlesource.com/447846 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Minmin Gong 5eeff0e4 2016-09-27T17:56:42 Fix ETC->DXT small mip transcode crash. BUG=angleproject:1510 Change-Id: I42355607235a05fe276342084acd1eb359c16de4 Reviewed-on: https://chromium-review.googlesource.com/390414 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Minmin Gong 41ee2024 2016-07-18T16:22:03 D3D11: Improvements on ETC1 to BC1 transcode. ETC1 data doesn't need to be fully decoded before encoding to BC1. Saves ~50% computation. BUG=angleproject:1285 Change-Id: I0cb479a08159ccd0472e5fdf40dd84323151883c Reviewed-on: https://chromium-review.googlesource.com/361553 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 4107dda9 2016-07-13T14:19:49 Clamp float32 depth data when uploading. BUG=angleproject:1095 Change-Id: I4c272aef0f94733fc7b5297ddaa1fa2bc765fe62 Reviewed-on: https://chromium-review.googlesource.com/360029 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5695fc99 2016-07-05T14:47:30 Clean up the SSE detection logic. * Include the correct header right in the SSE check in platform.h. * Don't use separate SSE versions of the load functions, have them use SSE automatically. BUG=612205 Change-Id: I70f9a5513e144db4d16c1f3ad922debeb6c50268 Reviewed-on: https://chromium-review.googlesource.com/358108 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@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>