src/libANGLE/Framebuffer.cpp


Log

Author Commit Date CI Message
Tom Sepez 25390156 2025-08-21T00:13:19 Suppress unsafe buffers on a file-by-file basis in src/ [1 of N] In this CL, we suppress many files but stop short of actually enabling the warning by not removing the line from the unsafe_buffers_paths.txt file. That will happen in a follow-on CL, along with resolving any stragglers missed here. This is mostly a manual change so as to familiarize myself with the kinds of issues faced by the Angle codebase when applying buffer safety warnings. -- Re-generate affected hashes. -- Clang-format applied to all changed files. -- Add a few missing .reserve() calls to vectors as noticed. -- Fix some mismatches between file names and header comments. -- Be more consistent with header comment format (blank lines and trailing //-only lines when a filename comment adjoins license boilerplate). Bug: b/436880895 Change-Id: I3bde5cc2059acbe8345057289214f1a26f1c34aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6869022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mavis Deng 65091427 2025-06-05T14:08:01 Query draw buffer should return NONE for no surface default FB When querying the draw buffer state via glGetIntegerv(GL_DRAW_BUFFER) on the default framebuffer with no surface bound, GL_NONE should be returned. Bug: angleproject:422631118 Change-Id: Iad2f1662692b0a92563e4cfd7fe09437cb40f0c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6619453 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Mavis Deng <mavis.deng@arm.com> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 937cf23c 2025-05-13T16:11:47 Vulkan: Remove VertexArrayBufferContentsObservers When vertex array needs to convert buffer's data, right now it uses Subject/Observer to subscribe notifications from buffers about the data change. Since we always dirty all binding point when we bind VertexArray, or app has to rebind buffer to vertex array if its on the other context, this notification really is only needed for the current context's vertex array. In prior CLs we already moved notification from buffer to the current context's vertex array away from Subject/Observer usage pattern. This CL did similar things to VertexArrayBufferContentsObservers::mContentsObservers. VertexArrayBufferContentsObservers has been deleted in this CL. Each VertexArrayImpl now tracks the need of content observer with a bit mask of each bindingIndex (which is tracked by mContentsObserverBindingsMask). When a buffer's content changes, gl::Buffer will retrieve this bit mask from backend and pass it to the current gl::Context, which sends to current VertexArray object, which then set proper DATA dirty bits on VertexArray based on the binding bit mask. If back end think it does not need any data conversion, then the bit mask is zero and nothing will be done. This further removes dependence on subject observer, which enables us to avoid taking shared context lock for glEnableVertexAttribArray and glDisableVertexAttribArray. Bug: angleproject:400711938 Change-Id: Ieb0c09c042a560dd121242b63ec24478482399b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6549157 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 9812b972 2025-03-05T16:25:45 PLS: Validate rendering feedback loops of PLS planes Validate that active textures are not bound as PLS planes in WebGL compatibility mode using the same validation as for regular framebuffer attachments. Update the PLS spec to not generate an error for feedback loops but update the definition of feedback loops to include PLS planes. The WebGL spec is dependent on this definition and makes this feedback loop an error. Bug: angleproject:40096838 Change-Id: I597efef3685da7bfb2a9d149a9ec3bc9d01e6e4d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6330519 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Chris Dalton <chris@rive.app>
Aurora Zhang ef61ff8d 2025-04-24T16:18:34 Improve the judgement of texture and attachment completeness When the GL_TEXTURE_MIN_FILTER is not mipmap, that is GL_LINEAR or GL_NEAREST, ANGLE should allow the texture's base level greater than the max level. The spec does not consider this situation as texture incomplete. Also, attachment completeness should ignore mipmap completeness when selected level is the base level. Hence, increase a constriction in CheckAttachmentCompleteness and end2end test Texture2DBaseMaxTestES3.Fuzz545ImmutableTexRenderFeedback. Bug: angleproject:42267266 Change-Id: I6a41f7d0716a7c9506b82390e2c0b083ab1626a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6197735 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Auto-Submit: Aurora Zhang <Aurora.Zhang@arm.com>
Alexey Knyazev 4b9525b2 2025-04-04T00:00:00 Remove all getClientMajorVersion helpers Client version checks should use proper struct compare operations. Bug: angleproject:408843436 Change-Id: I92cd91d1e7e6daa761f79060835aa534c5671264 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6467460 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao ecc378cc 2025-03-03T16:43:33 Reland "Dont use Subject/Observer for SwapchainImageChanged" This is reland of the following CL https://chromium-review.googlesource.com/c/angle/angle/+/6319893 Because we do deferred ANI (VkAcquireNextImage) call until image is needed, we need a way to force Context to go through FramebufferVk::syncState call (FramebufferVk::syncState calls WindowSurfaceVk::getAttachmentRenderTarget, which end up calling ANI. Right now we uses subject/observer mechanism, by sending angle::SubjectMessage::SwapchainImageChanged to all observers of WindowSurfaceVk. In this case it is egl::Surface. Then eglSurface redirects this message to its observers, which are all gl::Framebuffer's attachments: color, depth, stencil. Even though only color attachment needs to be notified, but because we don't have a separate list of observers, depth/stencil attachment also receive the notification and they early out. Then gl::Framebuffer sets DIRTY_BIT_COLOR_BUFFER_CONTENTS_0 dirty bit and send the angle::SubjectMessage::DirtyBitsFlagged to Context, which dirty DrawFBO and ReadFBO and dirty cached state. Note that this is specific for swap image changed case, there is no surface property change (surface property change will still trigger the subject/observer message with SubjectMessage::SubjectChanged message, but this occurs rarely). This gets worse for apps that uses multiple contexts, for the example pokemon_masters_ex has three contexts, each context has its own default frame buffer that attach to the same surface, and we never remove non-current context from the observer list. This end up with egl::Surface has 12 observers and for every frame, it loop over the list of 12 observers and send message (virtual function call) to each of them. Color attachment also ends up sending two messages to Context, one for Read FBO and another for Draw FBO. There are total 21 virtual function calls. Even for single context usage, you have 6 virtual function calls, for every frame. EGL spec says "an EGLSurface must be current on only one thread at a time", any other context must call EGLMakeCurrent in order to use this surface, which will add all necessary dirty bits at that time. So we really only need to notify current context. In this CL, SwapchainImageChanged no longer uses subject/observer mechanism, so this message is removed. This CL still uses subject/observer mechanism to send DirtyBitsFlagged from Framebuffer back to context. We could call setDrawFramebufferDirty and setReadFramebufferDirty directly, but that will require to remove the "const" decoration out of gl::Context which generates too much code diff, so onStateChange(angle::SubjectMessage::DirtyBitsFlagged) is still used. Bug: angleproject:400711938 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6319893 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Change-Id: I017b0e8934b5194a520828fa5c4af1d6e3ef9aac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6404621
Igor Nazarov e44357c6 2025-03-25T15:50:15 Vulkan: Do not defer ANI in shared present mode Calling ANI in shared present mode is not necessary after the initial acquire. Skip calling `deferAcquireNextImage()` in that mode. For code simplicity and as a preparation for (anglebug.com/400711938), the `invalidateSwapchain()` method is now also defers ANI and notifies `SubjectMessage::SurfaceChanged` to the parent class. `Framebuffer` message handling was updated to also reset color buffer dirty bit and to notify `SubjectMessage::DirtyBitsFlagged` if needed, as in the `SubjectMessage::SwapchainImageChanged` message case (which will be removed in future CL). This way, single `SubjectMessage::SurfaceChanged` message is enough to handle swapchain recreate. The `VK_SUBOPTIMAL_KHR` is no longer treaded as OUT_OF_DATE when in shared present mode. Added for consistency (since we are already skipping "perFrameWindowSizeQuery" checks), to preserve content, and to match the Android native GLES driver behavior. Call `invalidateSwapchain()` when swapchain operations fail to avoid repeated swapchain use and to be able to recover from the error. The `checkForOutOfDateSwapchain()` was split into two methods: - checkForOutOfDateSwapchain(): - Called only after present. - Checks present out of date result and present mode compatibility. - Invalidates the swapchain and updates the present mode if the above checks fails. - prepareSwapchainForAcquireNextImage(): - Calls `queryAndAdjustSurfaceCaps()` and `recreateSwapchain()` if swapchain is invalid. - Calls `queryAndAdjustSurfaceCaps()` and checks surface properties when "perFrameWindowSizeQuery" is enabled. Then calls `recreateSwapchain()` if something changed. Other changes: - The `prepareForAcquireNextSwapchainImage()` method was replaced with `prepareSwapchainForAcquireNextImage()`. - Removed `doDeferredAcquireNextImageWithUsableSwapchain()` and `postProcessUnlockedAcquire()` methods because of redundancy. - Move image invalidation code into `acquireNextSwapchainImage()` to make `doDeferredAcquireNextImage()` simpler. - Convert `resizeSwapchainImages()` into `createSwapchainImages()` for simplicity. Updated old and added new tests. Test: angle_end2end_tests --gtest_filter=EGLSurfaceTest.ReadFramebufferBindingSyncState/* Test: angle_end2end_tests --gtest_filter=EGLSingleBufferTest.OnCreateWindowSurface/* Test: angle_end2end_tests --gtest_filter=EGLSingleBufferTest.OnSetSurfaceAttrib/* Test: angle_end2end_tests --gtest_filter=EGLSingleBufferTest.WindowResize/* Test: angle_end2end_tests --gtest_filter=EGLSingleBufferTest.WindowRotation/* Bug: angleproject:400711938 Bug: angleproject:397848903 Bug: angleproject:42262606 Change-Id: I2247417aa8b7b5afc10a8420083aeb845895aec9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6387920 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Yuly Novikov 3cfc0ce2 2025-03-24T07:41:33 Revert "Vulkan:Dont use Subject/Observer for SwapchainImageChanged" This reverts commit 48103cb2f2b292cb50cc5a29546b358b2e47fd29. Reason for revert: assert fails https://ci.chromium.org/ui/p/angle/builders/ci/android-arm64-exp-test/7085/overview I 22:27:33.697 77.533s _RunTestsOnDevice(17221FDF6000A4) [ RUN ] EGLAndroidAutoRefreshTest.SwapCPUThrottling/ES3_Vulkan_NoFixture INFO:root:ERR: SurfaceVk.cpp:3165 (getCurrentFramebuffer): ! Assert failed in getCurrentFramebuffer (../../src/libANGLE/renderer/vulkan/SurfaceVk.cpp:3165): mAcquireOperation.state == ImageAcquireState::Ready Original change's description: > Vulkan:Dont use Subject/Observer for SwapchainImageChanged > > Because we do deferred ANI (VkAcquireNextImage) call until image is > needed, we need a way to force Context to go through > FramebufferVk::syncState call (FramebufferVk::syncState calls > WindowSurfaceVk::getAttachmentRenderTarget, which end up calling ANI. > Right now we uses subject/observer mechanism, by sending > angle::SubjectMessage::SwapchainImageChanged to all observers of > WindowSurfaceVk. In this case it is egl::Surface. Then eglSurface > redirects this message to its observers, which are all gl::Framebuffer's > attachments: color, depth, stencil. Even though only color attachment > needs to be notified, but because we don't have a separate list of > observers, depth/stencil attachment also receive the notification and > they early out. Then gl::Framebuffer sets > DIRTY_BIT_COLOR_BUFFER_CONTENTS_0 dirty bit and send the > angle::SubjectMessage::DirtyBitsFlagged to Context, which dirty DrawFBO > and ReadFBO and dirty cached state. Note that this is specific for swap > image changed case, there is no surface property change (surface > property change will still trigger the subject/observer message with > SubjectMessage::SubjectChanged message, but this occurs rarely). This > gets worse for apps that uses multiple contexts, for the example > pokemon_masters_ex has three contexts, each context has its own default > frame buffer that attach to the same surface, and we never remove > non-current context from the observer list. This end up with > egl::Surface has 12 observers and for every frame, it loop over the list > of 12 observers and send message (virtual function call) to each of > them. Color attachment also ends up sending two messages to Context, one > for Read FBO and another for Draw FBO. There are total 21 virtual > function calls. Even for single context usage, you have 6 virtual > function calls, for every frame. > > EGL spec says "an EGLSurface must be current on only one thread at a > time", any other context must call EGLMakeCurrent in order to use this > surface, which will add all necessary dirty bits at that time. So we > really only need to notify current context. In this CL, > SwapchainImageChanged no longer uses subject/observer mechanism, so this > message is removed. > > This CL still uses subject/observer mechanism to send DirtyBitsFlagged > from Framebuffer back to context. We could call setDrawFramebufferDirty > and setReadFramebufferDirty directly, but that will require to remove > the "const" decoration out of gl::Context which generates too much code > diff, so onStateChange(angle::SubjectMessage::DirtyBitsFlagged) is still > used. > > Bug: angleproject:400711938 > Change-Id: I61354516fd0aa307714b7abd30c6b6e45ff7b496 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6319893 > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:400711938 Change-Id: Ib7899d1ac63a1f86af0953a1d25922578c470fc9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6387755 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Charlie Lao 48103cb2 2025-03-03T16:43:33 Vulkan:Dont use Subject/Observer for SwapchainImageChanged Because we do deferred ANI (VkAcquireNextImage) call until image is needed, we need a way to force Context to go through FramebufferVk::syncState call (FramebufferVk::syncState calls WindowSurfaceVk::getAttachmentRenderTarget, which end up calling ANI. Right now we uses subject/observer mechanism, by sending angle::SubjectMessage::SwapchainImageChanged to all observers of WindowSurfaceVk. In this case it is egl::Surface. Then eglSurface redirects this message to its observers, which are all gl::Framebuffer's attachments: color, depth, stencil. Even though only color attachment needs to be notified, but because we don't have a separate list of observers, depth/stencil attachment also receive the notification and they early out. Then gl::Framebuffer sets DIRTY_BIT_COLOR_BUFFER_CONTENTS_0 dirty bit and send the angle::SubjectMessage::DirtyBitsFlagged to Context, which dirty DrawFBO and ReadFBO and dirty cached state. Note that this is specific for swap image changed case, there is no surface property change (surface property change will still trigger the subject/observer message with SubjectMessage::SubjectChanged message, but this occurs rarely). This gets worse for apps that uses multiple contexts, for the example pokemon_masters_ex has three contexts, each context has its own default frame buffer that attach to the same surface, and we never remove non-current context from the observer list. This end up with egl::Surface has 12 observers and for every frame, it loop over the list of 12 observers and send message (virtual function call) to each of them. Color attachment also ends up sending two messages to Context, one for Read FBO and another for Draw FBO. There are total 21 virtual function calls. Even for single context usage, you have 6 virtual function calls, for every frame. EGL spec says "an EGLSurface must be current on only one thread at a time", any other context must call EGLMakeCurrent in order to use this surface, which will add all necessary dirty bits at that time. So we really only need to notify current context. In this CL, SwapchainImageChanged no longer uses subject/observer mechanism, so this message is removed. This CL still uses subject/observer mechanism to send DirtyBitsFlagged from Framebuffer back to context. We could call setDrawFramebufferDirty and setReadFramebufferDirty directly, but that will require to remove the "const" decoration out of gl::Context which generates too much code diff, so onStateChange(angle::SubjectMessage::DirtyBitsFlagged) is still used. Bug: angleproject:400711938 Change-Id: I61354516fd0aa307714b7abd30c6b6e45ff7b496 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6319893 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Roman Lavrov 8154cfc2 2025-03-13T15:37:17 Inline Framebuffer::getNumViews() On Android it totals ~100 bytes of assembly, and includes a loop which appears to be above clang heuristics thresholds with -O2 so I had to force-inline throughout to get the desired behavior. There are only a few callers so this has almost no effect on the binary size. Bug: b/383305597 Change-Id: Iad3d9120f8b3f072c1db34134de8b3787efc13ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6351145 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 87d891dc 2024-12-13T19:51:42 Inline more tiny functions on hot path Similar to https://crrev.com/c/6094283, not as hot but broader. Highlighted by PGO profile of driver_overhead_2 trace combined with size and offset of the corresponding .so sections to maximize reduction in TLB misses. Improves driver_overhead_2 performance by 1~2% on Pixel 8. Almost no change in .so size as functions are tiny. Bug: b/383305597 Change-Id: Ib1c021d4635141b879667b59305e4d45de7b8aef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6088958 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Chris Dalton cc841237 2024-11-29T13:45:50 Accept framebuffer modifications while PLS is active The only way for a WebGL implementation to know if PLS is actually active is to call glGetIntegerv(PIXEL_LOCAL_STORAGE_ACTIVE_PLANES_ANGLE) (because glBeginPixelLocalStorageANGLE() can fail). So the original behavior of not allowing glBindFramebuffer() et. al. while PLS was active created a state scenario that was expensive for the browser to track. Instead, just allow glBindFramebuffer() et. al., and implicitly disable PLS if they are called while it's active. Bug: angleproject:40096838 Change-Id: Ibd303f9f9950fb5b7f1add2d41882e4379c51e62 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6060301 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7c811715 2024-09-25T11:09:44 Vulkan: fix crash when clearing stencil with ClearBuffer Follow up to [1] which fixed a crash with glClear, but the bug remained with glClearBufferiv. This change refactors the "is stencil write masked out" query to always take the framebuffer's stencil bit count into account (practically always 8), which also happens to make the rest of the code checking this query more accurate in the presence of nonsense masks where the bottom 8 bits are 0. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/3315158 Bug: chromium:40207259 Bug: angleproject:42266334 Change-Id: I68a6b0b75c67ed2cdc8c4d03b243efe5495efce1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5889788 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 036e3ff1 2024-09-23T00:00:00 Remove Framebuffer::usingExtendedDrawBuffers This function is unused. Bug: angleproject:369533073 Change-Id: I604a032442ff04fc23b5bc72deebaf94cc2878c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5889566 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Dan Glastonbury c335ddfa 2024-07-19T11:48:54 Check only important stencil bits in partialClearNeedsInit When determining if a partial clear is taking place, instead of checking all bits of the stencil masks, only check the lowest bits corresponding to the bit depth of the active drawing stencil attachment. This results in combinations of masks, such as 0xFFFFFFFF and 0x7FFFFFFF as 0xFF and 0xFF, which are equal and not different. Change-Id: Id94082b6f689af92b00fb6d9a6cf65a1e3b4396a Bug: chromium:354025373 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5721289 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 44ce5887 2024-04-11T16:37:27 Allow the backend to do resource init for framebuffers. The frontend framebuffer would loop through attachments which needed to be initialized and call initializeContents on them individually. For the GL backend this is inefficient because each of these resources is bound to a scratch framebuffer and cleared when the entire original framebuffer could have been cleared at once. The frontend now accumulates a set of attachments that need to be cleared and sends it to the FramebufferImpl. The default FramebufferImpl does the old logic of calling initializeContents on each attachment. FramebufferGL has an optimized path to clear the whole framebuffer if possible. Bug: angleproject:8642 Change-Id: I574cd03307794a6c7b2666976784e4d4dca1d08c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5448552 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 18797bf2 2024-03-28T00:00:00 Metal: Handle incompatible attachments Metal runtime fails if the attachment pixel formats are not compatible with the program outputs or if the corresponding render pass and pipeline pixel formats do not match. Added Metal-specific state tracking and forced draw framebuffer syncronization for such cases. Cleaned up and reduced Framebuffer::setAttachmentImpl. Fixed: angleproject:5233 Change-Id: I4ee01889debe0e3cce54635e6cba62dbfdc02722 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5377813 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya b978974d 2024-03-03T10:48:48 Update frontend support for QCOM foveated extensions Modifications to frontend support - 1. EXTENDED_DIRTY_BIT_FOVEATED_RENDERING is removed 2. New framebuffer attachment API - getFoveationState 3. Attachment type restriction for foveated rendering is removed 4. Addition of new test - RenderbufferAttachmentClearThenDraw Bug: angleproject:8484 Change-Id: I699cbed81346c9a6344c4ff36afa51d6cc1bf052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5338529 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 75c8ef1c 2024-02-22T00:00:00 Update cached component type masks on attachment redefinitions Added a new test: WebGL2ValidationStateChangeTest.AttachmentTypeRedefinition Fixed: angleproject:8556 Change-Id: I1535fba5467228076bb79ac2cc5530610d4ec747 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5318735 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya d05c9a5e 2024-01-25T13:01:49 Frontend support for QCOM foveated extensions Add frontend state management to support foveated rendering extensions. Bug: angleproject:8484 Test: Texture2D*Foveation* Change-Id: I0e1be9f11b2d442207674562da760f5bfd7debc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5208091 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 9f9284b7 2023-07-17T15:41:27 Move ShareGroup to its own files Bug: angleproject:8224 Change-Id: Id6d272018bb5ee8c3e35488f641efa4d99fa836d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690003 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang c0cd00e8 2023-07-12T13:51:11 Sync all framebuffer attachments when checking completeness. If the backend requires that a framebuffer is synchronized before checking backend completeness, make sure all attachments are synchronized too. GL has completeness rules based on GL_BASE_LEVEL and GL_MAX_LEVEL of texture attachments which are not syncrhonized until the textures are. If they are left un-sychronized during completeness checks, the driver will tell us that the framebuffer isn't complete. Bug: chromium:1455725 Change-Id: I7c3bf6a38f63feaa863f4d8914c3655e286dd768 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678286 Reviewed-by: Brian Ho <hob@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Alexey Knyazev 817f4b81 2023-07-10T00:00:00 Restrict color writemasks for RGB9_E5 color buffers Per-channel write operations to shared exponent color buffers are loosely defined and may cause driver validation errors. Restricted the set of allowed color writemasks for RGB9_E5 color buffers so that RGB channels must be either all enabled or all disabled. Added a Metal-specific adjustment to ignore alpha writemask for RGB9_E5 color buffers. Removed an unused function from RenderPipelineColorAttachmentDesc. Bug: angleproject:8043 Change-Id: I902c3b70ddc6d8e65069d98a4a02a82122f413a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685566 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Chris Dalton 45f91a8c 2023-05-08T13:11:44 Deinitialize PLS planes when their texture is deleted The spec originally called for PLS planes to be converted to memoryless when their texture was deleted, but this is not compatible with WebGL, which does not support memoryless planes. Change the behavior to deinitialize them instead. This change requires the addition of a new observer message, angle::SubjectMessage::TextureIDDeleted, which PLS uses to deinitialize a plane when the app deletes its texture. Bug: chromium:1421437 Change-Id: I58fd91003747160f0a1abc1a8a7a87668890ba1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4518565 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
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>
Charlie Lao b19d17b8 2022-12-09T14:38:08 Vulkan: Split Serial class into UniqueSerial and Serial This CL splits Serial class into two classes: UniqueSerial and Serial. UniqueSerial supports the object unique serial usage where there is == and != operator but no > or < comparison. UniqueSerial can have invalid value, but Serial will not have invalid value (in next CL). The main reason is for next CL we can further optimize out the invalid value check in the QueueSerial comparison. Bug: b/262047600 Change-Id: Ieaed2a0d5546b012a6d63aa18b6006595e4aee1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4093557 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
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>
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>
Peng Huang 79aa846e 2022-08-17T13:40:33 Reland "Not recreate Framebuffer for eglMakeCurrent() call" This is a reland of commit bf9c815263455403e587a9d2b0fdb9fb8e964208 Original change's description: > Not recreate Framebuffer for eglMakeCurrent() call > > Right now, in eglMakeCurrent() call, ANGLE always release the > default framebuffer object associated to the current context, > and create a new default framebuffer object for the new current > context. It impacts chrome performance, since chrome call > eglMakeCurrent() a lot. With this CL, the default framebuffer > will be created with gl::Context. When the surface is changed > by eglMakeCurrent() call, ANGLE will detach the previous surface > from the associated framebuffer, and attach the new surface to > the next current context's default framebuffer. > > Bug: chromium:1336126 > Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 > Commit-Queue: Peng Huang <penghuang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1336126 Change-Id: Iade19004a4335ac7bc6ca176a3c14d34afff8c9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877405 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 02e8497f 2022-09-07T01:12:31 Revert "Not recreate Framebuffer for eglMakeCurrent() call" This reverts commit bf9c815263455403e587a9d2b0fdb9fb8e964208. Reason for revert: compile errors https://ci.chromium.org/ui/p/chromium/builders/try/linux-chromeos-rel/1303510/overview Original change's description: > Not recreate Framebuffer for eglMakeCurrent() call > > Right now, in eglMakeCurrent() call, ANGLE always release the > default framebuffer object associated to the current context, > and create a new default framebuffer object for the new current > context. It impacts chrome performance, since chrome call > eglMakeCurrent() a lot. With this CL, the default framebuffer > will be created with gl::Context. When the surface is changed > by eglMakeCurrent() call, ANGLE will detach the previous surface > from the associated framebuffer, and attach the new surface to > the next current context's default framebuffer. > > Bug: chromium:1336126 > Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 > Commit-Queue: Peng Huang <penghuang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1336126 Change-Id: I7c07f62236f57523b29c536c04f9a9de79da2f4b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877404 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Peng Huang bf9c8152 2022-08-17T13:40:33 Not recreate Framebuffer for eglMakeCurrent() call Right now, in eglMakeCurrent() call, ANGLE always release the default framebuffer object associated to the current context, and create a new default framebuffer object for the new current context. It impacts chrome performance, since chrome call eglMakeCurrent() a lot. With this CL, the default framebuffer will be created with gl::Context. When the surface is changed by eglMakeCurrent() call, ANGLE will detach the previous surface from the associated framebuffer, and attach the new surface to the next current context's default framebuffer. Bug: chromium:1336126 Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang eb535deb 2022-08-17T16:59:57 Don't set the framebuffer read buffer dirty bit on ES2. glReadBuffer is not added until ES3. Make sure we don't tell the backend to synchronize the read buffer state unless it's supported. Bug: chromium:1346132 Change-Id: I9836d6baac5a250c1fddf5d3ec6d395228e118db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3835167 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Peng Huang a2ad517f 2022-08-06T07:54:16 Replace std::vector with angle::FixedVector in FramebufferState. Using std::vector causes heap allocation for all new framebuffers, so change it to angle::FixedVector. Bug: chromium:1336126 Change-Id: I2e059324d14d59ba2a42b2bb4cd5c569a439a87a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812563 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org>
Charlie Lao 81554b66 2022-07-27T16:53:03 Vulkan: Reduce Framebuffer dirtyBits for swapchain only changes For window system framebuffer, the change to it is very limited. Most time it is only swapchain image changes. Right now we are also setting depth/stencil buffer dirty and processing layer count update and color mask and blending update when only color image changed. This CL avoids setting depth/stencil dirty bit for swap chain image changes. It also avoids color mask and blending update (they still gets updated for draw buffer change or draw franmebuffer binding changes). Bug: b/240475351 Change-Id: I0697a38d5939187244d67f01c0bc53fc28e11664 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3789471 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Constantine Shablya b47603e0 2022-06-14T05:47:54 Implement GL_NV_read_depth_stencil The implementation will perform two readPixels calls, once for each aspect, and then interleave and pack the result. Bug: angleproject:4688 Change-Id: I46390df893de50b93e855e9333ffab567215a2bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3702686 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Auto-Submit: Constantine Shablya <constantine.shablya@collabora.com>
Mark Lobodzinski fb3e2def 2022-05-24T15:47:01 Extend labelObject functionality Modify interface to fully support labelObject return codes. Fix issues with texture implementation, including handling deferred Vulkan object creation. Bug: b/229105865 Change-Id: I0c64b72dd0b54642fb643ee7f5ccbb2a134c6787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3703184 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Alexey Knyazev 454efd1d 2022-04-26T23:57:46 Add forceDepthAttachmentInitOnClear frontend workaround AMD on D3D11 skips depth buffer updates in some cases. Bug: angleproject:7246 Bug: angleproject:7200 Change-Id: I27bbea30fbf4173470063a670b9c43a805286c39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608092 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Maksim Sisov beda2459 2021-12-09T14:24:08 Add support for GL_MESA_framebuffer_flip_y 2/* This is a second CL that adds actual implementation for GL_MESA_framebuffer_flip_y extension. Also, some tests are added to verify the functionality. Please note that bots do not support this extension yet, and the tests were verified by running them locally. Bug: chromium:1231934 Change-Id: Iea483aa13a298df6b5cf0b7b5ffb795a4666e3bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3329603 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Maksim Sisov <msisov@igalia.com>
Geoff Lang f045fe07 2021-11-04T10:44:20 Fix MSRTT unsized texture formats querying supported samples. The texture format information in gl::Context is sized formats only. When MSRTT textures are used, they would query the potentially unsized format for maximum supported samples. This would return 0 and cause an incomplete framebuffer when the sample count missmatched with other attachments. Bug: chromium:1238327 Change-Id: I06514b1b9badefa81bba3b7ad9ba5db932b4c12b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3260555 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 30b01d8f 2021-11-03T15:56:47 Fix multiview framebuffer completeness check In the process of dropping ANGLE_multiview in favor of OVR_multiview, the framebuffer completeness checks have become stale. In particular: - There is no requirement that the base layer of the attachments match - There _is_ a requirement that base+count layers are within the texture boundaries. Bug: chromium:1264988 Change-Id: I86837b587ad5befaa6a545c5a24507e8dff0b568 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3259272 Reviewed-by: Alexis Hetu <sugoi@google.com> Reviewed-by: Alexis Hétu <sugoi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 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>
SeongHwan Park 16a61bbb 2021-08-05T23:06:22 D3D: Fix not notifying RenderTarget release in TextureD3D This could lead to use-after-free for the RenderTarget object. Bug: chromium:1234829 Change-Id: I73d4547b8f09f2f2cf3f7f8394f7f573fe5a4ef5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3063858 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 9ddaa686 2021-07-16T14:57:13 Call getNearestSamples() in Framebuffer::setAttachment() The app jp.garud.ssimulator uses the same sample count of '2' for both glRenderbufferStorageMultisampleEXT() and glFramebufferTexture2DMultisampleEXT(). However, when glRenderbufferStorageMultisampleEXT() is called, Renderbuffer::setStorageMultisample() calls TextureCaps::getNearestSamples() which rounds up the sample count from '2' to '4'. Later, when the app tries to draw with the framebuffer, an error is generated by ANGLE: Framebuffer is incomplete: Attachments have different sample counts. The fix is to also call TextureCaps::getNearestSamples() in Framebuffer::setAttachment() to make sure the sample count passed into glFramebufferTexture2DMultisampleEXT() is also rounded up to match the renderbuffer. Bug: angleproject:6183 Test: MultisampledRenderToTextureTest.FramebufferCompletenessSmallSampleCount Change-Id: I58be9986077257f4767f2e528c2f87e496d9d774 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036254 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Geoff Lang bccb0d56 2021-05-11T13:53:05 Add messages for framebuffer completeness errors. This also creates a common code path for all framebuffer completeness errors (FramebufferStatus::Incomplete) which helps for adding a debug breakpoint. Bug: angleproject:5949 Change-Id: Ib102dbf86e020777e56c6dc6b78dda8ebdba2127 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888110 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao a37d9748 2021-04-13T14:52:31 Vulkan: Add support for FBO with unequal sized attachments OpenGLES 3.0 allows FBO with unequal sized attachments. This CL removes assertion that all attachment must have equal size from vulkan backend, and uses common intersect area to create VkFramebuffer object. Bug: b/181800403 Change-Id: Icbb12a26784b184ebd91740855672013f64b889d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2824760 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
James Darpinian bb7c1442 2021-03-17T10:17:31 Fix immutable texture base level validation Jeff's new rendering feedback loop test (https://github.com/KhronosGroup/WebGL/pull/3221) found a couple of issues with texture base level validation. For immutable textures the base level is clamped to the valid range, so setting an out of range base level does not make an immutable texture sampler incomplete, and we need to use the clamped value when checking for rendering feedback loops. Bug: angleproject:5768 Change-Id: Ie065709efd736f2cf75d4f980e8ac27999f80142 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2767901 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
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 7ee24229 2021-03-03T15:16:07 Reland "Fix two issues with GLES2 devices" This is a reland of c0ed204de972c76a5428834c94aaa34fd2953329 Original change's description: > Fix two issues with GLES2 devices > > * make sure maxColorAttachments is greater than 0 > * Do not sync read buffer if maxDrawBuffers is 0 > > Bug: chromium:1167731 > Change-Id: Icd0fb5e65ec6ffdc0d6f6325ccd1207958922254 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2733268 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Peng Huang <penghuang@chromium.org> Bug: chromium:1167731 Change-Id: Iccd7b0986c4728e362fccaeda6fbeff2860d888c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743665 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
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>
Peng Huang 02a9d011 2021-03-09T15:23:52 Revert "Fix two issues with GLES2 devices" This reverts commit c0ed204de972c76a5428834c94aaa34fd2953329. Reason for revert: crbug.com/1186140 Original change's description: > Fix two issues with GLES2 devices > > * make sure maxColorAttachments is greater than 0 > * Do not sync read buffer if maxDrawBuffers is 0 > > Bug: chromium:1167731 > Change-Id: Icd0fb5e65ec6ffdc0d6f6325ccd1207958922254 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2733268 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Peng Huang <penghuang@chromium.org> Bug: chromium:1167731 Change-Id: Ibd05424889feac0bdb7293426ab41eb1f4753b35 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743662 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>
Peng Huang c0ed204d 2021-03-03T15:16:07 Fix two issues with GLES2 devices * make sure maxColorAttachments is greater than 0 * Do not sync read buffer if maxDrawBuffers is 0 Bug: chromium:1167731 Change-Id: Icd0fb5e65ec6ffdc0d6f6325ccd1207958922254 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2733268 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
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>
Shahbaz Youssefi 7dc92430 2020-10-30T13:05:05 Noop clear of non-existing attachments. Bug: angleproject:4988 Change-Id: Ib6ff9756ec7ae5aa2b11f4d12932829fe05656d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2511369 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi efc0aaf4 2020-10-06T17:14:45 Remove gaps in Framebuffer::DirtyBits Bug: angleproject:4836 Change-Id: Ia36563eefaa7f6a84ad70db27e0abc5f9fcba703 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2453465 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f17cd288 2020-09-18T11:36:50 Refactor IsMipmapFiltered to take the min filter directly. This function is more useful if it takes just the min filter mode instead of the entire sampler struct to read a single member. Bug: b/167404532 Change-Id: Ie8c01c4095a615f06fe046fb175cdfb92fa54cbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2419111 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao 71e7a5a6 2020-09-14T13:56:19 Vulkan: Move mAttachedColorBufferMask to FramebufferState This moves the bit mask of attached color buffer to front end. No function change is expected. Bug: b/167301719 Change-Id: I4eec3a419560b91875260b812a036ceaaeb6b5bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2410790 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 543a3962 2020-09-02T09:40:10 Vulkan: Fix resolve-with-subpass with non-zero read attachment The draw framebuffer's color index was used to get the read buffer of the source framebuffer. Bug: b/159903491 Change-Id: I7a1626e6732367c14d46f1e1be4057998fdbf011 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390440 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill d787149a 2020-08-20T17:33:49 Allow rendering to unused levels of bound Textures. This CL refines the feedback loop check to allow rendering to non- sampled levels of currently bound textures. This is a technique sometimes used to initialize a mip chain of a texture. Also adds a regression test that fails on Vulkan. Bug: angleproject:4500 Bug: angleproject:4690 Change-Id: I5fd370e36a2919c82170abcbd2b0897c075bdcc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2367314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@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>
Jamie Madill 185d9d08 2020-08-14T22:48:15 Re-land "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." Re-land fixes the crash when drawing with no bound Program executable. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: If2bd25b08298a99f5e64b4055137f9154b0f0860 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365595 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Khushal f6fb6da8 2020-08-19T21:04:35 Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." This reverts commit 699bcde0b729853f33474941a313f6d5c9e63faf. Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240 Original change's description: > Feedback Loop Redesign 2/3: Track bound FBOs in Texture. > > Currently we track feedback loops by counting the times a Texture is > bound as a sampler or image in a particular context. This is a bit > tricky because Texture bindings change frequently. Relative to the > number of times we need to check for a feedback loop this causes excess > overhead. > > Usually Framebuffers have a low number of Textures bound (in many cases > just 1). And Textures aren't usually bound to many different FBOs. So > instead of counting the number of times a Texture is bound as a sampler > or image we will track the Framebuffers that the Texture is bound to. > > This CL adds a small vector class to gl::Texture which tracks all the > Framebufer Serials of its bound Framebuffers. We can use this set to > quickly check if there's any potential feedback loop between the a FBO > and this Texture. > > We also update the feedback loop check to use this new method. We will > be able to remove the old counting method when we switch the Vulkan > feedback loop handling to use the new tracking in this CL. > > Bug: angleproject:4500 > Bug: angleproject:4959 > Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 > Reviewed-by: Tobin Ehlis <tobine@google.com> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,courtneygo@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4500 Bug: angleproject:4959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077 Reviewed-by: Khushal <khushalsagar@chromium.org> Commit-Queue: Khushal <khushalsagar@chromium.org>
Jamie Madill 699bcde0 2020-08-14T22:48:15 Feedback Loop Redesign 2/3: Track bound FBOs in Texture. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d0b270e6 2020-08-14T21:55:17 Feedback Loop Redesign 1/3: Framebuffer Serials. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. Because FBOs are unique to a Context, a Texture could be bound to two different FBOs with the same ID. In this CL we introduce a new Serial for the FBO which is unique to an EGL Share Group. This way we can ensure we don't make the wrong call when a Texture is referenced by a Framebuffer. It also replaces the old FB serial which was again only unique to a particular Context. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: I0a9989d861a4132bd3b7ed85f699a4448ff37a4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358849 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 6eb7756d 2020-08-07T17:41:39 Vulkan: tell ContextVk when swapchain is re-created For an app that only draws to the swapchain, if the swapchain is recreated with a different rotation (as done by the ANGLE perf tests when switching from Angry Birds 2 to Candy Crush), ContextVk is not informed, and so the new rotation is ignored. Use the subject-observer pattern to set the appropriate dirty bits. Test: run_angle_perftests --gtest_filter=TracePerfTest.Run/vulkan_angry*:*vulkan_candy* --verbose --local-output Bug: angleproject:4910 Bug: b/163126746 Change-Id: Ib5303e9c4095db1b3e736911f483589e40a73d0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341768 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@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>
Shahbaz Youssefi f776eb9c 2020-08-01T23:45:24 Vulkan: EXT_multisampled_render_to_texture2 support The previous change that implemented EXT_multisampled_render_to_texture already provisioned this extension in the Vulkan backend. This change implements the front-end for this extension and enables it in the Vulkan backend. Bug: angleproject:4836 Change-Id: I7080260972e61727c5716051c236f635668cb67b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2330510 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 248119b3 2020-07-20T16:05:45 Vulkan: Fix render target's tracking of content defined Imagine the following scenario: 1. Clear draw framebuffer 2. Invalidate draw framebuffer 3. Update texture attached to draw framebuffer 4. Draw again into draw framebuffer Step 3 could be a number of things, such as glCopyTex[Sub]Image, glBlitFramebuffer, glTex[Sub]Image2D, glGenerateMipmap etc. In the above scenario, at step 2, the framebuffer's render target remembers it being invalidated (mContentDefined = false). This is used to set the loadOp of the next render pass to DONT_CARE. However, mContentDefined was implemented for a very specific optimization regarding the swapchain's depth buffer. The reuse of this variable for glInvalidateFramebuffer was erroneous as this variable didn't track whether the contents are defined for the general case. With this change, mContentDefined is set to true during FramebufferVk::syncState for each render target whose contents are marked dirty. This change additionally makes glBlitFramebuffer signal the contents of the blit targets as dirty, as well as textures that are used as storage images. Bug: angleproject:4859 Change-Id: I68c829f75ff4a3d03bb293ec72c609384983026d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2309110 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi c757e607 2020-07-21T10:18:41 Vulkan: Fix deferred clears and noop clear and blit Imagine the following situation: 1. Clear draw framebuffer 2. Noop operation on the framebuffer (Clear, ClearBuffer, BlitFramebuffer with flags specifying non-existing attachments) 3. Change framebuffer's attachment 4. Draw into framebuffer At step 2, FramebufferVk::syncState was called before noop-ing the operation. During syncState, deferred clears were stored in the framebuffer and weren't flushed because the actual operation was not performed. At step 4, the deferred clear meant for the prior attachment gets applied to the new attachment. Bug: angleproject:4865 Change-Id: I5b096bacf00356b4dccd4cbc9561b87b1bb557d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2309224 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Manh Nguyen dce37b7d 2020-06-21T22:27:06 Serialize framebuffers + compare contexts for CaptureReplayTests Adds to frame capture the ability to serialize a frame's pre-swap GL state and store it in the binary data file Adds to CaptureReplayTests the ability to compare its serialized GL state with the serialized state pulled from the binary data file Adds a serialization module that serializes framebuffers' GL states and the contents of their color attachments Adds checks to automation script so that it would skips tests that do not produce the expected trace files Adds exception handling to automation script so that it will not crash when a replay build crashes Bug: angleproject:4779 Change-Id: I40a02e018073749e79f0ddbfd3d4065745548f46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2258295 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Manh Nguyen d4874cb3 2020-06-25T10:49:32 Reformat Framebuffer::readPixels Reformat Framebuffer::readPixels and its overriding methods to the following method signature angle::Result readPixels(const Context *context, const Rectangle &area, GLenum format, GLenum type, const PixelPackState &pack, Buffer *packBuffer void *pixels); This will allow capture replay tool to use its own PixelPackState to read pixels from framebuffer without having to set the global states Bug: angleproject:4787 Change-Id: Idc64179d8e8f6b5163ef0747f239cd5172a2491b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2267417 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
Sunny Sachanandani 3d5f0c82 2020-05-19T20:05:57 Use surface texture offset for clears and blits https://chromium-review.googlesource.com/c/angle/angle/+/2186176 added surface texture offset attributes for D3D11 pbuffer surfaces, but the implementation didn't apply the offset to blits or clears. This CL fixes that and includes a unit test for blit, clear, and draw. Also renames textureOffset to surfaceTextureOffset throughout since it's clearer, and fixes the dcomp surface test to specify the update offset returned by dcomp BeginDraw(). Bug: angleproject:2997 Change-Id: I9298ccf55cbb2d04c3b8f78e12f9d07dc8fa54b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210967 Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Sunny Sachanandani 4b225c70 2020-05-06T15:38:12 Add texture offset attributess for D3D texture pbuffer surfaces Add EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE attributes to EGL_ANGLE_d3d_texture_client_buffer which are used to specify offsets used for rendering into the pbuffer surface backed by a D3D11 texture. Rendering with the correct offset is needed when Chrome gets a texture and offset from an external source e.g. when calling BeginDraw() on IDCompositionSurface. Bug: angleproject:2997 Change-Id: I363f739f3f05c38720f385e34c91e98fc6a622a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186176 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Alexey Knyazev c6aef6dd 2020-05-02T20:24:56 Skip indexed clears on disabled draw buffers Fixes ClearTestES3.ClearDisabledNonZeroAttachmentNoAssert Also fixed an assert in RenderTargetCache::updateColorRenderTarget Bug: angleproject:4607 Change-Id: Ic527eabacd424786736876136590b8409c9b49d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2172091 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 1033d55d 2020-04-07T14:01:24 Pass binding enum to Framebuffer::syncState. Will allow us to determine if we're clearing the read or draw FBO. Then we can stash clears for the draw FBO only and issue them immediately for the read FBO in the Vulkan back-end. Bug: angleproject:4517 Change-Id: Ifc043317d6156a75749b13f9d2c44a17e14ee378 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2139997 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c916fe8a 2020-04-02T16:57:49 Don't call syncState inside FBO queries. This prevents a syncState ordering issue that was confusing FBO sync when robust resource init is enabled. Also cleans up some redundant format processing for the half float extensions. Bug: angleproject:4517 Change-Id: Ieb13fc5203cf824a3e8affda96ea5cbbd89d78ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134411 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c9c4e4ed 2020-04-02T10:29:52 Track rendering feedback loops by-context. This fixes an issue where feedback loops detection would trigger false positives based on texture use in multiple contexts. 1) there are two contexts, C1 and C2, sharing resources 2) in C1, there is a texture T bound to GL_TEXTURE_2D, and a program in use that will sample C1 3) in C2, a framebuffer is created and T is bound to it This fix indexes each set of active bindings in an object by ContextID. We can potentially redo this solution in the future if this proves to have too much tracking overhead. Includes a test writen by Ken Russell. Bug: angleproject:4517 Change-Id: I67012e68947c42d863dca193972576c82d5f3712 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134406 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexis Hetu b83b0f5e 2020-01-31T15:09:17 Add support for NV_read_depth, NV_read_stencil and NV_depth_buffer_float2 extensions This cl adds the ability for the ReadPixels function to read other attachments than the color attachment. Checks were added for both depth and stencil attachments. A new test was added (DepthStencilFormatsTest.DepthStencilReadback) to test this new functionality. As the name mentions, it's used to test reading from the depth and stencil attachments using ReadPixels. Bug: angleproject:4295 Change-Id: I6fe9be11f05d6055a5883b4315f870e7c0ac41ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031702 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill d03b15b2 2020-03-26T17:22:18 Vulkan: Mask out Depth/Stencil RTs in feedback loops. This should enable some cases of limited support for feedback loops with depth/stencil buffers. For example with Manhattan and the Vulkan back-end. Increases the number of RenderPasses in Manhattan slightly. This will regress performance slightly until we can work out a better solution that is also conformant with the spec. Bug: angleproject:4517 Change-Id: I2758e6b4c2a930474c09cdc0950f3b6c34541089 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2106670 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill bd2bdf9f 2020-03-26T15:40:09 Fix feedback loop clearing detection. Bug: angleproject:4517 Change-Id: I3231b129718019f83495843404cd011eb2cd480d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2122689 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill c77cb596 2020-03-24T14:39:32 No-op draw calls with rendering feedback loops. This is quite within spec and protects our various back-ends from FB loops. Also makes the check more cached for optimization purposes. Bug: angleproject:4490 Change-Id: Ia82ec88244d07670d68ce53495b5893b8a75ac42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2118153 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 1c88cf27 2020-03-18T18:00:01 Add optimized rendering feedback loop tracking. This can be used both for WebGL and the Vulkan back-end workaround for Manhattan. Uses the recently added tracking for Textures being bound as samplers. Then caches this information in the Framebuffer using the Subject/Observer pattern. Bug: angleproject:4490 Change-Id: I08bef0a1b95c4333da19c2dae1f02a993e5835e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2109335 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 605ab763 2020-02-24T19:43:32 D3D11: Implement OES_draw_buffers_indexed Existing CONSTANT_COLOR/CONSTANT_ALPHA limitation was generalized to independent blend states with draw call invalidation and a new end2end test. dEQP tests that are incompatible with this limitation result in INVALID_OPERATION and are marked as FAIL. D3D11 renderer always normalizes and deduplicates requested blend states based on their enabled features and bound framebuffer. Bug: angleproject:4394 Change-Id: I284796e18be71de1b5bfb087d36f6a45be4c3f70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2070575 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill bd4e756a 2020-02-17T09:49:45 Const-ify the validation layer. Enforces that the validation layers should be working pretty much read- only with the exeption of updating caches. Requires a few tricks: - updates EP code generation to add 'const' to pointer parameters - enables a kludge const_cast to enable the robust query extension - makes some members of Framebuffer mutable to work around syncState - makes 'is' queries and other methods in Context/State const Will allow us to more safely expose the no_error extension. Bug: angleproject:1280 Change-Id: Id9756757854c9e68fc096ecec8d93759fbe6b3a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2060689 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c431d596 2019-12-16T10:59:44 Add Serial to all GL resources. The Serial will help track active resources for filtering out inactive setup calls in capture/replay. Bug: angleproject:4223 Change-Id: I64ba50f27d656c12d45155dc735e9b6f9c04528f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1969062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinyi He 4c7db77e 2019-10-31T15:42:31 Vulkan: Set limitation on maxComputeWorkGroupCount According to Table 20.45 and Chapter 17 in the ES 3.1 spec, MAX_COMPUTE_WORK_GROUP_COUNT is get as a GLint by using GetIntegeri_v. However, it is an unsigned integer in the Vulkan. It needs to set limitation on maxComputeWorkGroupCount[] during translating. 1. Change the data type to GLint stored in Caps. 2. Ensure that the limitation is set during initialization. 3. Add workaround for angleproject:4120 Bug: angleproject:4066 Change-Id: I1659ba1d560e30b9599cace0feeab8a18890c3ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1890586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mingyu Hu 2d0e5b55 2019-08-27T13:49:07 GL_EXT_multisampled_render_to_texture extension. Part 2. For textures that use this extension, a multisampled texture is implicitly created for the texture. Upon write or read, the multisampled texture is either return to be drawn to or resolved and returned as a single sampled texture. This is the functionality change with end2end tests. Bug: angleproject:980428 Change-Id: I5776875a132fed7a3f4f00fb02f9e8e250684630 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1773717 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill f703443b 2019-09-21T14:10:35 Use Resource IDs in RefCountObject. This lets us use strongly typed IDs pretty much everywhere. Only one or two additional places still use GLuint IDs. Mostly for external queries and for Framebuffer Attachments. With some clever type reflection helpers lets us define a single template function for handling operator== and != for resource IDs. Refactor in preparation for more Capture/Replay work. Bug: angleproject:3611 Change-Id: I1c0c848e89eb8a4b769714d57686f816daf01634 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1815550 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Geoff Lang 32d6006b 2019-09-06T10:10:08 Don't block setting the DEPTH_STENCIL attachment based on the resource format. By blocking the attachment at this point, it doesn't allow for the resource to have a depth stencil format later. BUG=997702 Change-Id: Iec5243012cb9a9527c5b1467d44c393b0dc6bddc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780898 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Mingyu Hu 7e44ec26 2019-08-26T15:59:48 GL_EXT_multisampled_render_to_texture extension. Part 1. Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before. Bug: angleproject:980428 Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiacheng Lu 2c5d48a6 2019-08-23T09:28:35 Use FramebufferID in place of GLuint handle Bug: angleproject:3804 Change-Id: I5e1b5f1903b05a91468379e00ec130802315cdc2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769039 Reviewed-by: Jiacheng Lu <lujc@google.com> Commit-Queue: Jiacheng Lu <lujc@google.com>
Tim Van Patten 56ba54cc 2019-08-08T13:03:34 Support separate read and draw surfaces in eglMakeCurrent Update ANGLE's default framebuffer implementation to support reading and writing to different surfaces within the same framebuffer. Bug: angleproject:2620 Test: EGLSurfaceTest[3] Change-Id: I4b1ea04ca87a751f80cf190bf3adec148fc4fce3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744746 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2ab08edc 2019-08-12T16:20:21 Use TextureID in place of GLuint handles. Bug: angleproject:3611 Change-Id: Ie6156e8732b3ca4dc6c4439c059a5481a4dfd250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738753 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c7dec01 2019-08-06T17:44:11 Use RenderbufferID in place of GLuint handles. This will allow frame capture/replay to more easily emulate object handle manipulation. It also provides a bit of type safety. Also generalizes ResourceMap to handle non-GLuint IDs. Bug: angleproject:3611 Change-Id: I174fd260f326e0dbe2aca3f818215c91d82cf48c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706559 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>