src/common


Log

Author Commit Date CI Message
Dave Tapuska 507f67cc 2023-07-14T15:23:48 Fix cfi issue with Angle invoking worker pool Mark the function as ignoring cfi-icall because of broken upstream builds. https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20CFI/25615/overview Bug: angleproject:8256 Change-Id: I63b5fee27bc0565dc6881bd83fd284abc7a9f1f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685324 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Geoff Lang 972f8107 2023-07-14T12:05:40 Reject program binaries when the renderer string changes If the underlying driver changes, reject program binaries from the old versions. The driver is supposed to do this for us (on OpenGL, at least) but this adds some extra protection. Bug: angleproject:4981 Change-Id: Id9486d8e6f9136970c0d7c37d59dea5d43b0a50e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685317 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Dave Tapuska fe08eee8 2023-07-12T18:03:30 Fix Angle creating its own worker pool. The WorkerPool was created on the first postTask and could create a number of threads. We were seeing this on blink for iOS where we would have expected using the delegate's worker pool. However ANGLE_ENABLED was undefined because it wasn't included. This caused the comparison of ANGLE_DELEGATE_WORKERS to not work. Instead of including the header for ANGLE_ENABLED since that would cause a dependency on libAngle, just use #if X instead, while this also isn't the best because X can be undefined its a solution for now. Bug: angleproject:8256 Change-Id: I5aeb686dcc117feaba884cdea5c89e4b146cb57f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679894 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 94ceedb7 2023-07-10T00:00:00 Add GL_EXT_texture_compression_astc_decode_mode stubs Bug: angleproject:8254 Change-Id: I2a839139b5738710e32842b04db35eab8fb04687 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679683 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev b57d5638 2023-06-29T00:00:00 Reland "Cleanup multiview support" This is a reland of commit 9a7c0b88ba68e328d3f5f7991a6df0ab5de92311 Original change's description: > Cleanup multiview support > > * Removed remaining mentions of ANGLE_multiview > > * Removed AST transformations used only in > the side-by-side multiview implementation > > * Changed the type of the internal ViewID_OVR > variable to use the dedicated qualifier > > * Removed side-by-side multiview support > from the D3D11 renderer > > * Removed an unused helper for side-by-side > multiview support from the OpenGL renderer > > * Removed obsoleted test suppressions Fixed: angleproject:3341 Change-Id: I3ce9304c79c0873462c73e8cf02b85f7a1aaf874 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4669604 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Anne Redulla 66c2e4fc 2023-07-04T17:02:07 [ssci] Added Shipped field to READMEs This CL adds the Shipped field (and may update the License File field) in Chromium READMEs. Changes were automatically created, so if you disagree with any of them (e.g. a package is used only for testing purposes and is not shipped), comment the suggested change and why. See the LSC doc at go/lsc-chrome-metadata. Bug: b/285450740 Change-Id: I770554248e33c1e50938cc32daee36a83b643ec9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4672125 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f0deadab 2023-07-06T15:19:03 Revert "Cleanup multiview support" This reverts commit 9a7c0b88ba68e328d3f5f7991a6df0ab5de92311. Reason for revert: Suspected cause of crash on Canary Original change's description: > Cleanup multiview support > > * Removed remaining mentions of ANGLE_multiview > > * Removed AST transformations used only in > the side-by-side multiview implementation > > * Changed the type of the internal ViewID_OVR > variable to use the dedicated qualifier > > * Removed side-by-side multiview support > from the D3D11 renderer > > * Removed an unused helper for side-by-side > multiview support from the OpenGL renderer > > * Removed obsoleted test suppressions > > Fixed: angleproject:3341 > Change-Id: I5e0706cbf26ea820b51400124ddbf2624b738f17 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4660046 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: chromium:1462504 Bug: chromium:1462505 Bug: chromium:1462506 Bug: chromium:1462478 Bug: chromium:1462531 Change-Id: Ie0e76b1c6823db19f68bb67fdfc8abc00cc62f88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666209 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Alexey Knyazev 9a7c0b88 2023-06-29T00:00:00 Cleanup multiview support * Removed remaining mentions of ANGLE_multiview * Removed AST transformations used only in the side-by-side multiview implementation * Changed the type of the internal ViewID_OVR variable to use the dedicated qualifier * Removed side-by-side multiview support from the D3D11 renderer * Removed an unused helper for side-by-side multiview support from the OpenGL renderer * Removed obsoleted test suppressions Fixed: angleproject:3341 Change-Id: I5e0706cbf26ea820b51400124ddbf2624b738f17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4660046 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
L. E. Segovia ed391dae 2022-03-25T16:36:39 Replace `extern thread_local` to avoid GCC < 9.1 bug GCC generates broken code for mingw-w64 target when accessing `extern thread_local` variables from another compilation unit. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104862 See: https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0017-Replace-extern-thread_local-to-avoid-GCC-mingw-w64-b.patch Co-authored-by: Alvin Wong <alvinhochun@gmail.com> Bug: None Change-Id: Ief0036054e644d40b8b0e86ed990280e566da2a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637587 Auto-Submit: L. E. Segovia <amy@amyspark.me> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 113f847b 2023-06-26T12:07:52 centralize basic OS/platform detection functions We had multiple different places that defined these, and with varying naming schemes. Centralize them to be defined in platform_helpers.h. Also renaming the IsApple(uint32_t) functions to IsAppleGPU(uint32_t) to avoid ambiguous meaning: "IsApple" should mean "is Apple-vended OS" while "IsAppleGPU" should mean "is Apple GPU vendor ID". Bug: angleproject:8229 Change-Id: If4e3fc5ac1b5b8ad416663950a1b2ee912ccad99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647291 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 9faf7059 2023-06-20T19:04:49 Optimize angle::Spinlock performance This optimization is a preparation for future commits. Performance was tested by defining `ContextMutexType = angle::Spinlock` to use `SharedContextMutex<angle::Spinlock>` as `mSharedContextMutex`. Test result is average time for 1000'000 `glGetError()` calls on S906B with locked CPU frequencies: SharedContextMutex<angle::Spinlock> Before the optimization: 14.289 ms After the optimization: 12.941 ms (-9.4%) Performance when not using `angle::Spinlock` (current code): SingleContextMutex: 9.115 ms (-36.2%) SharedContextMutex<std::mutex>: 29.186 ms (+204.3%) Bug: angleproject:8226 Change-Id: I447ff807cd6b72ff3fc115e73736fe63eb642785 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632728 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 7a38d614 2023-06-23T01:56:43 remove ScheduleYield, replace with std::this_thread::yield Instead of hand-rolling this function, just use std::this_thread::yield, which has the advantage of being cross-platform and using an underlying implementation that's actually more correct on Windows[1][2]. [1] https://github.com/microsoft/STL/blob/40640c6df9754ea031f8df7c720b89714d19df97/stl/src/cthread.cpp#L84-L86 [2] https://joeduffyblog.com/2006/08/22/priorityinduced-starvation-why-sleep1-is-better-than-sleep0-and-the-windows-balance-set-manager/ Bug: angleproject:8232 Change-Id: I9053fa362f328dc45b7c13f5f70818adf89a290f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639490 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan f6c7dc89 2023-06-23T02:21:02 Spinlock: implement ANGLE_SMT_PAUSE for ARM/ARM64 This intrinsic is available on GCC, Clang, and MSVC. Bug: angleproject:6067 Change-Id: I010eefa3417df196407fb8182c0de927f4bf0cab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639491 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 764f31be 2023-06-22T23:52:43 Add more BitSetArray tests Bug: angleproject:8224 Change-Id: I8835da245df52e1be2e3e4ea17e32ce8c438e51e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636870 Reviewed-by: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
L. E. Segovia 566f1ee4 2022-03-10T16:25:34 mathutil: Enable usage of builtins for MinGW GCC too See: https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0011-Fix-MinGW-build.patch Co-authored-by: Alvin Wong <alvinhochun@gmail.com> Bug: None Change-Id: I9663a11d62a61674b361fc46eeb53b3c3096ccbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637585 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: L. E. Segovia <amy@amyspark.me> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 16d65289 2023-06-20T17:27:01 Vulkan: Remove hashing of the SPIR-V id in variable map The interface variable ids are already mostly packed, so a flat array will do with the id as key. Bug: angleproject:7220 Change-Id: I17cded0378b1b67379b979b00d69bbe04088a840 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628975 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7adf6532 2023-06-20T16:31:34 Remove unused helper classes Bug: angleproject:6954 Change-Id: I325f6a67b1f2f1dffdf051f83a8d4f29c4fe25dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628678 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang b46344bb 2023-06-12T13:50:40 Metal: Cache render pipelines at the context level Cache Metal render pipelines in a new mtl::PipelineCache which lives at the context level. This allows us to clean up unused pipelines from programs that are not actively used. The cache limits were chosen based on running Chromium. Without a limit, the total number of pipelines peaks at ~200. With frequent GCs, the active working set usually sits at ~60 pipelines. Bug: chromium:1329376 Change-Id: Ifa83b797c893684294e16dd638f6b3a35e1d043f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4608486 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Romaric Jodin 8882feeb 2023-06-13T09:24:23 common: linux: add support for DRM_FORMAT_NV12 In DrmFourCCFormatToVkFormats convert DRM_FORMAT_NV12 to VK_FORMAT_G8_B8R8_2PLANE_420_UNORM. DmaBufImageSiblingVkLinux can already consume it. BUG: b/277798516 Change-Id: I3173763101cf926fb2277651918631ec4de76e96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4604507 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 10380f4b 2023-06-06T11:52:08 Vulkan: Output SPIR-V ids from compiler In this change, the shader interface variables are given SPIR-V ids by the compiler before SPIR-V generation. Those ids are made available through the ShaderVariable interface. The transformer does not yet rely on this information. A follow up change will rework the backend's name->info map and the transformer to directly use ids instead of names. Bug: angleproject:7220 Change-Id: Ic0a62681d4bcf3ed171c39c3ecd83e438ea068c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4600609 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Steven Noonan a01a566c 2023-06-09T00:31:06 extension xmls: fix incorrect use of <ptype> tags I was having trouble using some GL/EGL loader generators because of some errors in the XML definitions for ANGLE. The first major problem is the content of the <ptype> tags. Let's refer to the Khronos registry XML schema (which is annoyingly a PDF rather than an xsd that we can test against, though I don't know if an xsd would catch this anyway): https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/readme.pdf In section 12.4.2, "Contents of <param> tags" it states: The <ptype> tag is optional, and contains text which is a valid type name found in <type> tag, and indicates that this type must be previously defined for the definition of the command to succeed. Builtin C types, and any derived types which are expected to be found in other header files, should not be wrapped in <ptype> tags Note that the above is repeated for the contents of <proto> tags as well. The extension XML files currently have a bunch of <ptype> tags which don't meet the expectations described above. The correct transformation for them would be, for example: <ptype>GLfloat *</ptype> -> <ptype>GLfloat</ptype> * <ptype>void *</ptype> -> void * <ptype>const char *</ptype> -> const char * <ptype>EGLAttrib *</ptype> -> <ptype>EGLAttrib</ptype> * The next issue is that some tags have some typos, such as "<pytpe>" instead of "<ptype>". (Now *that* is something an .xsd would catch...) The last issue is the use of the typename "GLvoid" which is not as serious a problem. It is still defined in Khronos' gl.xml <types> block, but Khronos no longer uses it in their XML registries. The comment for the "GLvoid" type in their <types> block states: <type comment="Not an actual GL type, though used in headers in the past">typedef void <name>GLvoid</name>;</type> So we might as well replace those with just plain "void". Anyway, long story short: to apply these transformations, I used Perl regular expressions, and applied these expressions in order: - Fix the tag misspellings: s#<(/?)pytpe>#<\1ptype>#g - Move the const qualifiers (if present) and pointer asterisk(s) (if any) outside the <ptype> tag itself: s#<ptype>(const )?([A-Za-z0-9]+)[ ]?(\*\*?)</ptype> #\1<ptype>\2</ptype> \3#g - Replace "GLvoid", "char", and "void" inside ptype tags to normal C types outside tags: s#<ptype>(GLvoid|void|char)</ptype>#\1#g Bug: angleproject:8190 Change-Id: Ib0bea79fecb7e714910b6e92124bb9f52994d0fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4603709 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang e005fbc0 2023-06-08T23:27:27 Vulkan: make GetFormatModifierProperties non-fatal for fallback check DmaBufImageSiblingVkLinux::initWithFormat is used to fallback like: - mutable format + srgb - mutable format + unorm - non-mutable srgb - non-mutable unorm However, it never fallbacks since GetFormatModifierProperties bails.So this change has made it non-fatal to allow fallback behavior. Meanwhile, this change updates the fallback order to use unorm as actual format first to favor most common scenarios. Bug: b/277798516 Change-Id: I60283590d85b27d55010cb2f5a2cc13d4df1ac9c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4603208 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Romaric Jodin <rjodin@chromium.org>
Cody Northrop d8339e78 2023-05-25T08:40:48 FrameCapture: Support EGLSync in MEC This CL starts treating EGLSync as a tracked resource, such that we can detect when they need to be created in Setup, or regenerated in Reset. Test: MEC of infinity_ops trace Test: Replay new kentucky_route_zero trace without error Bug: angleproject:8176 Change-Id: I130212f6edb78d9df29dd6e572843df25493ae09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4566949 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 4ff41604 2023-05-31T11:12:33 Vulkan: Declare common SPIR-V ids in the compiler The SPIR-V transformer no longer needs to discover these ids. Bug: angleproject:7220 Change-Id: I7082e831308eaac97ace3c128f398ff5f5497739 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4573825 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5f833ff2 2023-05-31T00:06:24 Vulkan: Pass non-semantic info from translator to transformer The SPV_KHR_non_semantic_info extension is set up in this change to allow the translator to communicate an overview of the SPIR-V to the SPIR-V transformer as well as mark locations of interest. This would help the SPIR-V transformer avoid having to discover basic ids and such locations. In this change, a few basic types are predefined and the location where new types and variables need to be defined are marked. Bug: angleproject:7220 Change-Id: I237b9a79efa9c192b3b11f1d97bc9b6a5cc2f8fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4573823 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 409bf134 2023-05-23T00:00:00 Metal: Adjust iOS and macCatalyst caps * Fix swapped iOS and macCatalyst versions for EXT_blend_func_extended and EXT_depth_clamp * Always use 13.1 as the lowest macCatalyst version Bug: angleproject:8121 Bug: angleproject:8047 Bug: angleproject:8015 Change-Id: I1f117de259d211cb8ce2463df59f8fee0e709ef5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568323 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mark Lobodzinski 8fdb164b 2023-05-11T10:03:57 Capture/Replay: Get and use actual EGLDisplay in trace ANGLE traces were using ANGLE_NO_DISPLAY for EGLDisplay args in traces. After the EGLSyncMap was added this caused error messages in Android and Linux playback of some traces. Added a global EGLDisplay to traces and initialized it with the proper value. Test: angle_trace_tests --gtest_filter=infinity_ops Bug: b/282725258 Change-Id: I1e6522cd4fdfee136c1e296805dac9d9f71256f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4534096 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Geoff Lang bcbf23c5 2023-05-16T11:08:13 When loading SwiftShader on Mac, look in "Libraries" If ANGLE is statically linked into Chrome, SwiftShader's dylibs will be in the Libraries folder. Search in both the current module directory and the Libraries folder to handle both cases. Bug: chromium:1445969 Change-Id: I1d6ca3bb7b77fe0c23cb932c95f22f1754eaf9e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4538366 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jason Macnak 5ab2fa96 2023-05-12T08:38:19 Vulkan: Move texture QFOTs to syncState() ... (and getAttachmentRenderTarget() which is syncState()-like for deferred clear) so that QFOTs are not actually scheduled until first use. SurfaceFlinger optimistically creates EGL images and textures for AHBs in case it does need them in the future. However, the images and textures may go unused. Prior to this change, ANGLE would create pending QFOT barriers while importing AHBs into EGL images and GL textures. However, SurfaceFlinger may not be doing any "real work" (other than repeatedly creating and destroying EGL images and GL textures) which would result in the command buffers containing the QFOTs being flushed. This can result in a large build up of unreleased memory (as the VkDeviceMemory would still be kept alive by the reference from the unflushed QFOT command buffer) and lead to the low memory killer nuking processes. Bug: b/282075554 Test: cts -m CtsOpenGLTestCases -t android.opengl.cts.GLSurfaceViewTest Test: adb shell dumpsys SurfaceFlinger Test: angle_end2end_tests --gtest_filter=ImageTestES3.AHBImportReleaseStress/ES3_Vulkan Change-Id: I7776abb2c6f834e96aa3926c26e77c53352ee561 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4527437 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jean-François Geyelin c2c8b062 2023-05-11T22:38:48 [Risc-V] Fix definition of kAndroidOpenGLTlsSlot. On Risc-V, ANGLE was using a TLS offset of 3. This worked... sometimes! On Risc-V, the android OpenGL TLS slot is supposed to be -5, as per tls_defines.h. Tested by running cuttlefish with Swiftshader + ANGLE on Risc-V Bug: b/273278430 Change-Id: Ib32f7dbcc158085b75f4befc277a03229ff87152 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4521034 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Jean-François Geyelin <jif@chromium.org>
Amirali Abdolrashidi 6f959e07 2023-04-28T16:00:11 Vulkan: Add non-device memory option for VMA image * Updated the required flags for allocateAndBindMemory() to no longer include VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, though still preferred. This allows VMA to allocate from another memory type if the device is out of memory. * Added a debug message to indicate when allocated memory for VMA image does not have all the preferred property flags. * Also added a warning in the case of memory allocation fallback. * Added a perf counter to keep track of image allocation fallbacks from the device memory. * deviceMemoryImageAllocationFallbacks * Added a test to make sure that VMA images can still be allocated from other memory types even if device memory is unavailable. * VulkanImageTest.AllocateVMAImageWhenDeviceOOM Bug: b/280304441 Change-Id: Ic452c18ded25345cdb7e271442372b99aede045e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4493483 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Geoff Lang e482d4b2 2023-05-08T17:53:14 Store the temp file name in a std::string instead of stack array It's possible to overflow the tempFile buffer if the temporary file directory is too long. Bug: chromium:1443445 Change-Id: Id6038f54cba2dfb524a5602df99bf775aecb4450 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4515532 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao 76fa3806 2023-05-04T10:19:35 Vulkan: Expand BufferOnly path for VertexArray binding change VertexArrayVk has a fast code path for attribute change where the only change is buffer (i.e, no format or relativeOffset change). It will pass in bufferOnly to syncDirtyAttrib() call and will avoid invalidate graphics pipeline. This CL expands DIRTY_BIT_BINDING_n change and will also try to detect the bufferOnly case. This CL and crrev.com/c/4507978 together seeing Gfxbench driver overhead score improves 1.48% (from average 6804 before CLs to 6905 after CLs) on pixel 7 pro. Bug: b/277644512 Change-Id: I71da1b886bb26ba2629b83af3aeaba4d45c3d3c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4504919 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com>
Charlie Lao 0561884e 2023-04-26T17:26:42 Vulkan: Dirty VertexArray binding bit if buffer storage change In crrev.com/c/3669603, we did optimization for black_desert_mobile that when vertex array is unbound, we remove vertex array from buffer's observer list to reduce overhead of observer notifications when buffer is been modified. To compensate for the lost notification, when vertex array is bound, we always assume every buffer that is bound to vertex array has been dirtied, for the simplicity at that time. This CL further the optimization of that CL. In this CL, I moved the dirty bit set into backend and improves vulkan backend by checking buffer's serial number and only dirty the binding if the serial has changed. Given this, now we can also remove all the non-current vertex array from buffer's observer list (previously it is heuristic based with a hard coded observer count limit). This and the previous CL improves asphalt_9 by ~1%. Bug: b/277644512 Change-Id: Ibc3f8e3df9fe70c6879e0b2bca86d8487a9dba73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4481241 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Alexey Knyazev b7a5714f 2023-03-31T00:00:00 Add polygon mode extension stubs * Added NV_polygon_mode * Specified a portable polygon mode extension implementable on all ANGLE backends Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I018aaaf1fb43ec16910859b152049e02169ede91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492684 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Roman Lavrov a88635c4 2023-04-28T18:54:25 Android logs also go to stdout/err, line-buffered if possible Currently logs like WARN() or INFO() only go to logcat, which doesn't make them visible in console. This change makes them go to both logcat and stdout/err. Fix android_helper choking on missing json data output when test crashes and test runner doesn't have a chance to produce that file. We still have the stdout/err in this case, so print it. However, a crash (such as SIGSEGV or __builtin_trap()) doesn't flush output so the non-flushed part of the buffer doesn't get in there. AngleNativeTest redirects stdout/err to a file which enables fully-buffered (stdlib) mode. Change this to line-buffered when stdout path is set to /data/ (/sdcard/ is slow) and use /data/data/com.android.angle.test/tmp/ as the temp path in android_helper. This makes e.g. FATAL() << "message"; show up in the logs in CI or local runs. This currently only applies to trace and perf tests, other tests will continue using fully-buffered /stdout/ as chromium's test_runner uses /sdcard/Download/ for temp files. Bug: b/276742336 Change-Id: Ia622c610f776f501223b0cca11d5ec1976eb9887 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4493463 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Igor Nazarov 8b97c8d3 2023-03-31T15:54:40 Implement build option for load-time GlobalMutex allocation. Performance difference on S906B for 1000'000 `eglGetError()` calls. Before: 26.5 ms After: 23.8 ms (Assuming `angle::FastMutex2` is used). Potentially can be enabled for other platforms. Bug: angleproject:8101 Change-Id: Ic2037edaae6da82dbded71288bae250d7981e7d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4386408 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Vikas Soni b5fa8728 2023-04-20T14:59:28 Add extension to skip texture renderability validation in ANGLE. Add a new extension to skip the texture renderability validation in ANGLE. Bug: angleproject:0000 Change-Id: Ia9e5a1eff233f5aced4706b7d3c183058d474c41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4455549 Auto-Submit: vikas soni <vikassoni@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: vikas soni <vikassoni@chromium.org>
Shahbaz Youssefi 1acc6d40 2023-04-21T17:03:49 Vulkan: Use Android TLS for *valid* global context ... instead of just global context. This means that the majority of calls which call GetValidGlobalContext() will be faster (because they don't need to check for context loss). Bug: angleproject:8135 Change-Id: Ia91f8fadb5799088542c58d417f31c3e5028b3e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4454769 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Ho Cheung f8b182b5 2023-04-25T04:45:39 Remove ANGLE code comments related to base::clamp We are recently converting base::clamp to std::clamp, and the original code comments related to base::clamp can be removed. Bug: angleproject:8140, chromium:1231569, chromium:1373621 Change-Id: Iae5f9e816ef1c531d728a35079d6110d1a9dad2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4469309 Auto-Submit: Ho Cheung <uioptt24@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 22b51592 2023-04-04T20:52:25 Implement fast GetCurrentThreadId() function. This function is 7-8x faster than GetCurrentThreadUniqueId() on Android. This CL is required for future CLs related with Global and Context mutexes. Test: angle_unittests --gtest_filter=SystemUtils.GetCurrentThreadId Bug: angleproject:8101 Change-Id: I4023b83510708ce242f4863b5cb12c6eef15e0a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4401939 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Stephan Hartmann b95c2867 2023-04-20T07:25:24 IWYU: add stdint.h in angle::base::SecureHashAlgorithm Bug: chromium:957519 Change-Id: Ic8980242ade4d804887da84e514c14b4e6729e38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4450309 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Scott Violet 65f4d2a4 2023-04-17T10:08:18 Adds features to enable loading/saving metallibs to blobcache CompileMetalShaders results in the appropriate command line tool being run to generate metallib blobs from shader source. DisableProgramCaching results in not saving programs to BlobCache LoadMetalShadersFromBlobCache results in trying to load metallibs from BlobCache. Bug: chromium:1423136 Change-Id: I01a4d7a5d60ed5ac978fb99db01b741e0f19e76b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4434293 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org>
Kimmo Kinnunen 3d17e9aa 2023-04-06T12:54:24 Add PLATFORM_IOS again ANGLE_PLATFORM_IOS means "iOS or MacCatalyst". Bug: angleproject:8121 Change-Id: I1482f44a106a1363623e2608b126ccde5548b81e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404162 Reviewed-by: Dan Glastonbury <djg@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen f507fe05 2023-04-06T12:27:00 Rename PLATFORM_IOS to PLATFORM_IOS_FAMILY The current define ANGLE_PLATFORM_IOS actually means "iOS or tvOS or WatchOS or MacCatalyst". The current define ANGLE_PLATFORM_WATCHOS means nothing. The current define ANGLE_PLATFORM_APPLETV means nothing. Replace PLATFORM_IOS and its uses with PLATFORM_IOS_FAMILY, so that then PLATFORM_IOS can be reintroduced and others can be fixed. Replace PLATFORM_IOS_SIMULATOR and its uses with PLATFORM_IOS_FAMILY_SIMULATOR for consistency. Use consistent `#if X` notation instead of `#if defined(X)`. Bug: angleproject:8121 Change-Id: Ibe668c2ae9bb801d15e036fcf1dfd53f22c30787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404161 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen c19b66f6 2023-04-06T11:30:03 EAGL: Define ANGLE_ENABLE_EAGL in build system ANGLE_ENABLE_EAGL is a "build system" decision. Set this and new variable ANGLE_ENABLE_CGL in BUILD.gn file. This is consistent with the other backends. Remove ANGLE_CPU_ARM64. This was used to do ANGLE_ENABLE_EAGL=TRUE when on Catalyst. Instead, let the build system set this. For ANGLE/Chrome buildsystem, this is not set, as Catalyst is not implemented. For WebKit, this should be set at WebKit build settings. Replace `defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)` with simpler expression: `defined(ANGLE_ENABLE_EAGL)`. Replace `defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_IOS)` with simpler expression: `defined(ANGLE_PLATFORM_APPLE)`. Bug: angleproject:8121 Change-Id: I3a0bbabb4347ad11f693e3f7c336ff12f66203d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404160 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Charlie Lao 20f875f8 2023-04-05T09:47:46 Vulkan: Add commandQueueWaitSemaphoresTotal perf counter This counts total number of wait semaphores we submitted. This will be used to write test to ensure that we insert wait semaphores properly in future CLs. Bug: b/275624771 Change-Id: I5b8e209500ff553617f6b30c2f8b4626d29c0e6a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400823 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Kimmo Kinnunen a4341e04 2023-04-06T11:05:07 CGL: Remove the impl preprocessor guards Adhere to the project formatting: - Remove #if preprocessor guards from the CGL implementation. - Order the includes as in style guide - Use include / import consistently - Move GLES_SILENCE_DEPRECIATION into .gn, similar to CGL - Remove or add platform.h include based on whether the file itself actually the platform.h defined macros Simplifies the nested preprocessor macros. Makes it simpler to further fix the preprocessor use. WebKit should instead have a non-ANGLE .mm file #importing the implementations with the proper include guards. Moves macOS specific APIs from SystemInfo.h to SystemInfo_internal.h, since common/platform.h is not available for Chrome clients of SystemInfo.h Bug: angleproject:8121 Change-Id: Iaef0d6948fbcef6d1c2e7877477d25ccc259cc2c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404159 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen cfc21f23 2023-04-06T18:39:26 Fix GetCurrentThreadUniqueId on Release APPLE Fix GetCurrentThreadUniqueId on Release builds of ANGLE_PLATFORM_APPLE. Code inside ASSERT() is discarded when compiling on Release. Instead, create the pthread per-thread keys outside ASSERTs and just assert the results. Bug: angleproject:8122 Change-Id: I89b7bd66f4346a94ec5c67eedda637f012ba7ff6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4406215 Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Ian Vollick 9199e77d 2023-03-30T17:25:33 [ios] simulator fixes for angle_unittests Disables some tests that do not currently work in the iOS simulator. Bug: angleproject:8116 Change-Id: I66bb9a6e2a5d10a567824e9fac163e7fd6b6a474 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4393495 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Roman Lavrov b49f9520 2023-04-03T18:11:04 Trace Interpreter: Improve ReadFileToString performance. Shaves off ~1s (~15%) from ~7.5s parse time on Panther for minecraft_bedrock trace. Switches the stream to std::ios::binary so on Windows the caller will need to handle \r\n Bug: b/276742336 Change-Id: I0c14e76168763875da60a0fdefb879859b0b3d0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392894 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov b30c05de 2023-04-04T09:36:28 Trace Interpreter: Add #include <algorithm> ANGLE-Dawn roll failed with: error: no member named 'lower_bound' in namespace 'std' Bug: b/276742336 Change-Id: Ife3d83aaa2b9f29f3750e880a12dfccf3f8fe915 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4391765 Auto-Submit: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov c723d71f 2023-04-03T16:17:01 Trace Interpreter: Improve StringToGLenum performance. Binary search instead of linear. This gets called a lot when parsing traces to be run by the trace interpreter. I saw ~37 seconds parse time on Panther for minecraft_bedrock trace, this CL makes that ~5 times faster. Bug: b/276742336 Change-Id: Ide32c247b327f36c00f26951a90e4412d71db2b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392892 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Greg Schlomoff a621ea88 2023-03-17T10:21:56 Adding a trace point for texture metrics. Bug: b/236121838 Change-Id: I28e7977f7b5dc6e24cb5a2be10689c223851ba0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4348737 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Doug Horn <doughorn@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Chris Dalton a491bbe3 2023-03-18T19:05:08 Add PLS utilities for interrupting a rendering pass Adds two more simple commands to ANGLE_shader_pixel_local_storage that allow WebGL and the command buffer to interrupt rendering passes without having to either (1) make expensive queries, or (2) track lots of complex state for validation that they are not currently equipped to track. Bug: chromium:1421437 Change-Id: I80eaef3ae6b0b4bbbecb9cd2268ac90b43675d1c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4355032 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jose Dapena Paz 5384667f 2023-03-20T10:23:13 IWYU: missing include for std::atomic in FixedQueue.h Fix build error using libstdc++ due to missing include for usage of std::atomic in FixedQueue.h: ../../third_party/angle/src/common/FixedQueue.h:61:10: error: ‘atomic’ in namespace ‘std’ does not name a template type 61 | std::atomic<size_type> mSize; | ^~~~~~ Bug: chromium:957519 Change-Id: I099a4a8c463149d74cf82ec6eda5e4a872d6e812 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4352888 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 12b3d52d 2023-03-10T17:02:55 Prevent bugs in "FastVector" class. FastVector does not call destructors when resizing down and constructors when resizing up. This may cause reuse of previous values after resizing up and prevent releasing resource in destructors. Above problems only relevant for non trivially constructible/destructible types. For performance reasons (chromium:1417087) this CL disables using trivially destructible types at all and adds special resizing methods for non trivially constructible types. Almost all uses of FastVector was already using trivially destructible types. Except "angle::FixedVector" used in "rx::vk::SubpassVector<>". However, "angle::FixedVector" is unnecessarily calls "clear()" in the destructor. This CL removed "clear()" and made the destructor trivial. All non trivial constructor cases are limited to "angle::spirv::BoxedUint32<>" used in "angle::spirv::FastVectorHelper<>". No problems found because of the possibility to reuse previous values. All "resize(count)" methods replaced with special versions. Therefore, this CL does not fix actual bugs, but rather prevents incorrect use in the future. Bug: angleproject:8021 Bug: chromium:1417087 Change-Id: Id65d75575f2f582450b1cc45dc6b1f2bf3bc5289 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4328286 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Chris Dalton 513ca723 2023-03-13T14:30:20 Delete GL_LOAD_OP_DISABLE_ANGLE from PLS This load op makes the PLS spec and WebGL implementations unnecessarily complex. Bug: chromium:1421437 Change-Id: Iab02a8b02083899c6cc345ecb25b88c5871611c9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4335148 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d6a25bfa 2023-03-07T15:06:10 Vulkan: Optimize glBufferData call to improve storage reuse If app calls glBufferData with certain size, then calls it again with size 0, and then call it again with same old size again, we should try to reuse the existing storage. When size is zero, with the existing logic, we never free the storage. When glBufferData is called third time with the same size as the first glBufferData call, we expect to reuse the existing storage. But because of the storage reuse logic is comparing buffer's new size to the old size (which is 0), we missed the opportunity to reuse the existing storage. This CL update the reuse logic so that it checks the new size against storage's size (instead of OpenGLES buffer's size) and if we will end up with same sized allocation and same pool and memory type, then we reuse instead of reallocate. This reduces efootball_pes_2021 frame time from 4.670 ms to 4.277 ms on pixel 7 pro. Bug: b/271915956 Change-Id: I6f91e3e85b104eca215b28e7d0bea413ecc4401c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4317488 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 98735ee0 2023-03-10T16:37:12 Revert "Fixed bugs in "FastVector" class." This reverts commit 94ff37bb2110f838b92c5bae22a657982ccb48ff. Alternative fix will be in the follow up CL. Bug: angleproject:8021 Bug: chromium:1417087 Change-Id: Ib34cd14b6cf36f474cc0ae09605ef1490aed82f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4328285 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton b468e4dd 2023-03-08T14:21:47 Add back "non-robust" PLS queries Chrome doesn't have a codegen template for queries that model the "robust" signature, so support both types. Specify that the robust variants are only supported if ANGLE_robust_client_memory is supported, so Chrome and other implementations don't have to support them. Bug: chromium:1421437 Change-Id: Icc69b69ce9ce0a2cfad0dbeed1f3b29bcfa92d20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4321867 Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 52ba6071 2023-03-06T00:00:00 Add EXT_texture_filter_minmax stubs Bug: angleproject:8072 Change-Id: Idfc2f2ff0eff7b0f6c131c37aeb53fb04019257d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4315865 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Amirali Abdolrashidi 156efe9e 2023-02-23T14:07:23 Fix the alloc error with enabled backtrace feature When angle_enable_unwind_backtrace_support is enabled, an assertion occurs on memory allocation with the following message: "constructed value does not match the lookup key" The assertion comes from PolicyTraits::apply() in the hash map. * In MemoryTracking.h, the type of mMemoryAllocationRecord is now std::unordered_map instead of angle::HashMap. Bug: b/262029018 Change-Id: I11a6d8e99a129759c046e37cef9e74f7db193066 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289947 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev 1174582a 2023-03-06T00:00:00 GL: Implement EXT_clip_control The extension is trivially exposed if the current context supports it. * Added packed clip control enums * Removed unused state query code * Aligned symbol names with the specs Bug: angleproject:8066 Change-Id: I9d106f39800658ecc75f4525ee93cb534dc49f9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306770 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 044612ec 2023-02-27T14:59:29 Vulkan: Remove iterator from FixedQueue class Previously there was code that still walking each element of FixedQueue, that was mostly removed in previous CLs. The only remaining usage is for assertion which the value is minimal. This CL removes the iterator from FixedQueue so that it behaves just like queue, thus avoiding potential risk of misuse. Bug: b/255411748 Change-Id: I4c0debf5b6c8b603e384c681f1a123c2ee06dcbb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4294695 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Alexey Knyazev a2efea13 2023-03-01T00:00:00 Add ANGLE_stencil_texturing This extension allows texturing of the stencil component of a packed depth stencil texture on OpenGL ES 3.0 contexts. Trivially exposed on backends that support OpenGL ES 3.1, which requires this feature. Adjusted the tests to check for the new extension string instead of the context version. Bug: angleproject:8051 Change-Id: I4d833acbc72e7374bde91d4c861598a0fdaf9b90 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4295312 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Hans Wennborg 35c44b40 2023-02-28T14:47:38 PoolAlloc: unpoison memory before potentially re-using it std::vector uses special ASan annotations to catch accesses to memory between v.data()+v.size() and v.capacity() -- which are valid memory locations but outside the container. A recent libc++ change [1] made these annotations work with custom allocators as well. This caused a problem when PoolAlloc re-used memory that previously held a std::vector with such annotations without having run the vector's destructor. To fix it, this change makes PoolAlloc unpoison memory when it's returned to the allocator via the pop() method. [1] https://reviews.llvm.org/D136765 Bug: chromium:1419798 Change-Id: I919dd7d7734b36bf770f25e096a94669703d75d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296797 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 1ca860ac 2023-02-22T00:00:00 Add extension stubs * GL_EXT_conservative_depth * GL_EXT_depth_clamp * GL_EXT_render_snorm Bug: angleproject:8046 Bug: angleproject:8047 Bug: angleproject:8048 Change-Id: I7deb4f25f76008103c2754747db2d90be880b6ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296803 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: 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>
Yuly Novikov cba2a0d5 2023-02-16T19:48:30 Keep MemoryBarrier macro defined Macro was originally undefined in crrev.com/c/361291. Undefining it breaks UWP build with newer compilers. Keeping the macro defined doesn't affect libGLESv2 exported symbols, so it looks like there is no need to undefine it. Bug: chromium:1380553 Change-Id: I6476aa015949e5f2639160fac80db39da710bfb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262071 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev dd1cf777 2023-02-16T00:00:00 Add EXT_texture_mirror_clamp_to_edge entry points Bug: angleproject:7968 Change-Id: I04b0c5d7b5148fbaca24d77a2c8688ea7a96cb64 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262073 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Alexey Knyazev <lexa.knyazev@gmail.com>
Gert Wollny a52c0a6c 2023-02-06T16:01:27 Capture/Replay: Add and handle new resource type for EGLSync So far calls involving EGLSync were not tracking the actual sync objects, and this may lead to race conditions in multi-threaded and multi-context scenarios. This CL adds the type EGLSyncID and some specialized code handling of egl::Sync to distinguish EGLSync from the already existing GLSync objects in order to track them separately. Bug: angleproject:7911 Change-Id: I91b188a41069bc0620f51c55ee516d23b55bdd38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4200095 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Igor Nazarov 94ff37bb 2023-01-17T19:11:50 Fixed bugs in "FastVector" class. Bugs: - items resources may not be freed after resizing to a lesser size. - reusing capacity may use old values for the new items. Fixed by resting removed items to default values. Alternative fix is to disallow dangerous operations on non trivially constructible/destructible types. Bug: angleproject:8021 Test: angle_unittests --gtest_filter="FastVector.DestroyOldItems" Test: angle_unittests --gtest_filter="FastVector.ReuseCapacity" Change-Id: I8bc616a9476608c9301e3f7af3a0d504e7e2d2db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4249960 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Geoff Lang 5a77200b 2023-02-08T17:10:28 Metal: Implement parallel shader linking. Update the Metal library cache to be thread safe. Change absl::flat_hash_map back to std::unordered_map because the value types now contain a mutex which must not move. Only generate async compilation tasks for shaders that were not already compiled and in the cache. Collapse some of the link methods in ProgramMtl that only had one call site. All linking is now done in ProgramMtl::link and ProgramMtl::load. Support disabling parallel linking using the new enableParallelMtlLibraryCompilation feature. Bug: chromium:1385510 Change-Id: I71ba71a34d994066729df7e4170911f88c89de4a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4234153 Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Igor Nazarov 8374bf5f 2023-02-13T20:35:32 Fix bug in FixedQueue::clear() and refactoring. - bug: "mSize" used to end the loop but also changed inside the loop by call to the "pop()" method. - refactoring: "mBackIndex" name is not correct, because variable references to the "index for next write", in other words - to the element past "back" (last written). Renamed to "mEndIndex" to match the "std" terminology. Bug: b/267348918 Test: angle_unittests --gtest_filter="FixedQueue.Clear" Change-Id: Ic65291a7ff2ff6f4eed223ca80fef187e42df3e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4245420 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Yuxin Hu e1bd0415 2023-02-03T16:58:21 Revert "Re-land fixing of commit ID for Android builds." This reverts commit e6662832af3c6394d0a0bbecd1e7a52581e88b12. After the commit https://github.com/google/angle/commit/61728827d2e5ecce685578bc54bb2c744b65fc9a, we no longer depends on git hash to determine if the program binary cache is valid. The reverted commit was added to handle unknown git hash. Android build infra does not guarantee access to git, and we needed GetANGLEHasBinaryLoading() check because we can't tell if ANGLE program changed if git hash remains "unknown" across different builds. Now that we used a different hash ANGLE_PROGRAM_VERSION as the cache key, which generates from a list of code files that affect program binary content and it won't be unknown on Android build, we can revert the commit and rely on ANGLE_PROGRAM_VERSION to reject invalid program binary cache. This fixes the dEQP test dEQP-GLES3.functional.shader_api.program_binary. simple.uniform_reset_on_binary_load, which failed because the GetANGLEHasBinaryLoading() is stopping Program::loadBinary() due to "unknown" git hash on Android build. This CL reverts most of the original commit, cleans up unused macros and variables, and reserves the change in program::loadBinary() that returns incomplete if binary format is not GL_PROGRAM_BINARY_ANGLE. This CL also reserves the changes in https://github.com/google/angle/commit/dd8021d98cd2909dfb85012f9b25010bd3ce2536 in case Sumsung parter still needs them. Bug: b/258445879 Change-Id: Ia4380de9362f7b8bed6de6a54943bec6600cb76b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4219368 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Geoff Lang 46f68dba 2023-02-06T15:22:31 Metal: Support LibraryCache below c++20. Usage of generic lookup with is_transparent is supported in c++20 or any recent absl version. Add macros to feature test c++ and fall back to copying the keys if generic lookup is not supported. Bug: chromium:1385510 Change-Id: I4017890e2cc664afe127defd63b8dd50fb6f4163 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4224874 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Auto-Submit: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Charlie Lao 11951f2f 2023-01-31T09:56:16 Vulkan: Add FixedQueue class for CommandProcessor::mTask This CL adds FixedQueue class. It uses std::array for the storage. It supports concurrent push and pop from two different threads. If producer want to push from two different threads, then proper mutex must be used to ensure the access is serialized. Similarly if consumers want to pop from two different threads, a mutex must be used to ensure serialized access. Caller must ensure queue is not empty before pop and not full before push. This CL switches CommandProcessor::mTasks to FixedQueue and moved mSubmissionMutex to protect the serialized submission (i.e, pop from queue). mWorkerMutex is still used to protect push operation. With this change, we now supports continued enqueue to mTask of CommandProcessor while other context is doing CommandProcessor::waitForResourceUseToBeSubmitted(). Bug: b/267348918 Change-Id: I6c5fe288436daa7e0f3bcbbcd16c5d2e5e27f2e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4210653 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov cae00d9b 2023-01-17T18:44:48 Vulkan: Cleanup shared ring buffer cmd alloc feature. Changes: - Simplified "SharedCommandBlockPool" interface. Removed "ptrOut" and "usesCommandHeaderSizeForOffsetOut" parameters, because "headerOut" has exactly the same value. - Refactoring of "SharedCommandBlockPool" classes. Some public methods made private, inline, or moved into ".cpp". - Replace some getters with more specific/restrictive methods: - "RingBufferAllocatorBuffer::getStorageSize()" -> "isEmpty()" - "CommandBufferHelperCommon::getAllocator()" -> "hasAllocatorLinks()" - Added extra ASSERT()s. - fixed typo "kMinRingBufferAllocatio(r)Capacity" - other minor modifications. Bug: angleproject:6401 Bug: b/256666069 Change-Id: I8f5c1c928bac5f8ecdfce7d411834f7ea39d11ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4218364 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 91fdf3e6 2023-01-31T11:38:32 Include atomic in RingBufferAllocator.h w/ ANGLE_ENABLE_ASSERTS Fixes the compile error. Bug: angleproject:7986 Change-Id: I2aef9c4c0b7d499d3cf382abb8fcf8dd83398f52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4205888 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen e1d5d8c0 2023-01-26T16:06:14 Include stdint.h instead of cstdint in platform.h The project seems to expect use of stdint.h, since almost none of uint*_t, int*_t use are prefixed with std:: namespace. It is reasonable to expect a contract that platform.h includes some specific files from the standard library when it establishes the "platform for ANGLE". It appears that the contract kind of already includes stdint.h types or defines. Replace <cstdint> in platform.h with <stdint.h>. The file platform.h is included from many files, so those files do not need to include the stdint.h redundantly. Remove #include <stdint.h> from Constants.h, as that file already includes platform.h and <stdint.h> is part of the "platform". Bug: angleproject:7977 Change-Id: I04563eb3680bcd7470775e3a60b9f466a00b8b63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194174 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Seija K 081764c8 2023-01-23T16:18:23 Remove checks for A8 devices iOS 13 and above dropped support for A8. We do not need this code anymore. Bug: angleproject:7971 Change-Id: Ie1fca5d93be902605ce989c213df4f2677fe1597 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4190138 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Sean Risser 0133b6f1 2023-01-20T16:02:27 Add GL_ARM_shader_framebuffer_fetch builtins Bug: b/242419750 Bug: angleproject:7882 Change-Id: I85582ad21e58e448b740789ec88f783c8b95ee01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4189028 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Sean Risser <srisser@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 18657894 2023-01-25T13:05:56 Add features to dump and replace shader source. dump_shader_source writes shader source strings to files named with the hash of the source and shader type. enable_shader_substitution allows subsituting the shader source with the strings contained in a file. The same file naming scheme as dump_shader_source is used so shaders can be dumped in one run, modified and subsititued in the next run. Use the ANGLE_SHADER_DUMP_PATH and debug.angle.shader_dump_path environment variables to control where files are written. If they are unspecified, write to the temp directory. Based upon Cody's CLs: https://chromium-review.googlesource.com/c/angle/angle/+/2755841 https://chromium-review.googlesource.com/c/angle/angle/+/3961670 Bug: angleproject:7760, chromium:1385510 Change-Id: I43b9827b977079b88daa794e867637f7a126b080 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4192347 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill f7b5d5d1 2022-12-15T10:52:07 Capture/Replay: Remove inline variable declarations. This makes parsing easier for the "simplified C" interpreter. We introduce a resource ID buffer as a way to manage a list of resource IDs to replace the inline resource lists. Turns on the Among Us trace in the interpreter tests. Bug: angleproject:7775 Change-Id: I1bb9c0e9b087965a18691bc99b2e9947610b9eaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4128719 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fdada9ee 2022-12-13T14:52:53 Re-land: "Make SyncIDs a packed type." This re-land fixes the sync map size tracking. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: If2114c51d5b68503890eacbf549182823667fedc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178012 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8971a592 2023-01-18T14:35:09 Revert "Make SyncIDs a packed type." This reverts commit 9de913077a5fcc3d2f2e327b56bbe30efe2fde96. Reason for revert: Fails win-trace, somewhat flakily. Original change's description: > Make SyncIDs a packed type. > > This prepares syncs to use a simple resource map like other > types, which will make life easier in the trace interpreter. > > Bug: angleproject:7775 > Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> Bug: angleproject:7775 Change-Id: I29534b14c973fa34a4cb7457d534cd6156f33cd2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178010 Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jamie Madill 9de91307 2022-12-13T14:52:53 Make SyncIDs a packed type. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Yuxin Hu 82826be0 2023-01-06T11:20:14 Reland "Make ANGLE program version only dependent on data that matters" This is a reland of commit 61728827d2e5ecce685578bc54bb2c744b65fc9a Changes made on top of previous commit 1. In src/program_serialize_data_version.py, fix the script error on Windows: anglebug.com/7918. 2. In BUILD.gn, replace the 'write_file' with 'response_file_content'. See https://gn.googlesource.com/gn/+/main/docs/reference.md#var_response_file_contents 3. In scripts/generate_android.bp.py, add code to handle the special GN build flag {{response_file_name}}. The code writes the list defined in srcs (identified by $(in) in Android blueprint) into a temp file named 'gn_response_file', and replaces the {{response_file_name}} with 'gn_response_file'. Original change's description > Changes made on top of original commit > 1. Enable execution permission on python script > program_serialize_data_version.py > 2. Remove unused list in libGLESv2.gni > 3. In angle/BUILD.gn, change file path from > "relative to angle_root", to "relative to root_build_dir", > so that inside the script program_serialize_data_version.py, > we don't have to find the absolute path of the code files for > hashing. > Original change's description > > This change introduces a new variable ANGLE_PROGRAM_VERSION > > to track the version of ANGLE source files that affect shader > > program serialization/deserialization. This change include more > > source files than necessary, to serve the purpose of a conservative > > jumping off point. We will narrow down the list of files for > > ANGLE_PROGRAM_VERSION hash generation in the future. > > Add a new script program_serialize_data_version.py that will > > be triggered during the build when the related source files changed. > > The script will generate a hash and the hash size from the related > > source files. In program serialization/deserialization and cache > > key generation, we will use this hash value instead of the entire > > ANGLE git hash. When the hash value changed, we know that the > > related source files changed, and we should invalidate the program > > cache and re-generate the blob cache / program binary. > > Bug: angleproject:4981 > > Change-Id: I2fb609416738d459d3289190c232c2d797ba58e3 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072215 > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Cody Northrop <cnorthrop@google.com> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Commit-Queue: Yuxin Hu <yuxinhu@google.com> > Bug: angleproject:4981 > Change-Id: Iaa9eb0ab33439197bc30d03064fc245ea7ef1ea8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113445 > Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:4981 Change-Id: Ib5bba199be6d08a1e19807026df0e7b747dbc8a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4144078 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 9bd37934 2023-01-12T00:00:00 Add EXT_polygon_offset_clamp entry points Bug: angleproject:7957 Change-Id: Ida28b852b1db3e6017b6e91a9424381eb8fe29f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169943 Auto-Submit: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Dan Glastonbury 1d2b20f5 2022-12-23T14:21:10 Metal: Fix Metal API deprecation warnings macOS 13/iphoneOS 16 deprecated Metal APIs, causing warnings when building ANGLE targeting Ventura as the minimum supported OS. WebKit handles deprecated APIs by selectively silencing warnings around the affected code. This change adds ANGLE_APPLE_ALLOW_DEPRECATED_{BEGIN/END} and wraps code generating warnings to silence the warning. Bug: angleproject:7908 Change-Id: I7469652e0f4e0cf41ae3c295c2e3ae6bbd72e949 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4121822 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Yuxin Hu c4b95929 2023-01-05T19:59:07 Revert "Reland "Make ANGLE program version only dependent on data that matters"" This reverts commit 61728827d2e5ecce685578bc54bb2c744b65fc9a. Reason for revert: it breaks aosp build: https://android-review.git.corp.google.com/c/platform/external/angle/+/2374971. Build error: `FileNotFoundError: [Errno 2] No such file or directory: 'angle_code_affecting_program_serialize'` Original change's description: > Reland "Make ANGLE program version only dependent on data that matters" > > This is a reland of commit c303758fbc8d23266be578fae246e5687656b4c6 > > Changes made on top of original commit > 1. Enable execution permission on python script > program_serialize_data_version.py > 2. Remove unused list in libGLESv2.gni > 3. In angle/BUILD.gn, change file path from > "relative to angle_root", to "relative to root_build_dir", > so that inside the script program_serialize_data_version.py, > we don't have to find the absolute path of the code files for > hashing. > > Original change's description > > > This change introduces a new variable ANGLE_PROGRAM_VERSION > > to track the version of ANGLE source files that affect shader > > program serialization/deserialization. This change include more > > source files than necessary, to serve the purpose of a conservative > > jumping off point. We will narrow down the list of files for > > ANGLE_PROGRAM_VERSION hash generation in the future. > > > Add a new script program_serialize_data_version.py that will > > be triggered during the build when the related source files changed. > > The script will generate a hash and the hash size from the related > > source files. In program serialization/deserialization and cache > > key generation, we will use this hash value instead of the entire > > ANGLE git hash. When the hash value changed, we know that the > > related source files changed, and we should invalidate the program > > cache and re-generate the blob cache / program binary. > > > Bug: angleproject:4981 > > Change-Id: I2fb609416738d459d3289190c232c2d797ba58e3 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072215 > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Cody Northrop <cnorthrop@google.com> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Commit-Queue: Yuxin Hu <yuxinhu@google.com> > > Bug: angleproject:4981 > Change-Id: Iaa9eb0ab33439197bc30d03064fc245ea7ef1ea8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113445 > Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:4981 Change-Id: If7d3779c8f40dafa9a9c057f669ab53d0494526e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4140138 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Jason Macnak 2256c548 2022-12-15T20:44:38 Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8 Bug: b/259551816 Test: cvd start --gpu_mode=guest_swiftshader Test: atest librenderengine_test Change-Id: I32a7b83494426e291cc93fe2b5f245eab6a54b0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4112149 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jason Macnak 6fdac95a 2022-12-15T20:36:01 Mirror Android AHB formats in ANGLE owned enum The existing code seems to try to keep all AHB formats defined in android_util.cpp (potentially in an attempt to simplify format conversions?). However, trying to avoid redefinition errors when conditionally re-defining the AHB formats across builds/branches is difficult. IIUC, there are two levels at play when building for Android: 1) "target level": the level of the phone/device you are building for. 2) "build level": the level of the repository/checkout you are building from. The "target level" (__ANDROID_API__) cannot be used to guard the definitions in android_util.cpp because it is possible to build for an older device in a newer branch. For example, suppose AHARDWAREBUFFER_FORMAT_X was introduced in Android T. If ANGLE tried to redefine AHARDWAREBUFFER_FORMAT_X in android_util.cpp with the guard "if __ANDROID_API__ < T", re-definition errors would still occur when building for Android S devices ( __ANDROID_API__ set to S) from inside of an Android T branch because the format would still be defined in android/hardware_buffer.h. A failure of this type can be seen in aosp/2308065 which tried to guard AHARDWAREBUFFER_FORMAT_R8_UNORM with "if __ANDROID_API__ < 33". Additionally, Android sets __ANDROID_API__ to 10000 before releases are cut and it is supposed to be fixed at release time. However, this has been observed to not be fixed on some less maintained side branches. Detecting the "build level" seems to be quite difficult. When building from outside of Android, this is the NDK level which can be detected using __ANDROID_NDK__ and __NDK_MAJOR__. When building from inside of Android, this is the latest level available on your specific branch. I believe this can only be found by incrementally checking for the existence of the various __ANDROID_API_R__, __ANDROID_API_S__, etc defines. This alternative can be seen in https://crrev.com/c/4039066. However, this is very difficult to find and read. Instead, let's just define ANGLE's own enum which mirrors the Android enums which can be used without having to worry about the current build system or release/branch. Bug: b/259551816 Test: cvd start --gpu_mode=guest_swiftshader Test: atest librenderengine_test Test: ANGLE presubmit Test: Android presubmit on aosp/master (aosp/2360445) Test: Android presubmit on aosp/android13-gsi (aosp/2360447) Test: Android presubmit on aosp/android11-gsi (aosp/2360520) Change-Id: I62f12cb0e1cc4b3b24aab7b85f39360a2cd2e438 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4112148 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 61728827 2022-12-14T15:29:15 Reland "Make ANGLE program version only dependent on data that matters" This is a reland of commit c303758fbc8d23266be578fae246e5687656b4c6 Changes made on top of original commit 1. Enable execution permission on python script program_serialize_data_version.py 2. Remove unused list in libGLESv2.gni 3. In angle/BUILD.gn, change file path from "relative to angle_root", to "relative to root_build_dir", so that inside the script program_serialize_data_version.py, we don't have to find the absolute path of the code files for hashing. Original change's description > This change introduces a new variable ANGLE_PROGRAM_VERSION > to track the version of ANGLE source files that affect shader > program serialization/deserialization. This change include more > source files than necessary, to serve the purpose of a conservative > jumping off point. We will narrow down the list of files for > ANGLE_PROGRAM_VERSION hash generation in the future. > Add a new script program_serialize_data_version.py that will > be triggered during the build when the related source files changed. > The script will generate a hash and the hash size from the related > source files. In program serialization/deserialization and cache > key generation, we will use this hash value instead of the entire > ANGLE git hash. When the hash value changed, we know that the > related source files changed, and we should invalidate the program > cache and re-generate the blob cache / program binary. > Bug: angleproject:4981 > Change-Id: I2fb609416738d459d3289190c232c2d797ba58e3 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072215 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:4981 Change-Id: Iaa9eb0ab33439197bc30d03064fc245ea7ef1ea8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113445 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Jamie Madill e5e78ab4 2022-12-29T13:16:13 Trace Interpreter: Auto-gen ReplayCustomFunctionCall. This makes it easier to add or remove fixture functions. Bug: angleproject:7775 Change-Id: I1c56465cfa0580414715f562cadc916c4baf3d11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4128718 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 067ace47 2022-12-21T00:00:00 Add ANGLE_clip_cull_distance extension Added an extension spec. Trivially exposed it on GL, Vulkan, and D3D11. Adjusted tests and validation to allow no cull distance support for this extension string. Removed extra built-in variable definitions. Bug: angleproject:7904 Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya cc34aa73 2022-12-19T14:03:27 Move BinaryStream to common and expose ShaderState to compiler This is a refactor change in preparation for adding support for glShaderBinary. Move BinaryStream to common so that it is accessible by both libANGLE and the Compiler. Extract members that hold the result of compilation from ShaderState and move into new CompiledShaderState struct. Move helper functions & classes relevant to ShaderVar serialization to the CompiledShaderState header. Tests: EGLBlobCacheTest* Bug: angleproject:7833 Change-Id: I7ec575247eccb3afbc6ab6bfa24d36e69d4576f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4080998 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Yuly Novikov 1e32988c 2022-12-21T15:53:15 Revert "Metal: expose Metal backend only on supported GPUs." This reverts commit 9364246f08d34a378252e517210b68e97282f764. Reason for revert: iOS build fails Original change's description: > Metal: expose Metal backend only on supported GPUs. > > Query all the GPUs on the system during ANGLE's initialization, and do > not expose the EGL_ANGLE_platform_angle_metal client extension unless > all of them support the required GPU families or feature sets. > > Tested locally on a 2015 MacBook Pro with dual Intel Iris Pro and AMD > Radeon R9 M370X GPUs. The AMD GPU supports Metal GPU family macOS 2, > but the Intel GPU, only family macOS 1. With this change, Chrome > properly falls back to using ANGLE's OpenGL backend when > --use-angle=metal is specified, and renders correctly. > > Bug: chromium:1365598 > Change-Id: I2c3533afe733e0d06d7755cae272bbd12aa9e676 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117716 > Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Gregg Tavares <gman@chromium.org> > Commit-Queue: Kenneth Russell <kbr@chromium.org> Bug: chromium:1365598 Change-Id: Iedbe8978f2a2d39a33359fa236a1d305c284266e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114291 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Choi Sungyong 9ded03b4 2022-12-20T07:09:36 Revert "Vulkan: Make available GLInternalFormatToGbmFourCCFormat" This reverts commit 402e7f7a634b1170d0feae52a44168731a7489f9. Reason for revert: Chromium android-binary-size build failed. Original change's description: > Vulkan: Make available GLInternalFormatToGbmFourCCFormat > > GLInternalFormatToGbmFourCCFormat() is not available on Linux > because of the guard with the wrong definition, ANGLE_USES_GBM. > This also fixes build errors that were occurred after enabling. > > Bug: angleproject:7829 > Change-Id: If7c7543270cc127945149927be0fc3ffdd49163b > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4022963 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jeff Vigil <j.vigil@samsung.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:7901 Bug: angleproject:7829 Change-Id: I256d51f78ff0d3ced9920c3ea1d2bfceba43a1ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113577 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>