src/libANGLE/State.cpp


Log

Author Commit Date CI Message
Igor Nazarov 36c3e0f5 2023-01-17T17:42:59 Implement "Shared Context Mutex" functionality. Existing implementation uses single `GlobalMutex` for - EGL calls - GL calls for Contexts with concurrent access. This CL introduces abstract `egl::ContextMutex` with two implementations: - SingleContextMutex; - SharedContextMutex<Mutex>; Note: `std::mutex` is used in this commit. It is very easy to change mutex type either at compile-time or at run-time (single type per Display). When Context: - is not Shared; - does not use `EGLImage`s; - does not use EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE - does not use EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE then it will be using `SingleContextMutex` with minimal overhead. Before such Context is used as `shareContext` or uses `EGLImage` its mutex replaced by `SharedContextMutex<Mutex>`. The `GlobalMutex` is only used for EGL calls, while `egl::ContextMutex` implementations for GL calls. Because some EGL calls use Context, explicit `egl::ContextMutex` lock is required. This is implemented by generating "egl_context_mutex_autogen.h" header, and insertion of `ANGLE_EGL_SCOPED_CONTEXT_LOCK()` macro before `ANGLE_EGL_VALIDATE()` in each EGL entry point. Implementation in "egl_context_lock_impl.h" returns lock for required APIs. Special cases of `egl::ContextMutex` lock handled separately. `std::unique_lock<>` is not used for performance reasons. `egl::ContextMutex` explicitly locked when capturing EGL calls. Fixes EGLImage problem: https://chromium.googlesource.com/angle/angle/+/e18240d136d15e5cdfa4fa4a6355ca21c8d807b6 Mark contexts as shared when importing EGL images. Details: - EGLImage inherits Context's mutex when created. Mutex is used when the EGLImage accessed or destroyed. - When EGLImage is used in Context with other `egl::ContextMutex`, two mutexes are merged into one. - After the mutex merge, Context Groups will remain separate, but will not be able to run in parallel. Fixes race when checking `context->isShared()` in the `SCOPED_SHARE_CONTEXT_LOCK()` macro. One Context may start executing GL call while not "Shared", but become "Shared" inside the call. New (second) "Shared" Context may immediately start using GL and potentially corrupt some "Shared" state. Possible performance benefit: allows parallel execution in some cases, when single `GlobalMutex` would block. Important note: Process of replacing the `SingleContextMutex` by `SharedContextMutex<Mutex>` is not 100% safe. This mean that original Context may still be using `SingleContextMutex` after activating `SharedContextMutex<Mutex>`. However, this was always the case before introduction of this CL. Old `Context::mShared` member update was not synchronized in any way at all. In other words, this solution does not 100% fix the original problem. For 100% safe solution `SingleContextMutex` should not be used (always pass `SharedContextMutex<Mutex>` to the `gl::Context` constructor). See `lockAndActivateSharedContextMutex()` for more details. CL adds new build option: angle_enable_shared_context_mutex = true Behavior with other build options: - When: `angle_enable_shared_context_mutex` is disabled or `angle_enable_share_context_lock` is disabled or `angle_force_context_check_every_call` is enabled, Contexts will always have `SingleContextMutex`, however it will be only used in special cases. `SCOPED_SHARE_CONTEXT_LOCK()` will use `GlobalMutex` when applicable. - Otherwise, `SCOPED_SHARE_CONTEXT_LOCK()` will use `egl::ContextMutex`. Some GFXBench "1080p Driver Overhead 2 Offscreen" performance numbers. Tested on S906B (Samsung Galaxy S22+) on old ANGLE base: https://chromium.googlesource.com/angle/angle/+/807c94ea85e046c6f279d081d99f0fb1bcf1191a Capture/Replay: Adjust tests do adhere to capture limits Each test result is an average frame number from 6 runs. SingleContextMutex 6579 ( +0.13%) (old) GetContextLock() (mShared is false) 6570 Forced `mShared = true` or NOT using `SingleContextMutex`. SharedContextMutex<std::mutex> FORCE 5061 (-22.97%) (old) GetContextLock() FORCE 4766 (-27.46%) Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Idcd919f9d4bf482b9ae489bd8b4415ec96048e32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao e21ecd1b 2023-05-26T14:06:46 Vulkan: Add dirty bit processing for uniform buffer change When app calls glBufferData for the uniform buffer, we may end up reallocate the storage. This will set DIRTY_BIT_UNIFORM_BUFFER_BINDINGS on the context, but the exact uniform block index gets lost along the way. This CL sets mDirtyBits on the program for the corresponding block index and then changed vulkan backend to utilize the program's mDirtyBits and only update the buffer if it is dirty, instead of always update all uniform buffers even if only one of the buffer is dirty. In order to make this work, this CL also adds the reverse tracking from buffer binding to uniform blocks. Previously we already have the tracking of which buffer binding index is used for which buffer block index. This CL adds mUniformBlockBindingMasks which is an array of BitSets. Each array element tracks all the uniform block index that is using this buffer binding index (you can have the same buffer bound to multiple uniform block index). Then when a buffer binding index is dirty, that BitSet gets added into program's uniform block dirty bits. This CL and previous CL improves GfxBench gl_driver2_off score 1.8% (from average 6797 to average 6919) on pixel 7 pro. Bug: b/282194402 Change-Id: Ic5002643a5297907276fc9b20ca7d21af9bdc4fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4553136 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Chris Dalton 7d4c6d1d 2023-05-09T12:19:54 Allow glDelete* while PLS is active Banning glDelete* is extremely dangerous. It will almost definitely cause memory leaks in client code, and it makes JS garbage collection needlessly complex. Instead, specify that PLS is implicity deactivated if the client deletes anything that is attached to the current draw framebuffer during a PLS rendering pass. Bug: chromium:1421437 Change-Id: I3a18ee6b5d5567431e6fa3eccea58cb049845502 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4521436 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Shahbaz Youssefi 80dd54f9 2023-05-17T22:16:59 Vulkan: Enable VK_EXT_image_2d_view_of_3d and set flag Based on a change by Yiwei Zhang <zzyiwei@chromium.org> Enabling the extension was missed from https://chromium-review.googlesource.com/c/angle/angle/+/3648586, and some implementations do rely on the feature enablement (e.g. RADV). This also fixes the VVL violations on satisfied implementations. Additionally, the VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT flag is always set on 3D images when this extension is supported; it is needed for both sampled and storage images, not just storage images. Bug: b/274478146 Change-Id: Ibc210275e2d39ac0c54d1ae4c2451a5402360972 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544762 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev 73f9cf00 2023-03-31T00:00:00 GL: Implement polygon mode extensions * Implemented polygon mode extensions on the OpenGL backend * Supported capture and serialization of the new commands and state * Added PolygonModeTest end2end tests Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I3bc08546a02f110dd739950129bee25ccc507bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492683 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski 1810995c 2023-04-25T13:09:27 Capture/Replay: Initialize MEC alpha test state Fixes Street Fighter IV CE rendering issues when capturing. Test: angle_trace_tests --gtest_filter="*street_figher_iv_ce*" Bug: b/278606770 Change-Id: Ifb44c45b19514e4cabed1e81be99bce5706ac4d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4475732 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Geoff Lang c6ec59dc 2023-03-27T11:15:48 Explicitly pass the extended dirty bits to syncState. Add a the extended dirty bits and bit mask to syncState instead of calling gl::State::getAndResetExtendedDirtyBits when encountering DIRTY_BIT_EXTENDED. It disallowed us from masking the extended dirty bits and feels like an anti-pattern to modify the extended dirty bits in gl::State from the backend. This is a refactor only. Bug: chromium:1410191 Change-Id: I66fdec3eb57e3426cf0fda9ccb759700eafdda14 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374100 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev e809e7bd 2023-03-13T00:00:00 Reland "Implement EXT_depth_clamp" This is a reland of commit f8c1418319ac2aef4b3101e322005b1d0f73120f Host GPU bugs are observable in iOS Simulator Original change's description: > Implement EXT_depth_clamp > > * Added depthClamp to the RasterizerState > * Added DepthWriteTest end2end tests covering > both clipped and clamped depth writes > > Capture > * Updated serialized rasterizer state > * Updated CaptureMidExecutionSetup > > OpenGL > * Requires GL 3.2 or ARB_depth_clamp > on desktop contexts > * Maps to EXT_depth_clamp on ES > > D3D11 > * Maps to the opposite of > D3D11_RASTERIZER_DESC.DepthClipEnable > * The new tests uncover several edge cases where > a workaround is needed to implement unextended > OpenGL semantics on top of D3D > > Metal > * Maps to the setDepthClipMode command > > Bug: angleproject:8047 > Bug: angleproject:8077 > Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I8c5f8304276c97c51b2c3382cd2764592ee0c3fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4349938 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Yuxin Hu 4a77b0f5 2023-03-18T00:16:24 Revert "Implement EXT_depth_clamp" This reverts commit f8c1418319ac2aef4b3101e322005b1d0f73120f. Reason for revert: This change breaks angle_end2end_tests on Metal backend: https://ci.chromium.org/ui/p/chromium/builders/ci/ios-angle-intel/26035/overview Original change's description: > Implement EXT_depth_clamp > > * Added depthClamp to the RasterizerState > * Added DepthWriteTest end2end tests covering > both clipped and clamped depth writes > > Capture > * Updated serialized rasterizer state > * Updated CaptureMidExecutionSetup > > OpenGL > * Requires GL 3.2 or ARB_depth_clamp > on desktop contexts > * Maps to EXT_depth_clamp on ES > > D3D11 > * Maps to the opposite of > D3D11_RASTERIZER_DESC.DepthClipEnable > * The new tests uncover several edge cases where > a workaround is needed to implement unextended > OpenGL semantics on top of D3D > > Metal > * Maps to the setDepthClipMode command > > Bug: angleproject:8047 > Bug: angleproject:8077 > Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I829add68c006c72b7b4acf03aee3efa8a9a16fac No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4350876 Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev f8c14183 2023-03-13T00:00:00 Implement EXT_depth_clamp * Added depthClamp to the RasterizerState * Added DepthWriteTest end2end tests covering both clipped and clamped depth writes Capture * Updated serialized rasterizer state * Updated CaptureMidExecutionSetup OpenGL * Requires GL 3.2 or ARB_depth_clamp on desktop contexts * Maps to EXT_depth_clamp on ES D3D11 * Maps to the opposite of D3D11_RASTERIZER_DESC.DepthClipEnable * The new tests uncover several edge cases where a workaround is needed to implement unextended OpenGL semantics on top of D3D Metal * Maps to the setDepthClipMode command Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.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>
Cody Northrop 1148a662 2023-02-15T08:25:51 Update GL_ARM_shader_framebuffer_fetch token support These were missed during initial implementation because the target app doesn't use them, and there are no tests for vendor extensions. The implementation is basically a noop, but allows setting and querying state, unblocking apps. Also add a test that has basic usage. Test: FramebufferFetchES31.BasicTokenUsage_ARM Bug: b/269233744 Bug: angleproject:8025 Change-Id: Ic107150d4afd9c4c4984c58a1dafb1c18e608997 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4255965 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev ef0fe638 2023-01-16T00:00:00 Implement EXT_polygon_offset_clamp * Added polygonOffsetClamp to the RasterizerState * Adjusted State::setPolygonOffsetParams * Added PolygonOffsetClampTest end2end tests * Added StateChangeTestES3.PolygonOffsetClamp test * Suppressed the affected dEQP test as it has a bug Capture * Updated serialized rasterizer state * Updated CaptureMidExecutionSetup OpenGL * Rely on the EXT extension defined both for desktop and ES contexts * On desktops, might as well use the ARB extension or GL 4.6 once ANGLE supports them D3D11 * Requires FL10_0 or higher * Maps to D3D11_RASTERIZER_DESC.DepthBiasClamp * Drive-by cleanup of extensions init code Vulkan * Requires depthBiasClamp physical device feature * Maps to the depthBiasClamp parameter of the vkCmdSetDepthBias command Metal * Maps to the clamp parameter of the setDepthBias command Bug: angleproject:7957 Change-Id: If6b28df4084f0a81db29f75fb434e75d394c8730 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169945 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 8f1a7190 2022-12-23T00:00:00 Accept clip distance enums for simple queries State variables for which IsEnabled is listed as the query command can also be obtained using any of the simple queries. Bug: angleproject:4452 Change-Id: I075db600b772e5370c72c0f4de9b35e007259987 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4158331 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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>
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>
Gert Wollny 66fda678 2022-11-14T11:10:54 Capture/Replay: Delete buffer after test support for coherent The buffer created to test coherent and persistzent mapping is not used later, so it should be deleted. Since this buffer is created and deleted before any VAO is created, we also have to check whether a VAO exists before the buffer may be detached from it. Bug: angleproject:7814 Change-Id: I875f845e592325093dd90b48ba9cd3c7228fad47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4023047 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
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>
Chris Dalton 9bda9a79 2022-10-22T22:05:11 Add Store Ops to pixel local storage Browsers will need the ability to pre-empt pixel local storage, which means every plane will need a backing store to dump to. Store Ops allow the app to still avoid memory transactions at the end of PLS even if their plane has a backing texture. Bug: angleproject:7279 Change-Id: I3a3efa21773f87c03cd346a996e3c638028c68ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3974652 Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
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 9f693aa3 2022-10-22T14:45:59 Implement an allow list for PLS In order to guarantee no data is lost while using the EXT_shader_pixel_local_storage extension, we need to restrict applications to a small subset of commands while pixel local storage is active. This CL implements the allow list for GL entrypoints using wildcard matching inside the code generator, and adds custom validation for the more specific restrictions that go into effect when PLS is active. Bug: angleproject:7279 Change-Id: I5dd48bd93c10e8775f32be32a4fcf17855eb2f0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3932552 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Sean Risser 9b9d8032 2022-10-19T14:57:03 Avoid mExtensions for initializing mExtensions tracks the currently enabled extensions, while nativeExtensions tracks which extensions are available on a platform. This makes nativeExtensions more suitable for initializing data, as extensions may be disabled at initialization and enabled later. Bug: angleproject:7769 Change-Id: I9ee821a931045fc89091473f35e2b306ee653613 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965610 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Sean Risser <srisser@google.com>
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>
Chris Dalton b5514bb2 2022-09-21T20:47:00 Support pixel local storage on ES 3.0 Now that the application-facing API is implemented, we don't have to rely on ES 3.1 anymore. Expose and test the extension on ES 3.0. Bug: angleproject:7279 Change-Id: I5635620b9088201c20bafd283813092a329225d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915327 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Chris Dalton <chris@rive.app> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Chris Dalton 8b2aff28 2022-09-12T10:27:28 Implement the ANGLE_shader_pixel_local_storage API Implements the OpenGL ES API for ANGLE_shader_pixel_local_storage and adds thorough validation and testing as outlined in the spec. This feature is still implemented entirely in the frontend, but the extension now works end-to-end with a passing test suite, and can be used externally. Over time we can start gradually moving the implementation into backends as appropriate. Bug: angleproject:7279 Bug: angleproject:7647 Change-Id: I1c861a0fca96423be02e17bbe1fb7f57b99ea63f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3886462 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Shahbaz Youssefi 2796cbfd 2022-09-15T16:18:47 GLES1: Implement logic op through ANGLE_logic_op Bug: angleproject:7654 Change-Id: I88c784d87c1cb7cb7e5ccf8f020203553513bbb3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3899381 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 97926f80 2022-09-15T00:10:49 GL: Implement GL_ANGLE_logic_op Enabled only on Desktop GL where logic op is available. Bug: angleproject:7654 Change-Id: I3c17ffb5b21abf31aec247319a625526f1bec37d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3898316 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya d375547c 2022-08-12T15:54:39 Do not link program pipeline in glUseProgramStages 1. The commit 3a9f18f135fe82 caused a link to occur everytime glUseProgramStages is called. This is redundant since the program pipeline can be linked just before usage, thus allowing for multiple stages to be bound before linking the executable. 2. Mark PPO as a dirty object and link the PPO in dirty object handler 3. Early return if the same program is being bound to the same stage of the pipeline. 4. Added ProgramPipelineObjectBenchmark perf test that switches programs before a draw and observed following data - 1. vulkan profile - 1. wall_time before patch - 102000 ns 2. wall_time after patch - 38000 ns 2. vulkan_null profile - 1. wall_time before patch - 125000 ns 2. wall_time after patch - 52000 ns Bug: angleproject:5102 Bug: angleproject:6566 Test: ContextNoErrorPPOTest31.*Vulkan Test: ProgramPipelineTest31.*Vulkan Test: ProgramPipelineObjectBenchmark* Change-Id: Idbc2fcb4875bbd040e9ec847eb2a8f96f287173c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3830170 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Alexey Knyazev c517463a 2022-07-28T00:00:00 Add NoUnclampedBlendColor limitation Although ES 3.0 and ES 2.0 with floating-point color buffer extensions must support unclamped constant blend color, some drivers clamp it anyway. To let applications know the effective behavior, ANGLE state management has been expanded to simulate what the OpenGL ES driver is doing. So far, this bug has been confirmed only on Adreno GPUs. Unconditionally enabled this limitation on D3D9 as it cannot support unclamped blend color by design. Bug: angleproject:7536 Change-Id: I7e28a5553e79669d8482d48c6e79bdd811971ade Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3791350 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 925ec6b5 2022-07-07T00:00:00 Clamp viewport dimensions on store Bug: angleproject:7486 Bug: chromium:1130759 Change-Id: I6131baacc940b5df7e33ba10fca8e6e148cb8670 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3751056 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Geoff Lang 785353fd 2022-05-24T12:40:16 Support Desktop OpenGL context creation in end2end tests Validation of Desktop GL versions and profile masks is unimplemented. Bug: angleproject:7360 Change-Id: Ifae94215b6aada895c2b02318a1d05c9515e9b96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664916 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao b186991a 2022-05-26T11:50:56 Vulkan: Remove non-current vertex array from buffer's observer list When app binds a buffer to many VAOs, any buffer modification have to loop over all VAOs that uses that buffer, even though all these VAOs are not current except one VAO. That causes significant CPU overhead. black_desert_mobile has this type of usage. This CL checks number of observers on each binding and if there are excessive observers, it removes VAO from the buffer's observer list when it becomes non-current and adds back to observer list when it becomes current. This CL reduces CPU overhead of black_desert_mobile (as measured with --offset --minimumgpuwork) from 21ms to 3.69ms, on par with native GLES driver. Note that this CL only touches glBindVertexArrayObject call code path, so no impact to apps not using VAOs. There is also no measurable CPU time regression on a few other app traces that uses VAOs. Bug: angleproject:6371 Change-Id: I6b1589f3e3c768d56c1c95cebdb577e3e256737f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3669603 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Mohan Maiya 84a0b462 2022-05-20T15:51:11 Vulkan: Bug fix in GL_QCOM_shading_rate A default value of _1x1 for mShadingRate interacts badly with sample shading state on some vendors. Instead set the default to Undefined and return early in such cases. Bug: angleproject:7172 Change-Id: If0a280090e6611817d2f5d75929ef2b654ddb186 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3658245 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Mohan Maiya 2fdd7bfd 2022-05-17T13:31:58 Vulkan: Support binding 2D slice of a 3D texture to an image unit Support binding a 3d texture as a 2d texture by specifying that it is non-layered during glBindImageTexture and expose support for EGL_KHR_gl_texture_3D_image when VK_EXT_image_2d_view_of_3d vulkan extension is supported. Tests: ComputeShaderTest.BindImageTexture3D dEQP-GLES31.functional.image_load_store.3d.*single_layer Bug: angleproject:7320 Change-Id: Ie2f0dfcdf302a4aa58990f74329ca36e62cd3902 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648586 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 02b96848 2022-04-21T16:32:31 Vulkan: Add support for GL_QCOM_shading_rate Layer GL_QCOM_shading_rate over VK_KHR_fragment_shading_rate Test: ShadingRateQcomTest* Bug: angleproject:7172 Change-Id: I3f040dbfad3906facd4349937fed2ce9a464b824 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3599874 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Alexey Knyazev 62ca6449 2022-04-13T09:36:40 Reland "Fix BlendStateExt::mMaxColorMask initialization" This is a reland of commit 50d008a7efcab80f34eb742148d05389b2ed247e Besides fixing the BlendStateExt color mask initialization bug, the following changes were made: * All fields were made private with accessor functions. * A new assertion was added that ensures 64-bit storage for factors and equations. This allowed dropping one redundant mask. * Two new helper functions were added. * BlendStateExt::mMaxDrawBuffers was renamed to mDrawBufferCount. * The BlendStateExt class is now aligned to 8 bytes with an assertion. * Expanded test coverage. Also fixed incorrect usage of BlendStateExt fields in: * StateManagerGL::syncBlendFromNativeContext * StateManagerGL::restoreBlendNativeContext Original change's description: > Fix BlendStateExt::mMaxColorMask initialization > > This variable should not have its unused bits set. > > To avoid confusion with other masks of the same class, > the variable was renamed to mAllColorMask. > > Bug: angleproject:7200 > Change-Id: I72542d49ff8da3dbb8d61c5034ce37c1e8fcc6e1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3581990 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:7200 Change-Id: I87a5fe0f9dfbbf5e525b9120f772aa9adb39ce5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3593234 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Jamie Madill 4efc4ee6 2022-04-19T17:01:20 Fix validate state cache after XFB buffer deleted. Bug: chromium:1317650 Change-Id: Iec9f1167c3b2957091dd0f4ef3efcfcd7c4bf3c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3594250 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f4fc8e16 2022-04-20T04:32:48 Revert "Fix BlendStateExt::mMaxColorMask initialization" This reverts commit 50d008a7efcab80f34eb742148d05389b2ed247e. Reason for revert: Causes the win-trace bot to fail Original change's description: > Fix BlendStateExt::mMaxColorMask initialization > > This variable should not have its unused bits set. > > To avoid confusion with other masks of the same class, > the variable was renamed to mAllColorMask. > > Bug: angleproject:7200 > Change-Id: I72542d49ff8da3dbb8d61c5034ce37c1e8fcc6e1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3581990 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:7200 Change-Id: Ib9a0927ba4e152d5b4ae4c034e6748faf6b5aa87 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3594802 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 50d008a7 2022-04-13T09:36:40 Fix BlendStateExt::mMaxColorMask initialization This variable should not have its unused bits set. To avoid confusion with other masks of the same class, the variable was renamed to mAllColorMask. Bug: angleproject:7200 Change-Id: I72542d49ff8da3dbb8d61c5034ce37c1e8fcc6e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3581990 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Yuxin Hu cdd97fb8 2022-03-24T17:41:30 Reland "Vulkan: Fix invalid access with display texture share group." This is a reland of 1099b5ef2279cfe1988a39c8e011aada59c650f1. Original change's description: > Vulkan: Fix invalid access with display texture share group. > Create bufferpool that owns by RendererVk. > If we are using EGL_ANGLE_display_texture_share_group > extension, use the bufferpool owned RendererVk, > otherwise, use the bufferpool owned by EGL::ShareGroup. > The bufferpool lifetime will remain consistent with > texture lifetime. > Bug: chromium:1299211 > Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: chromium:1299211 Change-Id: I4b8f5bcb30297f2c5f24e02404fd96011f9d843b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3550038 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shrek Shao 73ec28af 2022-03-23T21:13:45 Revert "Vulkan: Fix invalid access with display texture share group." This reverts commit 1099b5ef2279cfe1988a39c8e011aada59c650f1. Reason for revert: suspect culprit of 1309304 Original change's description: > Vulkan: Fix invalid access with display texture share group. > > Create bufferpool that owns by RendererVk. > If we are using EGL_ANGLE_display_texture_share_group > extension, use the bufferpool owned RendererVk, > otherwise, use the bufferpool owned by EGL::ShareGroup. > The bufferpool lifetime will remain consistent with > texture lifetime. > > Bug: chromium:1299211 > Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: chromium:1299211, 1309304 Change-Id: Ibdc119ef6bb52352858114d72a0f1c0edcd4da5e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3546288 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shrek Shao <shrekshao@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuxin Hu 1099b5ef 2022-03-17T17:20:44 Vulkan: Fix invalid access with display texture share group. Create bufferpool that owns by RendererVk. If we are using EGL_ANGLE_display_texture_share_group extension, use the bufferpool owned RendererVk, otherwise, use the bufferpool owned by EGL::ShareGroup. The bufferpool lifetime will remain consistent with texture lifetime. Bug: chromium:1299211 Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill d9002eef 2022-03-01T16:14:47 Protect against deleting a current XFB buffer. Bug: chromium:1295411 Change-Id: I097f272c38e444e0af71aa55c0dc508a07aa0bd3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498262 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 29e25468 2022-01-07T07:02:53 Account for EGL 1.5 version when dealing with robustness EGL 1.5 spec allows for EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY and EGL_CONTEXT_OPENGL_ROBUST_ACCESS enums to be passed in to eglCreateContext. Update the validation layer and queries to account for the new enums. Bug: angleproject:6883 Tests: KHR-NoContext.es32.context_flags.*flag* Tests: KHR-NoContext.es32.robustness.*reset* Change-Id: I7088e0dca08cea2cfdcf1877b6d999c0e0336e5e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373133 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jamie Madill 4a2446c6 2021-10-19T11:55:17 Vulkan: Implement robust shader outputs. In this CL we change ANGLE to pass the mask of missing shader outputs down to pipeline creation. We then use the color mask bits to block SwiftShader writing to unused outputs. This fixes the undefined behaviour present in Genshin Impact. Note that the other GLES implementations we tested don't seem to modify outputs even if they're unused. It was easier to mask out the color attachments in initialize rather than set up the pipeline desc to mask out the attachments. This was because we manipulate the color mask in a fairly complex way before we initialize the pipeline desc. Bug: angleproject:6566 Change-Id: Ie659fcd511cd286fa573fd25e3e6a0b9e123ebd6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3232435 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 3a9f18f1 2021-10-18T10:44:38 Refactor program pipeline handling. In preparation for moving more code from gl::Program to gl::ProgramExecutable so it can be shared with ProgramPipeline. Bug: angleproject:6566 Change-Id: Icb7ecccb37ae8e0d7d5fef8968f0dd7ef6fe6150 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3226305 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Gert Wollny eee3936b 2021-10-12T20:08:27 libANGLE: Assert on mExecutable when syncing images In the loop in syncImagesInit mExecutable is dereferenced and mProgram is not even touched, so assert on mExecutable Bug: angleproject:6557 Change-Id: Icf482bda281c574e952113a97cbaf1e1d93fc1e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3220631 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 30878d2a 2021-09-24T09:23:56 Buffer: Notify contents changed in a separate observer list. Buffer contents changed will only notify VertexArray. Also this list is separated from the other observers because in the future most of the time we won't need to notify the VertexArrays when buffer contents changed, to avoid iterating over a large list of VertexArray observers on simple SubData calls. Bug: angleproject:6371 Change-Id: I6142a5757868caf33dc6594a1975f817f80553e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3182701 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 49ac15a5 2021-09-20T11:29:01 Optimize VAO bindings. This CL makes the XFB binding tracking WebGL-only. That will speed up VAO binding changes in non-WebGL considerably. Also has a few inline micro-optimizations that may not have a large effect. Bug: angleproject:6371 Change-Id: Ib0a26a3b956dcd6ff78626e5cd6514b46270d882 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3170116 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e84b0154 2021-09-13T16:04:20 Update extension boolean names. This is in preparation for auto-gen, which uses a simple naming scheme. This fixes the bool names to be totally consistent with the extension names. Bug: angleproject:6379 Change-Id: Ia212449be04accb0e4f006b55b1813ab4481fa0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3157417 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1ca1589f 2021-09-13T10:56:58 Give GLES extension bools a vendor suffix. This is in preparation for auto-generation which will give all of these bools suffixes. Bug: angleproject:6379 Change-Id: I7e3f6c9b644c41a2165e6bf7b62d661fd352a250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158503 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9ada074a 2021-09-10T16:18:19 Move capability values from gl::Extensions to gl::Caps. Several extensions stored extra information in the wrong structure. Move them to the Caps structure in prepraration for auto-generating the Extensions struct. Bug: angleproject:6379 Change-Id: If5643b72039e299cb0f7c49591d13b3c7cd8a36c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158403 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi df957576 2021-08-31T23:02:51 Avoid redundant blend state dirty bit setting This change no-ops a number of blend-related state setting functions when the state doesn't actually change given the parameters. Bug: angleproject:6298 Change-Id: I156e20685089aa71bd64eae560153e5def891d63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3133823 Reviewed-by: Sunny Sun <sunny.sun@arm.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b2238a3c 2021-08-16T08:23:00 Capture/Replay: MEC consistency improvements. Fixes a few very small bugs in MEC. The current program wasn't always captured correctly. Also texture bindings were not always left in the right state. Fixes this by tracking the currently bound GL state between the "shared" and "aux" MEC capture functions. Also updates the vertex array capture to detect when to use ES 2.0 semantics. ES 3.1 is left unimplemented as it was before. Bug: angleproject:5133 Change-Id: I5f03b8ffbdccec2664fda4698581b166a36fabdd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097809 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 7e040640 2021-08-16T08:43:17 libANGLE: Minor cleanups. Removes a couple duplicated cached members in gl::State. Also a few other small refactorings. Bug: angleproject:5133 Change-Id: I0c6cd4c6544ef1690a4ce95d40dac70c688c7092 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097808 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao 934ffac6 2021-08-05T15:43:32 Vulkan: Propagate BufferData changes to shader storage buffer binding This CL adds context to the observer list of shader storage buffer. When BufferData is called on the current bound shader storage buffer, context gets notified and DIRTY_BIT_SHADER_STORAGE_BUFFER_BINDING gets set. Bug: b/195678877 Change-Id: Id8a5266942e33f0a834d7c57fdde75f57e93d347 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076177 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao e28fb127 2021-08-05T14:32:16 Vulkan: Propagate BufferData changes to atomic counter binding This CL adds context to the observer list of atomic counter buffer so that it gets notified when BufferData is called on atomic counter buffer and set dirty bit accordingly. Bug: b/195678877 Change-Id: I924cf12ef54b5986d5c56b9e3b71584039490206 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076170 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Schade 217acac2 2021-07-21T12:42:56 Vulkan: Add support for EXT_primitive_bounding_box 1. Added support for EXT_primitive_bounding_box extension 2. Renamed shader variable gl_BoundingBoxEXT[] to ANGLEBoundingBox[] Bug: angleproject:3576 Test: dEQP-GLES31.functional.primitive_bounding_box.* Change-Id: I15fa9af50c6fd8e86d225670ddd8eb39f6e65d35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3053618 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d2b659f9 2021-03-25T15:40:58 EGL: implement EGL_EXT_protected_content Context Add Validation check to Contexts and Surfaces Add Vulkan protected memory features and properties Add protected member to Surfaces and Contexts Implement hasProtectedContent in Vulkan Add QueueFamily helper, extent DeviceQueueMap Protected Swapchains always on for Android Add EGLProtectedContentTest Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lubosz Sarnecki 4901ac64 2021-05-06T15:15:57 FrameCapture: Capture GLES1 specific states. Implement capturing GLES1 specific state by checking the difference to the default state using getEnableFeature. When getEnableFeature is called from a context version higher than 1 and a GLES1 state is requested, an assertion is hit. Therefore the context version needs to be determined before calling getEnableFeature. Use the available isTextureTargetEnabled function to determine GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP states in getEnableFeature. Return false in isTextureTargetEnabled when mTextUnitEnables is empty, so the vector is not accessed when not initialized, which was the case for a default state. Bug: angleproject:5893 Change-Id: I66ee41c3bf7a8e1f04a8a4ce0461fddc16f9a013 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2877237 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Tim Van Patten 0261b1d3 2021-03-31T10:48:08 PPO: Fix updating sampler uniforms between draws Updating sampler uniforms when using PPOs is currently broken, since the Context/State use the currently bound ProgramExecutable which belongs to the PPO, but the updates only happen to the Program's executable that the uniform belongs to. This change updates Program::updateSamplerUniform() to update any PPO ProgramExecutables with the updated texture information when a Program's sampler uniforms are updated, so the Context/State use the correct data. Bug: b/182409935 Test: ProgramPipelineTest31.SampleTextureAThenTextureB Test: SamplersTest31.SampleTextureAThenTextureB Change-Id: I3c4e156c6e0c781e706f321f0bd12baf484ff42a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2797951 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 716b2cba 2021-03-12T14:46:53 Use bitset masks for active shader buffers. This switches the tracking for the uniform, shader storage, and atomic counter buffers to use bitset masks to determine where there are active buffers. This will make iterating these buffer sets faster. Also renames the limit for atomic counter buffers to be consistent with the other buffer types. Also applies the implementation limit to atomic counter buffer bindings. This fixes out-of-bounds access on some Linux platforms that expose a large number of bindings. Bug: angleproject:5736 Change-Id: Ice801645697592d1dda6aebf0cb69767594cc0c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2757509 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya 81dcf078 2021-03-08T11:21:31 Reland "Vulkan: Support EXT_sRGB_write_control" This is a reland of 6073af536cf627742696823edc82c9b0a481a8bc with 2 changes - 1. Don't enable the extension even in nonConformant mode 2. Don't enable VK_KHR_image_format_list for swiftshader Original change's description: > Vulkan: Support EXT_sRGB_write_control > > Implement support for EXT_sRGB_write_control. This extension > requires VK_KHR_image_format_list to be supported. > > The spec requires this functionality to work with glBlitFramebuffer > as well but support for that will be added in a follow up change. > As such, this extension is only exposed in non-conformant mode. > > Bug: angleproject:5075 > Tests: SRGBFramebufferTest.*Vulkan* > Change-Id: I59b38f6cd810a3d0d67ec29f4f19c25f65f70862 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617243 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:5075 Change-Id: I8e149d196a39c3c4769bfa8690792f3c53831299 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2762647 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Peng Huang b27740f3 2021-03-09T16:15:15 Revert "Vulkan: Support EXT_sRGB_write_control" This reverts commit 6073af536cf627742696823edc82c9b0a481a8bc. Reason for revert: crbug.com/1186140 Original change's description: > Vulkan: Support EXT_sRGB_write_control > > Implement support for EXT_sRGB_write_control. This extension > requires VK_KHR_image_format_list to be supported. > > The spec requires this functionality to work with glBlitFramebuffer > as well but support for that will be added in a follow up change. > As such, this extension is only exposed in non-conformant mode. > > Bug: angleproject:5075 > Tests: SRGBFramebufferTest.*Vulkan* > Change-Id: I59b38f6cd810a3d0d67ec29f4f19c25f65f70862 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617243 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:5075,chromium:1186140 Change-Id: Ib0d4d60fe7434fb950f99db2c210aab9af7d2d0e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743663 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Peng Huang <penghuang@chromium.org>
Mohan Maiya 6073af53 2021-03-08T11:21:31 Vulkan: Support EXT_sRGB_write_control Implement support for EXT_sRGB_write_control. This extension requires VK_KHR_image_format_list to be supported. The spec requires this functionality to work with glBlitFramebuffer as well but support for that will be added in a follow up change. As such, this extension is only exposed in non-conformant mode. Bug: angleproject:5075 Tests: SRGBFramebufferTest.*Vulkan* Change-Id: I59b38f6cd810a3d0d67ec29f4f19c25f65f70862 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617243 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya f6784006 2021-02-08T16:39:04 Modify data type of ActiveTextureMask and ImageUnitMask ActiveTextureMask and ImageUnitMask need more than 64bits. We can now use the BitSetArray datatype and avoid the perf penalty of using std::bitset Bug: angleproject:3877 Tests: angle_perftests.exe --gtest_filter=TexturesBenchmark* Change-Id: Ic82e09d1aa2c1904d06ad48ba6200f35896665ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2664734 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya f1cbcaba 2021-02-07T13:37:49 Use const reference when possible When retrieving BitSet masks return a const reference of the mask to avoid invoking the copy-constructor. Bug: angleproject:3877 Change-Id: I9f724a4864f3db17aa6f1ab74b81053c65313764 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2681767 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Mohan Maiya 54242b8f 2021-02-04T12:20:57 Vulkan: Leverage ExtendedDirtyBitType Expand ExtendedDirtyBitType to include bit for clip distance, mipmap generation hint and shader derivative hint. Handle these dirty bits in ContextVk::syncState Bug: angleproject:5611 Change-Id: If8d1646334e737f81ac72cdddb8fe3ba613b4b94 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2676173 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 89f50584 2021-02-03T08:51:04 Vulkan: Add ExtendedDirtyBitType bitset ExtendedDirtyBitType qualifies DIRTY_BIT_EXTENDED dirtybit. Clip control code path can now set the appropriate ExtendedDirtyBitType when there is a change in state. Also remove the ClipSpaceOrigin member in the Vulkan backend that cached front-end state. Bug: angleproject:5471 Tests: dEQP-GLES2.functional.clip_control.* Change-Id: I8dbb509ef940e7905439d32483fd67a8fc171a6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2673062 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Mohan Maiya 80a4223e 2021-01-28T17:51:31 Vulkan: Handle changes to viewport when clip origin is modified The expected view port is different from current viewport translation when the clip origin is the upper left. So now, it has four different view port translations based on clip origin and y-flip of framebuffer. - add query and state management for EXT_clip_control - add dirty bit for clip control - change viewport, scissor and cull face when clip origin changes Bug: angleproject:5471 Tests: dEQP-GLES2.functional.clip_control.* Change-Id: I78dc752c3287b09f25496034e0d0d2724138010c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615863 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 4921e457 2021-01-22T22:36:13 Vulkan: Avoid unnecessary pipeline rebinds Bug: angleproject:5528 Change-Id: I5502498fa5d6767f55635fe9fff949d7fd644f4f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2645640 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b912eec5 2020-11-27T11:08:41 Vulkan: Support GL_EXT_tessellation_shader. Shader translator changes done in http://crrev.com/c/2633936 Adds a new DIRTY_BIT_PATCH_VERTICES state to Context. Supportes state query and transform feedback. 4 test suppressions remain as follow-up fixes. Adds a new varying packing mode for a simple Vulkan rule set. Based on work by Mohan Maiya (m.maiya@samsung.com). Test: dEQP-GLES31.functional.tessellation.* Bug: angleproject:3572 Change-Id: I4cad2cca30adb754fd12c83027673906541f566a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568234 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 043fcf18 2021-01-07T13:23:57 Support create ANGLE EGLContext from an external EGLContext For Android WebView, Android creates an EGLContext, EGLSurface and FBO, and makeCurrent on them, and then calls WebView draw function to draw the WebView content on the current EGLSurface or binded FBO. So to use ANGLE in WebView, this CL adds a way to create ANGLE EGLContext from an external EGLContext, and save and restore GL state in eglMakeCurrent(). Bug: angleproject:5509 Change-Id: I874986813117f125e23e975ea1adc51ac5b3a631 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615239 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill fbaae6ce 2020-07-24T11:47:12 GL: Add support for GL_OES/EXT_texture_buffer This extension is core in 3.2 Based on a CL by Jonah Ryan-Davis. Bug: angleproject:3573 Bug: angleproject:4933 Change-Id: Ib5ce038414075a5cdce36e9404e25d7af33fb39c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 39b777c6 2020-10-29T16:55:06 Capture/Replay: Two cleanups. This changes from returning a vector to directly returning a pointer to the binary data for the serialized state. The second cleanup is to use a ContextID as a wrapped type which simplifies the output formatting code. Bug: angleproject:5247 Change-Id: Ieb8afdb9326a12968dd2d69c05e1ed811b93abff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2506198 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 5c1d21a1 2020-10-28T10:14:21 Vulkan: App-compat for apps that disable validation & don't link As seen on Android, when PUBG MOBILE rebuilds all of its shaders, it: - Disables validation - Tries to link two shaders that can't be linked - Calls glUseProgram() for the un-linked program - Never uses the program Because validation was disabled, the appropriate error isn't produced and ANGLE ASSERT's in the post-validation code. For application-compatibility, this case is recognized and avoided. Bug: b/168839960 Change-Id: I521785c741d57d6c228bb60c81abe638d95e8d2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505547 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cody Northrop 8f57f60f 2020-10-08T22:38:25 Add ES 3.1 check to ValidateBindImageTexture This fixes a crash that occured in the Lego trace when run with an ES 3.0 context. * At the end of each frame it unbinds all the image units using glBindImageTexture, which is an ES 3.1 call. * During validation, we verify things using ANGLE's internals, but they are only set up when the context is >= ES 3.1. * This led to a crash. * The fix is to check the ES context early and bail, which aligns with other entry points. Test: LEGO MEC Bug: b/161716126 Bug: angleproject:4048 Change-Id: I9aee2ee173436f5de5062758a70e0909f6fc9a7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2462163 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Mohan Maiya 7bbe497a 2020-10-16T14:46:45 Vulkan: Implement EXT_texture_sRGB_decode Implement EXT_texture_sRGB_decode. This builds on the existing functionality from EXT_texture_sRGB_override, with 2 major edge cases: 1. sRGB_decode allows the texture state to be overridden by sampler state, which is implemented by forcing a a texture state sync during updateActiveTextures if a texture is bound to the same unit as a sampler with that state 2. texelFetch calls require us to reenable decoding, regardless of decode state. We add a new compiler pass (FlagSamplersWithTexelFetch) to mark samplers that are used with texelFetch in order to support this. This change also re-enables EXT_texture_sRGB_R8, which was disabled due to a dEQP bug that this change will bypass. Bug: angleproject:3609 Bug: angleproject:4503 Test: dEQP.GLES31/functional_srgb_texture_decode_skip_decode_* Test: GLES31/functional_state_query_texture_*_srgb_decode_* Test: GLES31/functional_state_query_sampler_*_srgb_decode_* Test: GLES31/functional_debug_negative_coverage_*_srgb_decode_* Test: GLES31/functional_android_extension_pack_extensions_ext_texture_srgb_decode Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan* Change-Id: I4a67e487dc82e2f57c8c87d4bcd8ef442b6fe220 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2359481 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Alexey Knyazev 0f55e3e5 2020-09-11T01:15:18 Reland "Remove redundant BlendStateArray tracking" Rebase the original CL and update capture/replay state serialization Original CL reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2169093 Bug: angleproject:4394 Bug: chromium:1085996 Bug: chromium:1086582 Bug: chromium:1086585 Bug: chromium:1086586 Change-Id: If0fba8b6e185540aed57d22eaf0ff79ec142209e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404442 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 9f5eb0b8 2020-10-05T08:18:05 Vulkan: Add OES_sample_shading extension support Support OES_sample_shading extension if the underlying Vulkan ICD supports sampleRateShading. Bug: angleproject:3587 Tests: dEQP-GLES31.functional.sample_shading.* Change-Id: I1b324c1ad3ea3b2157d3cbe0abcdf7085aa4231b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444213 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 001c7e8c 2020-09-21T13:25:46 Vulkan: Link PPO during draw validation From the OpenGL ES 3.1 spec: 11.1.3.11 Validation It is not always possible to determine at link time if a program object can execute successfully, given that LinkProgram can not know the state of the remainder of the pipeline. Therefore validation is done when the first rendering command which triggers shader invocations is issued, to determine if the set of active program objects can be executed. For draws, this CL moves the PPO link operation to ValidateDrawStates() to generate PPO link failures within ANGLE's validation layer, so we fail any rendering commands during command validation. For dispatch, PPOs are linked during Context::prepareForDispatch(), where the PPO is converted from draw to compute, since that conversion requires a re-link. This re-link shouldn't fail due to errors that would have been caught during validation, since the compute shader must have successfully linked before it can be included in the PPO in the first place. We don't re-link when converting back to draw, since it's possible there are validation errors (which we want to catch during validation of the next rendering command). Bug: angleproject:5064 Test: dEQP.GLES31/functional_separate_shader_validation_es31_* Test: ContextNoErrorTest31.DrawWithPPO Test: ProgramPipelineTest31.VerifyPpoLinkErrorSignalledCorrectly Change-Id: Ibb249e893c007a83cc6b813f848a660bfa34ecb0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2422375 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Mohan Maiya 41c93c55 2020-09-01T11:34:32 Vulkan: Bug fix in atomic counter buffer count calculation When binding a new atomic counter buffer to a slot it is necessary to take into account the previous binding of that slot. This rectifies a bug introduced in f7b607c63c Bug: angleproject:3566 Test: angle_unittests.exe --gtest_filter=AtomicCounterBufferTest31.AtomicCounterBuffer* Change-Id: If78954d27c3345e8620294a84e839058d7dd7b9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2388431 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya f7b607c6 2020-08-29T16:34:30 Vulkan: Optimize atomic counter buffer offset calculations Call writeAtomicCounterBufferDriverUniformOffsets method only if there are valid atomic counter buffers Bug: angleproject:3566 Change-Id: I03c3fd2095e30381597bfc66acae0ccbf828d401 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2383787 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 4f7edbe1 2020-06-03T14:51:50 State: Add dirty object for active textures. Checking sampler completeness after every sampler related state change is inefficient. Defer sampler completeness check to draw time. Based on a CL by hckim.kim@samsung.com. Bug: angleproject:4765 Tests: angle_perftests.exe --gtest_filter=TexturesBenchmark.* Change-Id: I7e971371e40b3044ca3d5ca39bfe7fc600620c3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2268577 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ea3f501e 2020-08-18T11:13:33 Feedback Loop Redesign 3/3: Remove feedback loop tracking. We now we detect feedback loops by tracking the Framebuffers that the Texture is bound to. We still have the old tracking method that counts sampler and image bindings in the code as well. This CL removes the old front-end tracking for feedback loops. It's no longer used by any back-ends. This removal should reduce CPU overhead around Texture and Program binding changes. Reverts the image binding tracking to the simpler scheme that tracks if a Texture has ever been bound as an Image. This should practically have little or no perf effect and we can reinstate some simpler tracking in the future if required. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: Idc625d6e4c519919f97a4dc72dd9c35d262706fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363210 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Tim Van Patten 48ba75ac 2020-08-06T15:26:53 Remove TextureCommand TextureCommand::GenerateMipmap can be moved into gl::Command allowing us to remove TextureCommand. Bug: angleproject:4753 Test: CQ Change-Id: Idc546df519e199ffd3a8b8e03b9868cd9152e9ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2338823 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Tim Van Patten 81370214 2020-07-29T12:54:02 Pass the Command when sync'ing dirty objects A new enum is being created that contains command types, which are then passed to each dirty object when they are synced. This allows the syncState() methods to perform special handling for each command type. This change is in preparation for optimizing resolving multisample images with glBlit, since the render pass needs to be updated before it's ended. Bug: angleproject:4753 Change-Id: I77701f79418d35cff689e864c8a8b47b6fca0255 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2327335 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 4cf2501c 2020-07-27T13:19:27 Add extension EGL_ANGLE_display_semaphore_share_group For sharing semaphores globally. Bug: angleproject:4877 Change-Id: I472e0902fd04ca8350d74e6c0ae6925ee930ccf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2319370 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 80d7725d 2020-07-15T15:14:17 Use Subject/Observer pattern for Programs/Executables in PPOs This CL updates the frontend to use the subject/observer pattern for Programs and ProgramExecutables in PPOs. This allows us to remove the hack that iterated through all PPOs and marking them all dirty when a Program is re-linked. Instead, just the PPOs the Program is bound to are signalled, and only when the Program is in a PPO. Additionally the necessary PPOs are signalled when an Executable's textures are updated, rather than iterating through all PPOs and signalling them. Bug: angleproject:4559 Test: CQ Change-Id: Iaefb88c64c13259e921c8dfe95cf640247d17f85 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300705 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Tim Van Patten e0a2bd5e 2020-07-15T18:07:45 Remove ProgramPipelineState::mHasBeenBound The member ProgramPipelineState::mHasBeenBound is unused and should be removed. Bug: angleproject:3570 Test: CQ Change-Id: Idc41574f79e665ac36bef5b206704c667c49dadb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2301101 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi cf63d872 2020-07-02T09:59:58 Vulkan: Use mipmap hint when generating mipmaps If the application asks for GL_FASTEST, this uses VK_FILTER_NEAREST instead of VK_FILTER_LINEAR. Bug: angleproject:4551 Change-Id: I6c10758104bd63dd477ea853a3b0464665f371ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2279132 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b772a955 2020-06-16T23:32:47 Vulkan: Make texture syncState aware of upcoming generateMipmap By letting TextureVk::syncState know it's being called for generateMipmap, it can make a better decision to initialize the image: - Staged updates to mips that are going to be overwritten are dropped - The image is created with full mipchain to avoid a redefine in the following generateMipmap() call. Bug: angleproject:4551 Change-Id: Ic70ee6c0a0b29c7bd62beaff612b2f2d5276defb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2249340 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang ec010006 2020-06-15T16:36:05 Revert "Remove redundant BlendStateArray tracking" This reverts commit c746ac65e9d64aa74065ee30d7e7e810088c429c. Reason for revert: Possible performance regression BUG=chromium:1085996 Original change's description: > Remove redundant BlendStateArray tracking > > Keep legacy BlendState for now. > > Bug: angleproject:4394 > Change-Id: Icba2b2f3a071d0f838a5480ff94869d35b776d94 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2169093 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Kenneth Russell <kbr@chromium.org> TBR=geofflang@chromium.org,kbr@chromium.org,jonahr@google.com,jmadill@chromium.org,lexa.knyazev@gmail.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4394 Change-Id: Id05b382e951a7256805cffe696325b6b6d940e96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246719 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten c39d25ae 2020-06-01T12:42:33 Update State to check mExecutable A user may be using Program Pipelines, rather than monolithic Programs, so State should check if mExecutable is valid, rather than mProgram, since that indicates the presence of either a PPO or a Program. Exercising these paths requires additional tests: SimpleStateChangeTestComputeES31PPO::DeleteImageTextureInUse() Texture2DTestES31PPO::TexStorage() Texture2DTestES31PPO::SingleTextureMultipleSamplers() These new tests exposed bugs in the PPO implementation where updates to the active Program's ProgramExecutable were not being propagated to the Executables of the PPO's containing that Program. In these particular cases, updates to the active samplers/images/textures were not being copied to the PPO's Executable. Bug: angleproject:3570 Test: end2end tests listed above Change-Id: I297cac2d0367f180dd7fa01a1ee7ba53996867c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2225417 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 29bb612e 2020-05-28T10:32:26 Add egl::ShareGroup class to abstract the share context group Vulkan backend has a barrier tracker that tracks memory barrier needs of all shared resources. Because the buffer/texture objects are shared resources within a shared group, the tracker can not live in a context. Putting it in a device/renderer requires locks. It fits perfectly in a shareGroup object. The work is already done at API level to handle the mutex lock for shared context access so that no extra lock needs to be taken in the backend. This CL adds egl::ShareGroup class that represents the object that are shared among all share context group. At the front end this usually will include all the shared resource managers (not done in this CL). The ShareGroup object is accessible from gl::State object. This CL also adds ability for backend driver to allocate implementation specific ShareGroupImpl object. Vulkan backend will then use it to keeps the barrier tracker and other things that naturally fits the share group concept. Bug: angleproject:4664 Change-Id: Ifcd975cbdf5130022e21c41397894afc28f572e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2217252 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Jonah Ryan-Davis 7fde3673 2020-05-25T15:48:06 GL: Support GL_OES_texture_cube_map_array in frontend/GL backend GL_OES_texture_cube_map_array is core in 3.2. This CL adds the necessary validation for the frontend, as well as support for this extension on the GL backend. The next step is to add the changes to the translator. Bug: angleproject:3584 Change-Id: I751a9c9f71a553b05fdf6673250290806d8cfbff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2215306 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Alexey Knyazev c746ac65 2020-04-27T03:55:20 Remove redundant BlendStateArray tracking Keep legacy BlendState for now. Bug: angleproject:4394 Change-Id: Icba2b2f3a071d0f838a5480ff94869d35b776d94 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2169093 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Antonio Maiorano 4f343f3e 2020-05-13T14:11:51 Reland "Add support for GL_CHROMIUM_texture_filtering" This is a reland of 38780ae3921d2570316119a881adfb9520e7e296 modulo the changes to disable VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, as this was causing problems. With this landed, the extension will not work on SwiftShader until we find a way to allow this extension through the validation layers. Bug: b/146423360 Bug: b/154620295 Change-Id: Ie09fc507c01a47be3bb227bc78771660170ba5d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2199639 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten d34ab323 2020-05-04T10:48:48 Vulkan: Save linked ProgramExecutable data PPOs need to support drawing with Programs that failed their last linkProgram() if they had previously successfully linked. This requires saving the ProgramExecutable when linkProgram() succeeds, and not overwriting it with subsequent linkProgram() calls unil the next successful one. To achieve this, the new member ProgramState::mLinkedExecutable will point to the last successfully linked ProgramExecutable and ProgramState::mExecutable will point to a new ProgramExecutable when the next linkProgram() is attempted. If the link fails, the newly allocated ProgramExecutable will be delete()'ed and mExecutable will point to the previous 'good' ProgramExecutable still being tracked by mLinkedExecutable. If it succeeds, the old mLinkedExecutable will be delete()'ed and mLinkedExecutable will be updated to point to the ne one. Bug: angleproject:4514 Test: KHR-GLES31.core.sepshaderobjs.StateInteraction Change-Id: I0677602a6d652a055404667ec9e9305fed5b4177 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2181450 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>