src/common


Log

Author Commit Date CI Message
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>
Kenneth Russell 9364246f 2022-12-19T16:28:44 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>
Gregg Tavares be9e8e7b 2022-12-14T14:13:39 Add EGL_ANGLE_wait_until_work_scheduled extension We're changing eglReleaseTexImage so it calls flushCommandBuffer(mtl::NoWait) instead of flushCommandBuffer(mtl::WaitUntilScheduled) and then adding an extension to allow us to WaitUntilScheduled. This is because Chrome calls eglReleaseTexImage for every canvas and having it WaitUntilScheduled per call is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE once which will effectively wait just once. Bug: angleproject:7890 Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Sungyong Choi 275ee1ab 2022-11-10T17:27:14 GBM: Remove GBM_FORMAT_R16 Remove GBM_FORMAT_R16 format because current minigbm doesn't provide in gbm.h Bug: angleproject:7830 Change-Id: I66e4fb5a4479112bbb166f9afd21f919c026dd14 Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4025682 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Yuxin Hu 25ce2e23 2022-12-16T18:16:32 Revert "Make ANGLE program version only dependent on data that matters" This reverts commit c303758fbc8d23266be578fae246e5687656b4c6. Reason for revert: This is causing the Android roller fail: https://crrev.com/c/4072215/comments/6918d7f6_8100d66b?tab=comments Original change's description: > Make ANGLE program version only dependent on data that matters > > 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: Ib235d85c79ed54110696ac5413571934890fdc98 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114274 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Sungyong Choi 402e7f7a 2022-11-11T15:51:55 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>
Yuxin Hu c303758f 2022-12-14T15:29:15 Make ANGLE program version only dependent on data that matters 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>
Peng Huang e108858e 2022-12-14T12:16:39 Reland "Workaround GetModulePath() returns incorrect path for exe in Chrome" Original change's description: > Revert "Workaround GetModulePath() returns incorrect path for exe in Chrome" > > This reverts commit 4e54e434bd436e1a9d26ea527e1100747860dad8. > > Reason for revert: Causes ANGLE to crash on Android when loading from an APK > > Original change's description: > > Workaround GetModulePath() returns incorrect path for exe in Chrome > > > > Chrome changes process title that causes dladdr returns wrong module > > path for executable binary. Workaround the problem by using > > GetExecutablePath() which gets path from /proc/self/exe. > > > > Bug: chromium:1399828 > > Change-Id: I7dd89387160103af51e267a1dc8464715311f771 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089450 > > Auto-Submit: Peng Huang <penghuang@chromium.org> > > Commit-Queue: Peng Huang <penghuang@chromium.org> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Test: Load ANGLE from APK on Android > Bug: angleproject:7888 > Change-Id: I27f3e8fa7e5bbb0911669ece6afce61f4e9a2713 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4105340 > Auto-Submit: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Cody Northrop <cnorthrop@google.com> Bug: angleproject:7888 Change-Id: I2702c02dddea22713a8bbd79a4ed96e7475a4252 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4106348 Commit-Queue: Peng Huang <penghuang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 77c95de4 2022-11-16T21:12:28 Vulkan: Threaded monolithic pipeline creation With this change, once a pipeline is created out of libraries, a task is scheduled (if necessary) to asynchronously create a corresponding monolithic pipeline. Once the task is complete, the linked pipeline handle is replaced by the monolithic one, gaining back any performance that might have been lost due to the use of libraries. Bug: angleproject:7369 Change-Id: I525fb1e09f8bedc61b9dbef19f9cce7026ff9c53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031151 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Cody Northrop 4a4ae726 2022-12-13T18:55:17 Revert "Workaround GetModulePath() returns incorrect path for exe in Chrome" This reverts commit 4e54e434bd436e1a9d26ea527e1100747860dad8. Reason for revert: Causes ANGLE to crash on Android when loading from an APK Original change's description: > Workaround GetModulePath() returns incorrect path for exe in Chrome > > Chrome changes process title that causes dladdr returns wrong module > path for executable binary. Workaround the problem by using > GetExecutablePath() which gets path from /proc/self/exe. > > Bug: chromium:1399828 > Change-Id: I7dd89387160103af51e267a1dc8464715311f771 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089450 > Auto-Submit: Peng Huang <penghuang@chromium.org> > Commit-Queue: Peng Huang <penghuang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Test: Load ANGLE from APK on Android Bug: angleproject:7888 Change-Id: I27f3e8fa7e5bbb0911669ece6afce61f4e9a2713 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4105340 Auto-Submit: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Chris Dalton 004c5c94 2022-12-10T14:50:01 Prefix all PLS enums with "GL_" Bug: angleproject:7279 Change-Id: Ifb4062e502305f4e59546f067d195d1a05fbabe4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4095380 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Steven Noonan <steven@valvesoftware.com>
Amirali Abdolrashidi 684ff60b 2022-06-21T10:52:31 Vulkan: Add shared ring buffer cmd alloc feature * Added RingBufferAllocator.cpp with implementation. * Main classes: * RingBufferAllocator (fast allocation with bulk deallocation) * SharedRingBufferAllocator (wrapper to help with shared use and multiple threads) * Implemented "angle_enable_vulkan_shared_ring_buffer_cmd_alloc" feature. (Disabled by default) * Details (from the original CL) * The angle::PoolAllocator replaced with angle::RingBufferAllocator. * Before, there was separate angle::PoolAllocator per each CommandBufferHelper. Now, a single angle::RingBufferAllocator is shared between multiple CommandBufferHelper objects. * Commands data from multiple CommandBufferHelpers is tightly packed without fragmentation. * Significantly less memory overhead, observed with enabled async queue. * Moved the parts of the code related to the allocators into the classes in the new AllocatorHelperPool and AllocatorHelperRing files for better management. The allocator can be switched by changing the following BUILD flag: `angle_enable_vulkan_shared_ring_buffer_cmd_alloc` * It is connected to the following macro: ANGLE_ENABLE_VULKAN_SHARED_RING_BUFFER_CMD_ALLOC * The two main allocator classes in each file are aliased as: * SecondaryCommandBlockAllocator (in CommandBufferHelper objects) * SecondaryCommandBlockPool (in SecondaryCommandBuffer) * Also added placeholder functions for VulkanSecondaryCommandBuffer. * Added descriptions regarding the two allocators. * renderer/vulkan/doc/Allocators.md Credit: Original CL authored by Igor Nazarov <i.nazarov@samsung.com> Bug: angleproject:6401 Bug: b/256666069 Change-Id: I0f24793eef6334bf4ff8e327b9665338807dad37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3715968 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Peng Huang 4e54e434 2022-12-09T09:36:42 Workaround GetModulePath() returns incorrect path for exe in Chrome Chrome changes process title that causes dladdr returns wrong module path for executable binary. Workaround the problem by using GetExecutablePath() which gets path from /proc/self/exe. Bug: chromium:1399828 Change-Id: I7dd89387160103af51e267a1dc8464715311f771 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089450 Auto-Submit: Peng Huang <penghuang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton eb1a13d8 2022-12-06T21:56:42 Improve PLS load and store op tokens Define more new tokens that are more clearly named, as opposed to recycling tokens that were meant for a different purpose. Bug: angleproject:7279 Change-Id: I840e5ea168235c49eec2693b2231c2d329027b0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4082057 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Amirali Abdolrashidi 58d7ace2 2022-11-22T16:08:07 Vulkan: Add memory allocation log support in debug * Added a memory tracker to the renderer object to keep track of the memory allocations and deallocations in more detail. * This feature is used for debugging only. * To enable it, set angle_enable_memory_alloc_logging=true in GN args (added in renderer/vulkan/BUILD). * It is related to ANGLE_ENABLE_MEMORY_ALLOC_LOGGING in the code. * The tracker are updated in the memory allocation tracking functions if the feature is enabled. (The counter is always updated, even if the feature is disabled.) * At the end of a RendererVk object, it checks for and logs any remaining allocated memory from MemoryAllocationType members. * The data is stored in the map object "mMemoryAllocationTracker". The key used for it is currently of type angle::BacktraceInfo. * If angle_enable_unwind_backtrace_support is disabled, or not on Android, the key is an empty object. * MemoryAllocInfoMapKey is used as a key to access the allocation information. Bug: b/242641395 Change-Id: If701a4bdea2f8738a830ee47e0c7c5cdacf95b87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4050103 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Nicolas Capens aa7bb157 2022-12-01T00:33:31 Include volk.h from a relative location Previously it was always included from third_party/volk/ This change makes it easier to use an externally provided copy of volk. Bug: b/260093525 Change-Id: I60bdb0ee4f6f6293fce5198af438e9af8d84421f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4066872 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nicolas Capens 938f4372 2022-11-30T15:30:23 Move trace_event into anglebase This originates from Chromium's base/trace_event/ so it doesn't need to be under a third-party folder. Bug: b/260093525 Change-Id: Iab7a40569b6c1f91454f099c07bf51e3ce4b65df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4068342 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Nicolas Capens c991eb22 2022-12-01T14:05:07 Move the anglebase folder up a level This code originates from Chromium's base/ directory so it doesn't have to be under a third-party folder. Bug: b/260093525 Change-Id: I0bf6950095c685f36c5c237093980a64cf6e74f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4068339 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens 0d7a4884 2022-11-30T14:33:12 Use string_view to compute custom string hash C++17 supports std::hash<string_view>, which can be used to compute a hash for the custom sh::TString class. This eliminates the dependency on smhasher. Bug: b/260426695 Change-Id: I2f4044fea4e44396a5d798436ec02da22a37bed7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4066987 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens 022b52f5 2022-11-30T14:58:01 Include xxhash.h from a relative location Previously it was always included from src/common/third_party/xxhash/ This change makes it easier to use an externally provided copy of xxhash. Bug: b/260093525 Change-Id: I27c375c58ac3776a15d5d68483c235ece235b059 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4066278 Commit-Queue: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Chris Dalton 8ee1b89f 2022-11-04T13:10:37 Refactor pixel local storage options The various different PLS options were getting scattered and unruly. We are also in need of more backend-specific PLS options that would be difficult to add as-is. This CL refactors them into a single "ShPixelLocalStorageOptions" struct that gets initialized all in one place, and shared between the compiler and the backends. Bug: angleproject:7279 Change-Id: Ic58dccb8d1ba350a0b6cc5848ce15bd687e30fad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4006715 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Nicolas Capens 37d6a9db 2022-11-18T17:42:21 Support versioned library names Previously ANGLE_GLESV2_LIBRARY_NAME was expected to be the library name without extension, and on Linux .so would be appended. This didn't allow for building ANGLE as libEGL.so.1 and libGLESv2.so.2 as is common. This change checks if the library name already contains a dot, and if so doesn't append the platform specific extension suffix. Bug: b/259282560 Change-Id: I81cda218180ae7fe6321e1ac7e4eff7257bf1493 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4038450 Commit-Queue: Geoff Lang <geofflang@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Nicolas Capens <nicolascapens@google.com>
Shahbaz Youssefi 68b47e58 2022-11-16T10:46:59 Vulkan: Initial support for VK_EXT_graphics_pipeline_library When available, this change uses VK_EXT_graphics_pipeline_library to create pipelines. Currently, it is only used when graphicsPipelineLibraryFastLinking is available. This restricts the use of this extension to devices where monolithic pipelines are not any more performant than linked libraries. A future change adds support for other implementations by providing async pipeline creation. Bug: angleproject:7369 Change-Id: I1e3b7ac4aa56e75c7d6f4d0d5ea91cb0b862e581 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031489 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Steven Noonan <steven@valvesoftware.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis 95cfa687 2022-11-18T15:26:36 Revert "Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8" This reverts commit dcf3ab1228428b2f9d1449852e2359bad70e2dfe. Reason for revert: Causing AOSP roll build failures: https://android-review.git.corp.google.com/c/platform/external/angle/+/2308065?tab=checks Original change's description: > Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8 > > Bug: b/259551816 > Test: cvd start --gpu_mode=guest_swiftshader > Test: atest librenderengine_test > Change-Id: I874278fe50dd1b501c11c484c55ed91e67a7013b > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4034130 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/259551816 Change-Id: Iac19db493ecda89bc49d05cc34f5b51818e39737 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4035110 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jason Macnak dcf3ab12 2022-11-17T09:52:36 Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8 Bug: b/259551816 Test: cvd start --gpu_mode=guest_swiftshader Test: atest librenderengine_test Change-Id: I874278fe50dd1b501c11c484c55ed91e67a7013b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4034130 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7fb1a25d 2022-11-16T11:40:55 Make BitSetT::Mask return a bit set This allows a Mask function to be implemented for BitSetArray, which is added in this CL. When using larger bitsets on 32-bit systems, the current Mask implementation prohibits its use. This is in preparation for a follow up change that uses Mask on such a bitset. Bug: angleproject:7369 Change-Id: If995d96ec1583a546f20bff277f3223e2f2490f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031493 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 44d8fef8 2022-11-01T00:00:00 Add ANGLE_provoking_vertex spec Renamed provoking vertex enums to use _ANGLE suffix. The newly defined enums alias those from the desktop OpenGL extensions. Updated tests to use the new enum names. Bug: angleproject:2829 Change-Id: I72b686773536d3d54a653114cee5292007510a55 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4013700 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Amirali Abdolrashidi f62405c5 2022-10-31T18:47:52 Add utilities to get the Android backtrace * Added getBacktraceInfo(), which returns the backtrace information from the ANGLE code, including the addresses and the symbols if possible * Returns the data in an instance of the new class BacktraceInfo. * In order to access this function, backtrace_utils.h has been included in vk_utils.h * New GN flag to make use of this feature: * angle_enable_unwind_backtrace_support * Current only available on Android (debug mode) * If the flag is disabled, getBacktraceInfo() returns an empty object. * Added functions in util/ (per platform) to print the BacktraceInfo data. * Example of usage: angle::printBacktraceInfo(angle::getBacktraceInfo()); * Minor edit: Moved cstdint from android_util.cpp to its header. Bug: b/258475923 Change-Id: I6115462a1a2845d40c7cafc14ce52df09ecdcf34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3995843 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Roman Lavrov 67300089 2022-11-07T09:52:14 Improve error messages when failing to load a library. https://groups.google.com/g/angleproject/c/SE6zIKU9LzY/m/WvyFvPW1DQAJ Bug: None Change-Id: Id44d96e14f8cc6607c40c746d51719753f3904dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4008999 Commit-Queue: Roman Lavrov <romanl@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Auto-Submit: Roman Lavrov <romanl@google.com>
Chris Dalton 3605b399 2022-10-20T17:00:02 Move PLS clear values back into context state The API that required packing raw data into a buffer was un-ergonomic for developers and difficult to implement for WebGL vendors. Bug: angleproject:7279 Change-Id: If7c98908c285462c5775e8e2d8811883be139f64 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3972376 Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton 86d9d876 2022-11-01T22:21:52 Finish renaming GL_PIXEL_LOCAL_STORAGE_ACTIVE_PLANES_ANGLE Fix a couple spots that missed the rename. Bug: angleproject:7797 Change-Id: Iee44b525f70e00e631e07ec2e984c7a41c3b616a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3996109 Reviewed-by: Steven Noonan <steven@valvesoftware.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Akihiko Odaki 31a090ca 2022-11-01T22:09:44 Debug: Handle LOG_EVENT on Apple platform Trace() lacked the code path to handle LOG_EVENT for Apple platform, leading to the "unreachable" code path. Fix the problem by logging the message as info-level with the OS interface, as done for Android. Bug: angleproject:7802 Change-Id: I45811102c07c9f65c5a828f71c37bd8d0cd672e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3996521 Auto-Submit: 小田喜陽彦 <akihiko.odaki@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Gert Wollny 7ea302b6 2022-10-31T09:21:18 Capture/Replay: Special-case EGL image attribute pointer write If we don't special case this, the taken code path may end up writing "(nil)" if we have a null pointer, and compilation of the test will fail. Bug: angleproject:7793 Change-Id: Ic9fe9ccca0304069adbbb996666bc643e7d29278 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3990758 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Shahbaz Youssefi 2bc9f1f4 2022-10-26T10:38:02 Lazily create threads in the thread pool The Vulkan backend doesn't use thread pools normally, so creating threads is a waste of CPU time. Additionally, creating threads early causes issues with some sandboxing strategies. Bug: b/250688943 Change-Id: I33f1b73bdc62f6a0c0b2277ce99ba78a87464486 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3982174 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Geoff Lang 6c53a562 2022-10-24T10:24:10 Add missing cstring include in gl_enum_utils. Bug: angleproject:7752 Change-Id: I44ac0996673065b9633b35e4b07c5150a1ae3dcd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3970767 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill dc62b3ee 2022-10-10T21:00:16 Capture/Replay: Add trace interpreter. Also adds a self-test using the retrace script. Bug: angleproject:7752 Change-Id: I1985b47250bef99726d2ca2d90bef859208e357e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965128 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 6193274a 2022-10-10T21:00:12 Capture/Replay: Redesign in-memory call capture replay. This will allow the replay to use the call captures returned by the interpreter's parser. Bug: angleproject:7752 Change-Id: If1b281d9ce7ccfbdc23bea615e1e2258c8a029f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963367 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill cd10b6d2 2022-10-10T21:00:07 Enum Utils: Add method to return enum value from string. We'll use this in the trace interpreter to parse enum values. Bug: angleproject:7752 Change-Id: I232a00baac2f74c9618029929bbb3e5822654046 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963366 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fd45cec3 2022-10-10T20:59:58 Entry Points: Move enum helper to registry_xml. This will make it accessible to other generators. Bug: angleproject:7752 Change-Id: I91bc9a4d6c919266ea329f66d271bf881d99d17a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963364 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4bfb749f 2022-10-10T20:59:48 Capture/Replay: Move shared trace code into src/common. This will let them be accessible to the test harnesses. The trace tests interpreter will need direct access to the classes that we move in this CL. This CL also moves the GLenum utils into the common folder, where they were already used by some other tests. Bug: angleproject:7752 Change-Id: I97ad607938ef29bc316f6d40098478e002ea8128 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963362 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 8403e4c5 2022-10-10T20:59:29 EGL: Resource IDs for Surface, Context and EGL Image. This will make these classes play nicely with resource maps. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. This indirection will also have increased safety as we validate EGL resource ID handle values before accessing the memory directly. Also hides some of the other EGL capture methods behind helper methods to simplify the C code and hide assignments and other complex maps. Bug: angleproject:7758 Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Sungyong Choi c6390143 2022-10-12T09:57:55 Vulkan: Make compatible with GCC Resolves below warnings occurred with GCC build. 1) deperecated-copy Overriding an assignment operator without a copy constructor caused the deprecated-copy warnings. 2) unused-function 3) parenthesis Warnings occurred due to missing parenthesis around some logical expressions, add them to quiet the warnings. 4) unused variable 5) 'maybe-unused' attribute ignored Introduces 'ANGLE_MAYBE_UNUSED_PRIVATE_FIELD' macro to avoid 'attribute ignored' warning which is only occurred with GCC because GCC doesn't warn about 'unused non static data member' whereas Clang has Wno-unused-private-field. Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Bug: angleproject:7764 Change-Id: I8e7410a5ed8cb9b8f8b3202073d779fea63d6b75 Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963830 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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>
Shahbaz Youssefi fbd7d5fa 2022-10-17T17:20:09 Move thread pool classes to common/ In preparation for access by image_util files. Bug: b/250688943 Change-Id: I24777269a5071eae9a60f939635d01ed7246461f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 0d203aef 2022-10-16T10:08:01 EGL: Add ID types for egl::Surface and egl::Image. This is in preparation for using resource maps for Context, Surface and EGLImage. The map change will make it much easier to work with the trace fixture. It will also have a small benefit in safety as we will longer be casting raw pointers for these types. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. Bug: angleproject:7758 Change-Id: Ib1d19622a4f2a6f0458cc28f5bbe30bb9f349b98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957163 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 09b079bb 2022-10-14T14:28:10 Vulkan: Move pipeline subset out of pipeline desc This way, the same pipeline desc can be used to query multiple caches with different subsets. This design requires the pipeline cache to be templated, while the previous design required the desc to be copied (so the subset bits would be different). Bug: angleproject:7369 Change-Id: Id3fd92e6f9b059069952ff092a5c867e79287604 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956940 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 7c4dc253 2022-10-12T08:38:46 Capture/Replay: Clean up EGL capture. This switches the EGL capture types to ANGLE-casted pointers since that's what we receive in the capture layer. Note that even if the capture layer were used as a pure layer, not an EGL implementation, we'd still have these types for state tracking. This also prefixes each EGL class in the entry points with the egl namespace for consistency and for simplifying the ParamType code. Required changing to non-const gl::Context * in a few places. Also changes the gSurfaceMap to be indexed by the raw pointer value, which cleans up the code somewhat. Bug: angleproject:4035 Change-Id: Id800c1ba25e5819ac7ea1df8aab806bc393fe192 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949910 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 94b45181 2022-10-12T14:54:14 Vulkan: Rearrange graphics pipeline desc bits In preparation for use of VK_EXT_graphics_pipeline_library, the pipeline state is split in three contiguous regions: - Vertex input - Pre-rasterization and fragment stages ("Shaders" for short) - Fragment output There is some state that affects both Shaders and Fragment output, which is split and placed in between the two. This will allow the hash and compare functions to eventually access each of those pipeline subsets as a contiguous piece of memory. Bug: angleproject:7369 Change-Id: Iedc4cf15ed6c7fed6ba93039889fbf5dd191e041 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949914 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 135022e4 2022-10-11T00:03:11 Vulkan: Create robust pipelines based on context state Previously, pipelines were made robust based on whether any context in the share group has so far been made robust. This means that pipelines created on non-robust contexts would still be compiled as robust. Inefficiency aside, this was buggy because robustness was not part of the pipeline cache key, so if a pipeline was created as non-robust first, then recreated in a robust context, it would reuse the non-robust variant. With VK_EXT_pipeline_protected_access, a similar situation arises for context protected-ness. However, it is incorrect in that case to create pipelines as protected unnecessarily. This change makes pipeline robustness a part of the pipeline cache key, in preparation for protectedness to be added similarly. Compute programs may now generate multiple pipelines as a result too. Bug: angleproject:7629 Change-Id: Ie95f10eff878f8c8b221c1018da44385c7aad15e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3943534 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Chih-Hung Hsieh 7072bd9b 2022-02-09T14:43:18 Fix cert-dcl16-c warnings Bug: b/120614316 Test: make tidy-soong_subset Change-Id: Iddde03d9a554b078ef87d3b8d4ab3de78b40a725 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3935459 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Greg Schlomoff <gregschlom@google.com>
Shahbaz Youssefi 159f3e62 2022-09-28T23:34:06 Vulkan: Make sure spirv-val doesn't generate friendly names This makes it harder to debug as the disassembly uses raw ids. Additionally, the generation of friendly names itself is costly. On GLES1's TexCombine test, this change reduces run time by ~7%. Bug: angleproject:6644 Change-Id: I47e6752cd709733c49915dd374c18f5438c0bfdf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3926038 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Le Hoang Quyen d64c54e3 2022-09-26T21:25:18 D3D11: Make DebugAnnotator11 thread safe. Bug: chromium:1366778 Change-Id: I50662895be8ec40de4ded8c4f84bde59ae40e98b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3917936 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Chris Dalton a7dc51f2 2022-10-01T08:49:11 Add a framebuffer fetch implementation of PLS The framebuffer fetch implementation works by attaching PLS backing textures to the framebuffer, and then rewriting PLS uniforms as "inout" fragment variables. The compiler's existing machinery takes it from there and makes it work on GL and Vulkan, and soon Metal. EXT_shader_framebuffer_fetch is now the preferred backend for pixel local storage, but we also use EXT_shader_framebuffer_fetch_non_coherent if shader images can't be coherent. This is especially interesting for Vulkan, since noncoherent framebuffer fetch is possible without any extensions. Bug: angleproject:7279 Bug: angleproject:7683 Bug: angleproject:7684 Bug: angleproject:7724 Change-Id: I33f3b2c6df9a5709969d9165c448ea71b096c9e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3900142 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>