src/tests/gl_tests/FramebufferTest.cpp


Log

Author Commit Date CI Message
Xin Yuan b4d1333d 2025-07-24T10:28:25 Fix the issues when blitting within same resources Per GLES spec,when the attachments in src and dst framebuffers are identical, angle should generate GL_INVALID_OPERATION. But different mipmap levels of a texture, different layers of a 3D texture or 2D array texture, and different faces of a cube map texture do not constitute identical buffers, these are valid operations. Bug: angleproject:433816259 Change-Id: Ie6d34819dfbc2faa4af22ec370e59c1ed4521bcb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6780168 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Xin Yuan <xin.yuan@arm.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
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>
Matthew Denton 243ebfa7 2025-06-16T16:07:06 WebGPU: Allow glReadPixels from non-base mip levels. Before, the WebGPU backend always read from the base level of the texture attached to the current framebuffer. Bug: angleproject:42267090 Change-Id: Ibe5b8575f6fa90c1942ba566485b6175ee10f808 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6634558 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Matthew Denton <mpdenton@chromium.org>
Alexey Knyazev 76561acc 2025-04-04T00:00:00 Fix use of OpenGL ES 3.2 commands in tests Fixed tests that used OpenGL ES 3.2 commands instead of extensions when running on lower context versions. Bug: angleproject:409484297 Change-Id: I1d032a8ed4df429e564c24321101b4dfcd5d1ba8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6441554 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Igor Nazarov e265a38d 2025-03-26T09:32:47 Tests: Update ChangeFBOSizeWithNoAttachments test Replace `GL_DRAW_FRAMEBUFFER` with `GL_FRAMEBUFFER`. This should not make any difference, since test does not use the read framebuffer, but it causes failure on Intel GPU on Window. Test works as expected if bind default framebuffer to the `GL_READ_FRAMEBUFFER` binding. GL beck-end internally uses `GL_FRAMEBUFFER` in many places. Correct draw and read framebuffers are restored at draw time. Note, that syncing `DIRTY_BIT_READ_FRAMEBUFFER_BINDING ` during draw is unnecessary and may even cause bugs (because `DIRTY_OBJECT_READ_FRAMEBUFFER` is not also synchronized). This may be fixed in future CL, which will cause this test to fail even if keep it as-is. It is because read framebuffer binding will be left in dirty state after internal `GL_FRAMEBUFFER` bindings. Test: angle_end2end_tests --gtest_filter=FramebufferTest_ES31.ChangeFBOSizeWithNoAttachments/* Bug: angleproject:42266132 Change-Id: Ic6b7cdc2f0c94905f8387624d514a1d18e5b2572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6396635 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Cody Northrop db48967f 2025-03-05T09:07:10 Reland "Add GL_BGRA_EXT as a sized renderable format" This reverts commit 4bfb9da6f98b3e28905cc759a77bff750dfe3ff7. Reason for revert: More mapping fixes for GL backend Original change's description: > Revert "Reland "Add GL_BGRA_EXT as a sized renderable format"" > > This reverts commit 8f2fbbd1a0d16471596afad57c88f950a1ee3032. > > Reason for revert: http://anglebug.com/399913714 > > Original change's description: > > Reland "Add GL_BGRA_EXT as a sized renderable format" > > > > This reverts commit 22dfe435daa7c680c07bb8d4f1d98ab765e60ad0. > > > > Reason for revert: Fixed mapping back to BGRA_EXT for GL backend > > > > Original change's description: > > > Revert "Add GL_BGRA_EXT as a sized renderable format" > > > > > > This reverts commit 80093a7d8f850c3ab551ddb4972c2f1f27511433. > > > > > > Reason for revert: suspect for blocking rolling ANGLE into Chroimum > > > https://chromium-review.googlesource.com/c/chromium/src/+/6283973 > > > https://ci.chromium.org/ui/p/chromium/builders/try/chromeos-amd64-generic-rel-gtest/372754/overview > > > > > > Original change's description: > > > > Add GL_BGRA_EXT as a sized renderable format > > > > > > > > dEQP tests were updated to cover GL_BGRA_EXT as a sized renderable > > > > format. It was apparently always supposed to be, based on the > > > > wording of the spec. > > > > > > > > This CL adds that support and updates expectations, along with a few > > > > extra tests. > > > > > > > > Includes contributions from Robic.Sun@arm.com. > > > > > > > > Test: angle_end2end_tests, angle_deqp_*_tests > > > > Bug: b/42267264 > > > > Bug: angleproject:394384906 > > > > Change-Id: Ia10bcd61f66c5d99a3d27a2cfd6008c991ddcaa7 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6235444 > > > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > > > Commit-Queue: Cody Northrop <cnorthrop@google.com> > > > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > > > > > Bug: b/42267264 > > > Bug: angleproject:394384906 > > > Change-Id: I64572361cfed33b4ea17eabf278f580471d045c2 > > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6285628 > > > Auto-Submit: Yuly Novikov <ynovikov@chromium.org> > > > Commit-Queue: Yuly Novikov <ynovikov@chromium.org> > > > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > > > Bug: b/42267264 > > Bug: angleproject:394384906 > > Change-Id: I1bd9df904d93fd54286cbfce53fe89db89e842b9 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6310699 > > Commit-Queue: Cody Northrop <cnorthrop@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > Bug: b/42267264 > Bug: angleproject:394384906 > Bug: angleproject:399913714 > Change-Id: I9f79f39a6d9cba3b23c261005bc3e012d70cd1cf > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6312977 > Auto-Submit: Cody Northrop <cnorthrop@google.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bug: b/42267264 Bug: angleproject:394384906 Bug: angleproject:399913714 Change-Id: Ifc98fcbb0883dc4a55ad358825e9c1935fa26eaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6330036 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 4bfb9da6 2025-02-28T12:49:28 Revert "Reland "Add GL_BGRA_EXT as a sized renderable format"" This reverts commit 8f2fbbd1a0d16471596afad57c88f950a1ee3032. Reason for revert: http://anglebug.com/399913714 Original change's description: > Reland "Add GL_BGRA_EXT as a sized renderable format" > > This reverts commit 22dfe435daa7c680c07bb8d4f1d98ab765e60ad0. > > Reason for revert: Fixed mapping back to BGRA_EXT for GL backend > > Original change's description: > > Revert "Add GL_BGRA_EXT as a sized renderable format" > > > > This reverts commit 80093a7d8f850c3ab551ddb4972c2f1f27511433. > > > > Reason for revert: suspect for blocking rolling ANGLE into Chroimum > > https://chromium-review.googlesource.com/c/chromium/src/+/6283973 > > https://ci.chromium.org/ui/p/chromium/builders/try/chromeos-amd64-generic-rel-gtest/372754/overview > > > > Original change's description: > > > Add GL_BGRA_EXT as a sized renderable format > > > > > > dEQP tests were updated to cover GL_BGRA_EXT as a sized renderable > > > format. It was apparently always supposed to be, based on the > > > wording of the spec. > > > > > > This CL adds that support and updates expectations, along with a few > > > extra tests. > > > > > > Includes contributions from Robic.Sun@arm.com. > > > > > > Test: angle_end2end_tests, angle_deqp_*_tests > > > Bug: b/42267264 > > > Bug: angleproject:394384906 > > > Change-Id: Ia10bcd61f66c5d99a3d27a2cfd6008c991ddcaa7 > > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6235444 > > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > > Commit-Queue: Cody Northrop <cnorthrop@google.com> > > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > > > Bug: b/42267264 > > Bug: angleproject:394384906 > > Change-Id: I64572361cfed33b4ea17eabf278f580471d045c2 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6285628 > > Auto-Submit: Yuly Novikov <ynovikov@chromium.org> > > Commit-Queue: Yuly Novikov <ynovikov@chromium.org> > > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/42267264 > Bug: angleproject:394384906 > Change-Id: I1bd9df904d93fd54286cbfce53fe89db89e842b9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6310699 > Commit-Queue: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: b/42267264 Bug: angleproject:394384906 Bug: angleproject:399913714 Change-Id: I9f79f39a6d9cba3b23c261005bc3e012d70cd1cf No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6312977 Auto-Submit: Cody Northrop <cnorthrop@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cody Northrop 8f2fbbd1 2025-02-27T13:33:06 Reland "Add GL_BGRA_EXT as a sized renderable format" This reverts commit 22dfe435daa7c680c07bb8d4f1d98ab765e60ad0. Reason for revert: Fixed mapping back to BGRA_EXT for GL backend Original change's description: > Revert "Add GL_BGRA_EXT as a sized renderable format" > > This reverts commit 80093a7d8f850c3ab551ddb4972c2f1f27511433. > > Reason for revert: suspect for blocking rolling ANGLE into Chroimum > https://chromium-review.googlesource.com/c/chromium/src/+/6283973 > https://ci.chromium.org/ui/p/chromium/builders/try/chromeos-amd64-generic-rel-gtest/372754/overview > > Original change's description: > > Add GL_BGRA_EXT as a sized renderable format > > > > dEQP tests were updated to cover GL_BGRA_EXT as a sized renderable > > format. It was apparently always supposed to be, based on the > > wording of the spec. > > > > This CL adds that support and updates expectations, along with a few > > extra tests. > > > > Includes contributions from Robic.Sun@arm.com. > > > > Test: angle_end2end_tests, angle_deqp_*_tests > > Bug: b/42267264 > > Bug: angleproject:394384906 > > Change-Id: Ia10bcd61f66c5d99a3d27a2cfd6008c991ddcaa7 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6235444 > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > Commit-Queue: Cody Northrop <cnorthrop@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/42267264 > Bug: angleproject:394384906 > Change-Id: I64572361cfed33b4ea17eabf278f580471d045c2 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6285628 > Auto-Submit: Yuly Novikov <ynovikov@chromium.org> > Commit-Queue: Yuly Novikov <ynovikov@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/42267264 Bug: angleproject:394384906 Change-Id: I1bd9df904d93fd54286cbfce53fe89db89e842b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6310699 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 22dfe435 2025-02-20T06:46:07 Revert "Add GL_BGRA_EXT as a sized renderable format" This reverts commit 80093a7d8f850c3ab551ddb4972c2f1f27511433. Reason for revert: suspect for blocking rolling ANGLE into Chroimum https://chromium-review.googlesource.com/c/chromium/src/+/6283973 https://ci.chromium.org/ui/p/chromium/builders/try/chromeos-amd64-generic-rel-gtest/372754/overview Original change's description: > Add GL_BGRA_EXT as a sized renderable format > > dEQP tests were updated to cover GL_BGRA_EXT as a sized renderable > format. It was apparently always supposed to be, based on the > wording of the spec. > > This CL adds that support and updates expectations, along with a few > extra tests. > > Includes contributions from Robic.Sun@arm.com. > > Test: angle_end2end_tests, angle_deqp_*_tests > Bug: b/42267264 > Bug: angleproject:394384906 > Change-Id: Ia10bcd61f66c5d99a3d27a2cfd6008c991ddcaa7 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6235444 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/42267264 Bug: angleproject:394384906 Change-Id: I64572361cfed33b4ea17eabf278f580471d045c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6285628 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 80093a7d 2025-02-03T08:50:21 Add GL_BGRA_EXT as a sized renderable format dEQP tests were updated to cover GL_BGRA_EXT as a sized renderable format. It was apparently always supposed to be, based on the wording of the spec. This CL adds that support and updates expectations, along with a few extra tests. Includes contributions from Robic.Sun@arm.com. Test: angle_end2end_tests, angle_deqp_*_tests Bug: b/42267264 Bug: angleproject:394384906 Change-Id: Ia10bcd61f66c5d99a3d27a2cfd6008c991ddcaa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6235444 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 15b1fb37 2024-12-29T00:38:43 Fix mixing multisampled renderbuffers and textures When querying a renderbuffer's render-to-texture sample count, the number of samples was returned. This made it look like the renderbuffer attachment is MSRTT even if it was really multisampled. When mixed with a multisampled texture (where this mistake wasn't made), the framebuffer completeness code marked the framebuffer incomplete because it looked like one attachment is MSRTT and the other is not. Test credit zephyrxiao@tencent.com Bug: angleproject:382393146 Change-Id: I9fe516d6a92033512646414f88a9848aa1e1edc9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6138979 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Panfeng Hou a504b6a2 2024-11-25T15:59:05 Support GL_OES_required_internalformat Enable GL_OES_required_internalformat GLES extension. Bug: angleproject:364069034 Change-Id: Ia57548469abff189472aa20b13ca99179c45f2c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038448 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Panfeng Hou <panfeng.hou@arm.com>
Amirali Abdolrashidi b7e0a250 2024-11-25T13:36:02 Add tests for RGB8 and RGBA8 renderbuffer usage * Added simple tests for RGB8 and RGBA8 renderbuffer usage for GLES1 and GLES2+. Bug: angleproject:352352894 Change-Id: Ie410c57ab204c2afad3f53c37578865bd9e9307f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6050343 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi e38d25b1 2024-06-21T18:22:32 Vulkan: Implement EXT_clear_texture * Added new functions to TextureVk to clear the image. * clearImage() * clearSubImage() * Both implemented via clearSubImageImpl(), with the former a special case of the latter. * For multisample or renderable images, stagePartialClear() from ImageHelper is called to add the update. * For single-sampled non-renderable images, a buffer is filled with the pixel data and applied to the image as a buffer update. * Added new update type: ClearPartial * Used for renderable textures. This includes multisample textures. * LOAD_OP_CLEAR is used in a render pass to perform the clear. * UtilsVk::clearTexture() * (Uses ClearTextureParameters) * Uses the following functions to get the VkClearValue from the input data and format: * GetVkClearColorValueFromBytes() * GetVkClearDepthStencilValueFromBytes() * ClearPartial updates can also be superseded and removed similar to Buffer updates. * Updated UtilsVk::startRenderPass() to accept a VkClearValue* as an input arg. If used, the render pass will use LOAD_OP_CLEAR. * Enabled the feature "clearTextureEXT" on Vulkan. * Added new unit tests in ClearTextureEXTTest for various formats and pixel sizes. * Added related multisample tests in FramebufferTest.cpp. * FramebufferTest_ES31.ClearTextureEXT* * Disabled some of the new tests failing using OpenGL. * Disabled stencil-only-related tests on Pineapple. Bug: angleproject:42266869 Change-Id: I89c631d68a4ed63d9991abe1783333255ade20dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5778348 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Dan Glastonbury d40d1a67 2024-09-05T14:56:46 Metal: Fix OverrideMTLClearColor handling of no texture It's possible for OverrideMTLClearColor to be called with no texture. This can happen with multiple draw buffers where the bound program executable and framebuffer has incompatible component types. When the render pass is prepared by a drawing command, these incompatible attachments are skipped. As demonstated by the new test case, when switching to the framebuffer that has previously been prepared by such a draw, if the state is clean, the render pass attachments are not updated and |texture| is unavailable for use in determining any emulated clear color. Fixed: angleproject:364687937 Change-Id: I1ec9b564dc8cdb5faf7a1ed0f935d38502ca5514 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5836314 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Devon Loehr 80149a7f 2024-07-18T18:46:08 Replace variable-length array with vector Variable-length arrays allow allocating an unbounded amount of memory on the stack. This replaces a VLA with a vector, also provides better consistency with the rest of the containers in the function. Bug: chromium:349656479 Change-Id: I1e18f9a8985de84b82da58fa5465c98dbca51e8b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5721320 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1f87cbc9 2024-07-15T13:07:35 Vulkan: Fix late-added resolve attachment tracking Resolve attachments may be added after the fact to a render pass due to glBlitFramebuffer or eglSwapBuffer. Previously, only the resolve image views were tracked by the render pass, and otherwise the state tracking (layout, content defined, etc) treated the resolve images as generically written-to by the render pass. As a result, the render pass was unable to finalize the layout of the resolve images early. Optimizing the layout of the swapchain image when the surface is multisampled for example was not done due to this issue. In this change, when resolve attachments are added late, they are tracked identically to when they are added at the beginning of the render pass, fixing the issues described above. Bug: angleproject:42265625 Bug: angleproject:42266019 Change-Id: I765560762bb8caf39ba1096fb028177201c082d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5707470 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 84eb4f73 2024-03-26T15:44:48 Add a few use-after-resolve depth/stencil framebuffer tests Bug: angleproject:7551 Change-Id: I42c1a6b8fe8714fd9c1568d216b12ee9a001aba5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5399137 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi c7985668 2024-03-19T15:52:01 Add a few use-after-resolve framebuffer tests Bug: angleproject:7551 Bug: b/330697097 Change-Id: I0006d80edc0162182b2da9cea2c0e719f90fa8e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5376619 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi b3ab67d3 2024-03-14T15:06:02 tests: Remove unnecessary .get() from RAII objects Bug: chromium:40942995 Change-Id: I82509869bce3ad8f51811188fe04267f2de04786 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370904 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 341906d5 2024-01-22T10:19:25 Vulkan: Never delay device and queue selection Previously, when multiple queue families where eligible, ANGLE delayed the decision on which queue family to use and delayed device creation until a window surface was created. This assumption was never correct. The application may start rendering to pbuffers or using EGL_KHR_surfaceless_context long before it creates a window surface. So a queue may need to be chosen regardless of its surface present capabilities. Once done, ANGLE has no mechanism to change that queue should a window surface require a different queue. This change drops the pretense to support multiple queue families properly and makes ANGLE always choose the first graphics queue family it encounters. So far, only MoltenVk seems to expose multiple graphics queue families, and choosing the first one ultimately correct for the purposes of presenting to a MacOS surface. Bug: angleproject:8478 Change-Id: I8efbfe0c8036be5f9cee01eb657f83f85a4864fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5225081 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski d18f22ca 2023-12-14T11:50:19 ANGLE: Update syncval exceptions and add test for syncval errors Trace testing found some new cases where the current sync val error messages needed to be widened to cover more cases. A test was added to reproduce the behavior seen in the Asphalt 9 ANGLE trace. Test: FramebufferTest.InvalidateAttachmentStencilOnly Bug: b/316337308 Change-Id: Icde7ad560e6949712bfd785d9969b9e179d11492 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5124314 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Yuxin Hu 4b59e4c6 2023-10-17T17:47:20 Add a test to check glReadPixels format and type In GLES 3.2 spec https://registry.khronos.org/OpenGL/specs/es/3.2/es_spec_3.2.pdf, section 16.1.2, it says the following glReadPixels type and format should work: The second is an implementation-chosen format from those defined in table 8.2... The values of format and type for this format may be determined by calling GetIntegerv with the symbolic constants IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE, respectively. The implementation-chosen format may vary depending on the format of the selected read buffer of the currently bound read framebuffer. Add a test to check that when reading from the default framebuffer, using the format and type retrieved from IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE works. Bug: b/306256081 Change-Id: I1e94087aac8c803bcc5db3515ed56291349daf28 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4950844 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Yuxin Hu cfc40d2b 2023-07-19T17:47:13 Vulkan: Adjust clear color precision for GL_RGB5_A1 FBO When clear color has more precision than the framebuffer format can hold, dithering is automatically applied on some hardware. This issue causes below dEQP tests to fail when the FBO color attachment format is RGB5_A1: KHR-GLES31.core.draw_buffers_indexed.color_masks KHR-GLES32.core.draw_buffers_indexed.color_masks Adjust the clear color precision for RGB5_A1 format to workaround the issue. We can remove this workaround once the vulkan driver fixes the auto-dithering problem. Bug: b/292282210 Change-Id: Ic3ffebd2d20c8782612619a60d1ec2cc6d613c22 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4937472 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi ffb32380 2023-10-02T16:01:37 Vulkan: Fix device creation on multi-queue devices When multiple eligible queue families are exposed by the device, ANGLE defers devices creation until a surface is made current, at which point it selects a queue family that supports presentation to that surface. This path was largely untested and was broken: - Some post-device-creation initialization was not deferred until the device was actually created - Some cap calculation depended on the chosen queue family index - Query of device capabilities was done too late, such that ANGLE could not correctly determine the level of support for ES versions. Bug: angleproject:8300 Change-Id: I2a35396d1fd08ed26d217dff07d10e9a9c1ac55f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4907895 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Yuxin Hu 9fc3baf5 2023-07-26T10:29:13 Add the missing GraphicsPipelineDesc legacy dither bit update When the app calls glEnable(GL_DITHER) or glDisable(GL_DITHER), we need to update the legacy dither bit of the renderpass that belongs to ContextVk::mGraphicsPipelineDesc. If not, there is a change that the graphics pipeline will be created with a renderpass that has outdated legacy dither bit. This results the dither being applied to the render results incorrectly: e.g. the app calls glDisable(GL_DITHER), but the render results have dithering applied. Bug: b/286921997 Bug: b/292282210 Bug: b/293349058 Bug: b/284462263 Change-Id: Ie24b95898526c9021be6e3cb7620e4050f9faaaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4722446 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Steven Noonan 613eefa3 2023-06-23T03:28:14 D3D11: fix invalidation of depth/stencil attachments This caused a crash when invalidating the depth/stencil attachments of the default framebuffer. But for non-default framebuffers, discarding depth/stencil just did nothing because "rtv.valid()" would be false. Bug: angleproject:8228 Change-Id: Ic22a29f521256af0ed4fc9c203cd6d750fcc00e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639494 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net>
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>
Alexey Knyazev 20cc4a9b 2023-06-26T00:00:00 D3D11: Fix non-trivial blits for snorm buffers Bug: angleproject:8048 Change-Id: Ifec7ea71e0ab88f545ae088b0faae4b95512a207 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4654315 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 0e7c79e3 2023-06-29T00:00:00 Vulkan: Fix resolve with multiple targets of different formats Ensure that the appropriate code path is taken when resolving into multiple target buffers of different formats. Bug: chromium:1123524 Change-Id: Ic25a52ba069a2209c907226613fde1109823c094 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650561 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Steven Noonan 113f847b 2023-06-26T12:07:52 centralize basic OS/platform detection functions We had multiple different places that defined these, and with varying naming schemes. Centralize them to be defined in platform_helpers.h. Also renaming the IsApple(uint32_t) functions to IsAppleGPU(uint32_t) to avoid ambiguous meaning: "IsApple" should mean "is Apple-vended OS" while "IsAppleGPU" should mean "is Apple GPU vendor ID". Bug: angleproject:8229 Change-Id: If4e3fc5ac1b5b8ad416663950a1b2ee912ccad99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647291 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 21f16cb1 2023-06-09T17:30:38 Disable clang-format on ANGLE features autogen outputs Updates the script to produce reasonably formatted code without clang-format. Autogen files moved to autogen/ sub-directories because clang-format does not support per-file settings ;( This allows to run this codegen very quickly (~50ms on my machine) Bug: angleproject:8193 Change-Id: Ie84282090d574ebb4debe3edcfd82f983f27a5ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4604578 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mike Schuchardt 6732791c 2023-04-05T10:16:13 Vulkan: Include image layout in DS cache key The image layout for a texture can change from GENERAL to SHADER_READ_ONLY_OPTIMAL when switching from rendering with a feedback loop to not. The descriptor set cache needs to take image layout into account otherwise it can return a false hit in this case, resulting in the re-use of a descriptor set with the wrong image layout and validation error VUID-VkDescriptorImageInfo-imageLayout-00344. This change also includes a regression test to reproduce the behavior of the application where it was observed. Test: angle_end2end_tests --gtest_filter="*FeedbackLoopTextureBindings*" Test: Run com.gameloft.android.ANMP.GloftGGHM on Pixel 6 Bug: b/268091452 Change-Id: I80b4e2373963247a83f8ec17028445f54c820e86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400824 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev b26b01a2 2023-03-09T00:00:00 Implement EXT_render_snorm Bug: angleproject:8048 Change-Id: Id01beaea9565f8ab374c732fef70ec0ac0d8743e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4334303 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev e2cf65ed 2023-02-22T00:00:00 Implement QCOM_render_shared_exponent Fixed: angleproject:8043 Change-Id: Ia76b8e4b60a640180bae77cba523142749051398 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289140 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 87815de2 2022-12-01T00:00:00 Adjust GetFramebufferAttachmentParameterivBase validation GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT state queries should be allowed for ES 2.0 clients when floating-point color buffer extensions are enabled. Bug: angleproject:7853 Change-Id: I4a0a3b336e44648635233be54f598a3ab20cf717 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4071926 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 5c0b329e 2022-10-19T16:59:58 Vulkan: Clean up rotation spec const update Update during makeCurrent was done by invalidating the program, and then at pipeline creation time the spec const was updated. This is changed so that makeCurrent updates the spec const directly, and avoid invalidating the pipeline. Also removes spec const usage calculation, as it's unused. Bug: angleproject:7369 Change-Id: I79444ce4173c4db9c6800fb02afd9e8447a25f82 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963853 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi c19ec948 2022-08-23T10:43:59 Vulkan: Implement imageless framebuffers * Added the attachment image and create info objects to be used for imageless framebuffers created in getFramebuffer(). * New helper class for framebuffers in RenderPassCommandBufferHelper: MaybeImagelessFramebuffer, which includes a framebuffer object, if the framebuffer is imageless, and the image views. This is to make sure that the args for render pass begin info will be correctly set up according to the status of the used framebuffer. * Refactored the collection of attachments in getFramebuffer() into a new function, getAttachmentsAndImagesFromRenderTargets(). It also returns their corresponding ImageHelper* objects used to create the framebuffer (from their image properties). * New struct: RenderTargetInfo; which keeps track of render targets and whether resolve image should be used for the render pass in the form of the enum class RenderTargetImage. * Added a new arg to getFramebuffer(): resolveRenderTargetIn; to use when there is a valid resolveImageViewIn. * Without using the framebuffer cache, we would require to handle the framebuffer destruction by adding it to the garbage instead of releasing it. For example, FramebufferVk::destroy() now adds mCurrentFramebuffer to the garbage. * Added new framebuffer unit tests. * Added tests where two textures with different attributes are bound to the same framebuffer before drawing, one after another. * Added test where a blit occurs from a multisample texture into a non-zero level of a resolve texture, each bound to a separate FBO. * Added a new perf test to compare performance for enabled imageless framebuffers vs disabled. (Credit: cclao) Bug: angleproject:7553 Change-Id: Iacdbd73aaa01cbb0e37abf01ae4892bdfdd4b12f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827644 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Yuxin Hu 053c6a06 2022-09-20T15:17:28 Vulkan: Add more tests for attachmentless framebuffer This CL adds below test scenarios for attachmentless framebuffer: 1. Create first attachmentless framebuffer with larger size, and create second attachmentless framebuffer with smaller size. 2. Create an attachmentless framebuffer with smaller size, and grow its default width and height. 3. Create an attachmentless framebuffer with larger size, and shrink its default width and height. 4. Create an attachmentless framebuffer with larger size, given it an attachment with a medium size, and shrink its default width and height. This CL also splits the test failure bugs on different vendor and renderer to different bug tickets. This CL addresses a bug on vulkan backend: only skip onFramebufferChange() if the framebuffer has at least one attachment, and mCurrentFramebufferDesc equals to priorFramebufferDesc. Otherwise in test scenario 2 and 3 above, we will use the wrong scissor size, because the FramebufferDesc remains the same before and after changing the default width and height, and we will wrongly skip onFramebufferChange() where we update scissor area to match with the new default width and height. Bug: angleproject:7666 Bug: angleproject:7697 Bug: angleproject:7699 Bug: angleproject:7700 Bug: angleproject:7705 Change-Id: Ieb143b27f8c1a229dab8f43d0a16e3e871185941 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3908332 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2debd07d 2022-09-21T11:40:18 Automatically query status of features for tests Now tests can skip based on what features exist, compared to what features are explicitly asked for. For example, a test suite may override-enable a (normally disabled) feature that depends on a hardware capability. With this change, it can be skipped if said hardware capability doesn't exist. As a bonus, tests now correctly skip if the feature is overriden through an environment variable. This change also cleans up VulkanPerformanceCounterTest tests which did the same for a number of specific features. Bug: b/243398683 Change-Id: I84f026e3394eab56fd123e02bee72720c7ed94c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3909789 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Yuxin Hu 0fefbe83 2022-09-14T15:20:00 Vulkan: Do not cache the FramebufferHelper with no attachment If two FBOs don't have any attachments, and their GL_FRAMEBUFFER_DEFAULT_WIDTH and GL_FRAMEBUFFER_DEFAULT_HEIGHT are different, there is no difference in their cache key (vk::FramebufferDesc). Therefore the Vulkan backend is not able to distinguish between the two FBOs. This can create issues when we 1. create first FBO with a smaller size, renders to it 2. create second FBO with a bigger size, renders to it The second renderpass will use the FBO created in the first renderpass, because it managed to retrieve the first FBO from the cache with the same cachekey. This triggers the vulkan validation error: VUID-VkRenderPassBeginInfo-pNext-02853, saying the render area exceeds the framebuffer size. This CL fixed it by not adding the FramebufferHelper to the cache, if it doesn't have any attachment. These framebufferHelpers are cheap, without cache there should not be much performance drop. Bug: angleproject:3579 Bug: angleproject:7351 Bug: angleproject:7666 Bug: b/246334302 Change-Id: Iddecafddb042bd16401f983f9ee1a021b845d8bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3891543 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 3657b0ca 2022-09-14T11:24:00 Vulkan: Add end2end test for fbo with no attachment Add a test for fbo with no attachment and then change the fbo size. There is a bug in vulkan backend that discovered with deqp tests, and this CL creates a end2end test for that. Bug: b/246334302 Change-Id: I9b70afb958cda02140bf1007b71095ee3f922e38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3893015 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Mohan Maiya b32091b4 2022-08-17T16:00:02 Vulkan: Bug fix related to pre-rotation code Account for possiblity that the draw and read surfaces are different when querying pre-rotation information. When updating mCurrentRotationDrawFramebuffer and mCurrentRotationReadFramebuffer, make sure to query pre-rotation information from current draw and read surfaces. Bug: angleproject:7581 Test: FramebufferTest_ES3.BlitWithDifferentPreRotations* Change-Id: Ibe7a2450907e53aa5c33e13cff00059ab2f6602e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3836491 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao badfeecd 2022-08-10T14:38:43 Vulkan: Destroy fb1 should not affect fb2 with same attachments If two FBOs has the same attachments. they will share the same VkFramebuffers. Destroy one fbo should not cause trouble for the other fbo. Bug: chromium:1351170 Change-Id: I032da8cc12eb8556c3e325c8fd7a3de9974ae909 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3824302 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Eddie Hatfield 89e38b57 2022-06-22T15:04:08 Refactor to use ANGLETest vs ANGLETestWithParam Bug: angleproject:6747 Change-Id: I72ad52d0268eae0e1a401f12f3e94cc5efa402f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Eddie Hatfield 707323c1 2022-06-21T18:53:05 Miscellaneous C++17 refactoring Bug: angleproject:6747 Change-Id: I792ba74e03145ff6c3cc97d4bff6327ab275a2c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719001 Commit-Queue: Eddie Hatfield <eddiehatfield@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gregg Tavares 94320a83 2022-05-27T17:41:29 Metal: Validate total bits used in color attachments Metal has 2 limits for color attachments. 1 the number of attachments supported. 2 the total number of bits it can write per pixel. So for example Apple4 through Apple8 GPUs can have 8 attachments but only 512bits of output. That means you can attach 8 RGBA8 textures (256bits), but you can't attach 8 RGBA32UI textures (1024bits). If there are too many bits then return FRAMEBUFFER_UNSUPPORTED from checkFramebufferStatus and INVALID_FRAMEBUFFER_OPERATION from draws Bug: angleproject:7280 Change-Id: I935aebad4d57664f59a60be20a927d6b69afb4ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3674322 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi 2df17a12 2022-05-25T16:18:37 Vulkan: Pack driver uniforms Previously 5 vec4s were used for driver uniforms + 2 vec4s if specialization constants couldn't be supported. The driver uniforms are rearranged and packed such that only 2 vec4s are normally used, which include fallback for specialization constants as well. In the future, most of the specialization constants may turn into uniforms, and this change prepares for that. Additional uniforms are used (3 vec4s) only if common extensions are missing; transform feedback and bresenham lines. This change makes it more practical for driver uniforms to be turned into push constants. Additionally, these uniforms could potentially be loaded and cached at the beginning of the shader for more efficient memory access. On Pixel6, with this change, the traces show no difference in wall time. On most traces, CPU time shows up to ~7% improvement. Bug: angleproject:7366 Change-Id: I0f47f863955af06a19c69d1f1d7c45b97d95476e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668151 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Lubosz Sarnecki c8989675 2022-05-20T10:56:54 FramebufferTest: Add FramebufferConditionalFeedbackLoop test. Add an end2end test that reproduces VVL error seen in runescape. The test passes on OpenGL/ES. Add Vulkan test to expectations. Test: angle_end2end_tests --gtest_filter="FramebufferTest_ES3.FramebufferConditionalFeedbackLoop/*" Bug: angleproject:7357 Change-Id: I1b41503f65ea65aa0600b54e04a3ac1dd55c82aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664476 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 389ae6b9 2022-05-09T08:44:50 Add extension for read-only DS feedback loops. This will facilitate testing. Also moves some feedback loop tests from FramebufferTest to a specialized test class. Bug: angleproject:4778 Bug: angleproject:4969 Change-Id: I61235f2663a58644bf506254a869f550f1706de3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634726 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Stephen White e9dc0f86 2022-05-10T12:44:28 Cleanup from glBlitFramebuffer() 3D texture fix. Some minor refactoring. Move skips to test expectations and add a bug ID. Bug: angleproject:7291 Change-Id: I8d900a26508a28f6202a009c770cffb0e623dc5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638985 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stephen White 8e121571 2022-05-06T13:27:06 D3D11: fix 3D texture blits. Change-Id: Icf8b061bb8f5d3e1cdd03f75fdecf16157abc0e5 Bug: angleproject:7272 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3631348 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lubosz Sarnecki 98488a19 2022-04-28T11:53:21 FramebufferTest: Add FramebufferChangeTest test. Add an end2end test that reproduces VVL error seen in Black Desert Mobile that states "Render pass closed due to framebuffer change". The test passes on OpenGL/ES. Add Vulkan test to expectations. Test: angle_end2end_tests --gtest_filter="FramebufferTest_ES3.FramebufferChangeTest/*" Bug: angleproject:7139 Bug: angleproject:7186 Bug: b/181797364 Change-Id: I661a55a5d9322c51cbed20de1ffcc477cb6a4dc6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3560601 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 400d9fe4 2022-04-23T01:08:19 Rename feature files to *_autogen.h To clarify further that they are not to be edited by hand. Bug: angleproject:6435 Change-Id: Iaf79706d2b688a43b3ebb65700cfbdd71a49a742 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603842 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8074061d 2022-04-09T01:03:53 Remove feature override platform methods Instead, the tests now use the enable() functions to override the feature at platform level. This fixes the forceFallbackFormat feature mistakenly not having been tested. Bug: angleproject:6435 Change-Id: I605e4133407282bd52232887b595af0d2c13575d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3577369 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 797e627e 2022-04-08T22:49:51 Autogenerate list of features as enum The WithX() and WithNoX() helpers are removed and replaced with enable() and disable() member functions that take the name of the feature (as a Feature::X enum constant). This has two benefits: - Adding tests that override a feature no longer requires additional helper functions to be written. - There's no mistaking the feature name. This change doesn't yet fix the main issue in anglebug.com/6435, but does fix the following helpers using an old feature name (so they were ineffective): - WithMetalForcedBufferGPUStorage - WithNoVulkanViewportFlip A follow up would remove the old way of overriding features in tests and replaces them with the new way. Bug: angleproject:6435 Change-Id: Ida02b26ec72bc40d7a8938c76a93815bb903ca05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580982 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a16491d9 2022-04-05T16:47:32 Vulkan: Fix invalidation of non-existing aspects If the app uses a stencil-only attachment but invalidates depth, UNREACHABLE was hit. If the app uses a depth-only attachment but invalidates stencil, ANGLE was proceeding with an attempt to invalidate it (with no side effect). Bug: angleproject:7178 Change-Id: Idc177bdb66b2d0b3b3c2d36f5cadc7b9126a42c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573383 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan a02fa8a0 2022-03-24T22:14:44 Vulkan: mark image contents defined on clear-invalidate-clear The backend was ignoring "repeated clears" with an Invalidate between them, which marked the image contents as undefined. When a clear happens after invalidate, verify that the clear parameters were the same, and simply mark the image contents defined if they aren't already. For example, in this scenario: - glBindFramebuffer(fbo) - glInvalidateFramebuffer(color + depth) - glClear(color + depth) - depth only render - glInvalidateFramebuffer(depth) - glBindFramebuffer(0) The color clear got skipped entirely because it was cleared with that color in a previous frame and no other color draws happened since. This caused sampling from the FBO's texture to return garbage data. Bug: angleproject:7127 Change-Id: I4ffe65c67375931ab63f07f27fa59ed0a4b90cd9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3551297 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3f331fae 2022-03-22T15:23:38 Vulkan: Dirty bits for depth/stencil access and feedback loop In preparation for doing the same for color, the depth/stencil render pass access and feedback loop modes are now updated with ContextVk dirty bits. This change also fixes clear after read-only depth/stencil feedback loop. The render pass wasn't broken in that case. Bug: angleproject:5048 Change-Id: I40f9b49593f9e6f35f42408e41c9d6267edb375e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3542988 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c8f86c21 2022-03-22T17:40:43 A handful of clear-related tests Credit Tim Van Patten <timvp@google.com> Bug: angleproject:5048 Bug: angleproject:5194 Change-Id: I00eccf1049118c3fba3c2c560c781cf09cf23362 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3543732 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ea70300b 2022-03-01T14:55:00 Fix base level changes not updating FBO completeness check. Bug: chromium:1299264 Change-Id: I0881a4916c3eeb9ee023d28d207795899417d530 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498282 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Auto-Submit: Jamie Madill <jmadill@chromium.org>
Jamie Madill 348ece42 2022-03-01T15:40:38 Vulkan: Fix issue with redefining a layered attachment. The fix ensures we complete level redefinition before we get the layer render target in TextureVk::getAttachmentRenderTarget. Bug: chromium:1296866 Change-Id: Id7fa8e9fed5e766c30580b09336713c675c4e4f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498283 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8d966f7d 2022-02-08T11:05:09 Vulkan: Simplify SubAllocation data types. We no longer need to bootstrap on the wrapper classes because we use a separate garbage list. This simplifies the code for the allocation tracking considerably. Also we remove a few mutable accessor to fortify our OOP design. (Credit to Jamie since it is splited from his CL) Bug: angleproject:6980 Change-Id: I2025ec4d141531273e824bb586957a38efc30be1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469715 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Maksim Sisov 4572a176 2022-01-03T13:29:59 Add support for GL_MESA_framebuffer_flip_y 3/* This is a third CL that adds tests that exercise the extension in various use cases. Bug: chromium:1231934 Change-Id: Iae3192cd0985150b6844a2855a9a048a54353655 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3365195 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Maksim Sisov <msisov@igalia.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>
Shahbaz Youssefi 1047af38 2021-12-02T14:30:42 Fix changing attached renderbuffer from MSRTT to non-MSRTT FramebufferAttachment::mRenderToTextureSamples was never updated if the renderbuffer storage was changed after attaching to framebuffer. Bug: chromium:1272068 Change-Id: Ib0cfde53c3453c0df4b0aea32ab0a246aa2ade7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313414 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 91d36473 2021-11-08T16:27:20 Fix invalidation of GL_FRAMEBUFFER invalidating READ FBO Per spec, GL_FRAMEBUFFER means GL_DRAW_FRAMEBUFFER for glInvalidateFramebuffer. Bug: chromium:1267424 Change-Id: I8c9ab61ecdbd4ccee4262dc8559b2feb02b4837c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3266176 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan fb82ec3c 2021-10-20T16:45:30 FramebufferTest: fix read overruns in glTexImage2D upload The dimensions specified in glTexImage2D did not match the size of the arrays of pixels. This was tripping AddressSanitizer, which noticed it was reading past the end of the arrays. Bug: angleproject:4737 Bug: angleproject:6600 Change-Id: Ie9e1705136a4b7f853b3a897e3c294c953c475f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3235904 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f3d5dac3 2021-08-23T17:25:15 Vulkan: SPIR-V Gen: Drop dependency to glslang The SPIR-V gen path is now made default. Compilation through glslang is still supported for debugging, and is enabled on the GLSL* end2end tests for smoke testing. On release builds, glslang is not supported. To test with glslang, add the following gn arg (only necessary if dcheck is disabled): angle_enable_spirv_gen_through_glslang = true Then enable the generateSPIRVThroughGlslang feature. This can be done by setting an environment variable: ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests Binary size saving: - 1.3MB on Linux (SPIR-V gen itself: 240KB) - 730KB on Android (SPIR-V gen itself: 140KB) Perf tests: - LinkProgramBenchmark.Run/vulkan_compile_single_thread * Through glslang: truncated mean: 1287033.36 * Direct SPIR-V Gen: truncated mean: 244495.91 (~80% reduction) - LinkProgramBenchmark.Run/vulkan_compile_multi_thread * Through glslang: truncated mean: 4565894.83 * Direct SPIR-V Gen: truncated mean: 1158164.10 (~75% reduction) Bug: angleproject:4889 Bug: angleproject:6210 Change-Id: I486342702977c8114e90073b97183aba115a8b2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jonah Ryan-Davis 212f4592 2021-09-22T12:02:47 Enable direct-to-metal backend by default We are switching over to Apple's direct-to-metal backend instead of generating SPIRV in the metal backend. This CL enables the direct-to-metal generation by default, but the SPIRV backend is still accessible by overriding the feature directMetalGeneration. This CL comes with a change in test expectations to catch new failures and clean up newly passing tests. Bug: angleproject:6080 Change-Id: I4b10ad93c641b88857079a08fb45d3dc575d71f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3175664 Reviewed-by: Gregg Tavares <gman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Charlie Lao c5d11128 2021-09-02T18:18:02 Vulkan: Skip but keep incompatible updates. If texture has a level incompatibly specified, right now we are still oding the copy. This will trigger VVL and is incorrect. This CL skip the flush and keep it. Also Add various tests for 16 bit texture format in preparation for future CLs that may pick a more native format for 16 bit texture instead of always fallback to 32 bit. Test: VulkanFramebufferTest.R4G4B4A4TextureSampleOnlyActuallyUses444Format Bug: b/196456356 Change-Id: I9d53a97bb72208b52fb25e429abb49bbbc53c50c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3141030 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3b0fcf6a 2021-06-30T15:14:48 Vulkan: SPIR-V Gen: Support type casts in constructors GLSL basic, vector and matrix constructors can convert between types. This was already done for constants used in constructors. This change implements the cast for non-constant expressions. Bug: angleproject:4889 Change-Id: I0a8c1a6e97ffced0d1652032a41fb87c70be16ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2999022 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao a280c671 2021-05-24T19:05:44 Vulkan: Move framebuffer dirty bits handling after texture When texture changes, it notify the observer. Framebuffer object is one of the observer and is able to respond to the changes in texture object. In this specific case, when texture called TextureVk::releaseImage and requires framebuffer object to syncState and call TextureVk::initRenderTargets. The problem right now is that framebuffer object's dirty bits are processed before texture, which means if the texture is being used by currently bound framebuffer object, it will not trigger the FBO's dirty bit handling. This CL moves container object dirty bit (DIRTY_OBJECT_DRAW_FRAMEBUFFER and DIRTY_OBJECT_READ_FRAMEBUFFER) after texture/image object's dirty bits. Bug: chromium:1212206 Bug: chromium:1197431 Change-Id: I95723da1ce5b8936d66692242f2e25e7a73bafe6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2915764 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 7761ed1d 2021-05-11T22:55:15 Add test for Vulkan crash with texture MAX_LEVEL change Bug: chromium:1197431 Change-Id: I05fba78b32a7c5d5f1da0435084f96c510b15ed5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889600 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> 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>
Charlie Lao aa2d400a 2021-04-12T17:21:37 Vulkan: Add test for FBO with unequal sized attachments Before OpenGLES3.0, framebuffer object with unequal sized attachment is considered incomplete. That restriction has been removed in ARB version of spec and is legit use in OpenGLES 3.0. This adds a test for this specific usage. Bug: b/181800403 Test: FramebufferTest_ES3.AttachmentWithUnequalDimensions Change-Id: I79608bfd8f10855c6fc47511e080ba3ca4e46c59 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2824366 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5eac3169 2021-04-09T15:54:11 Vulkan: Support sample/render to depth texture with different LOD Previously we supported read only depth attachment that attachment and sample are using the same texture. It was always assuming it will be read only if the same texture is attached to FBO and same time bound to texture unit. But we never supported if it actually writing to depth texture, but at the different level with sampling. This is supported OpenGL operation as long as the levels render to is outside [base_level, max_level]. Later on, we added support of the above operation, but limited to color buffers. This CL extends the same support of render and sample to the same depth texture with non-overlapping levels. Android game black desert mobile is running into this usage case. Bug: b/181797383 Change-Id: I7ee1d52f27603f933102ad1b098684309449c406 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2819487 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao e55462b9 2021-04-09T18:27:16 Vulkan: Add test for render+sample depth texture with non-overlap LOD Render and sample from the same texture and then bind to another FBO without trigger texture bind should still detect the condition that it is render and sample same texture. Render to depth texture and sample form the same depth texture but with non-overlapping levels should work. Bug: b/181797383 Test: FramebufferTest_ES3.SampleFromAttachedTextureWithDifferentLODAndFBOSwitch Test: FramebufferTest_ES3.RenderSampleImmutableDepthTextureWithExcludedLevel Change-Id: I0d330d6f9530eb4fea417019a627890c4a5c1154 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2819486 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao afd32d8e 2021-03-30T15:50:57 Vulkan: Remove mMaxLevel from ImageHelper class This CL removes mMaxLevel from ImageHelper class. Instead, it now uses front end's max level information when possible. Bug: b/181800403 Change-Id: Ie0f6bd11e3ca0d4ddfc98f21261396c4d71b7140 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2796153 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao b5a71140 2020-08-20T17:24:21 Vulkan: Make storage actually immutable for immutable textures The immutable textures are intended to be "immutable". Right now we are still re-allocating VkImage object based on base_level and max_level. This causes a problem for rendering to a level that is beyond [base_level, max_level], which is totally within OpenGL spec. This CL makes an immutable texture always allocate from 0 to max levels that are specified by a glTexStorage call. Changing base_level will not trigger re-allocation of VkImage object. Bug: b/181800403 Change-Id: I4b4ddea17b7f6f7bfd8f36bfe8bb3a35b5c180b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2368038 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao a9bcbac3 2021-03-31T15:30:42 Vulkan: Add test render to immutable texture will flush There was a bug that if there is a pending update in the immutable texture's level that is outside of [base, max], and then when you render to that level, the pending update will not get flushed. This test verify this bug. Bug: b/181800403 Test: FramebufferTest_ES3.RenderImmutableTextureWithSubImageWithBeyondMaxLevel Change-Id: Id9a5a141d26d45a3a154c331086bb64b0b094cdf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2797724 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao ef17c650 2021-03-08T18:50:53 Vulkan: Add test for filament gltf usage case filament gltf sample code is rendering to a level that is excluded from [base_level, max_level]. This is allowed by OpenGL spec. We are crashing right not. This CL adds tests for the exact usage pattern for filament. Bug: b/181800403 Test: FramebufferTest_ES3.RenderAndInvalidateImmutableTextureWithBeyondMaxLevel Test: FramebufferTest_ES3.RenderAndInvalidateImmutableTextureWithSubImageWithBeyondMaxLevel Test: FramebufferTest_ES3.RenderAndInvalidateImmutableTextureWithBellowBaseLevelLOD Change-Id: I69bab8bc3961bbc2dcc78ba2db3c8759f277416b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2752897 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao d5bc8a27 2021-03-17T18:21:35 Vulkan: Add VUID-vkCmdDraw-None-04584 validation error to ignore list Aztec ruins is using the same texture (but different level controlled by a uniform variable) for textureLod and rendering. This triggers vulkan validation error. This CL put it in the ignore list so that it can pass. Bug: b/175584609 Change-Id: I7623e7b448514b3c12268aa5fe154f4c2f59b059 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770686 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 867411a4 2021-03-08T19:08:14 Vulkan: Track images used for both attachment and sampler This CL adds a new layout ImageLayout::ColorAttachmentAndShaderRead. We detect that the same ImageHelper object is used for both sampler and attachment and will pick this new layout instead of ColorAttachment. Bug: b/175584609 Change-Id: I2089f59d4dc1ad4de7edab0e067797adcfa9b020 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2749479 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 1f1b4ffe 2021-03-08T11:44:28 Vulkan: Test render and sample the same texture but with different LOD This simulates aztec ruin's usage. This works properly on native OpenGL but generates validation error on vulkan backend and renders incorrect as well. Bug: b/175584609 Test: FramebufferTest_ES3.SampleFromAttachedTextureWithDifferentLOD Change-Id: I402c205a1b625669cae29ee201dddd144e0dfbde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743797 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Yuly Novikov a6b16d29 2021-03-02T19:04:57 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Ozone We only support ES2 on Ozone, so tests that depend on ES3 or ES31 support are not instantiated there. Bug: chromium:1183147 Change-Id: Id58bcd9b44a5b9a70b5ae8115e27c44f5dc81226 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2726550 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi bc82325e 2020-11-24T21:58:30 Fix RedGreenGradient to not output 0 for half the image The shader directly used v_position.xy as output color, but for half of the image x and y are negative and the respective channel became zero. This change makes the shader use v_position.xy*0.5+0.5. Additionally, the tests that use this shader are changed to mathematically derive the pixel colors instead of using magic numbers. Bug: angleproject:5395 Change-Id: Ic11c362c22ca725aa173faa5fd6033a02a4303fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2559265 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2d964a47 2020-10-30T16:46:30 Vulkan: Defer clears even if following command is scissored Take the following scenario: 1. glClear 2. glScissor(half of framebuffer) 3. glDrawArrays The clear in step 1 is deferred. When FramebufferVk::syncState is called in step 3, the deferred clear was applied using vkCmdClearColorImage because the draw call is scissored. This causes loadOp=LOAD to be used after the clear because the render pass is started too small (the same size as the scissor). This change makes scissored operations also take advantage of loadOp=LOAD with deferred clears. A number of changes are made to this effect: - FramebufferVk::syncState no longer limits collecting deferred clears to no-scissor. - FramebufferVk::startNewRenderPass automatically expands the render area to full size if it's clearing any attachment. - A number of bugs are fixed where FramebufferVk::flushDeferredClears is called with the scissor area. Instead, flushDeferredClears now unconditionally uses the complete render area. Note that these bugs didn't have symptoms as "scissor" and "deferred clears" were mutually exclusive. Bug: angleproject:4988 Change-Id: I24fc3d88bf9c8998869b36c863692d0f0acce994 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2511371 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a0e91016 2020-10-30T10:01:36 Vulkan: Don't break the render pass on scissor change Prior to this change, the render area was decided when the render pass was started, and remained fixed. If a small scissor was initially used, this created a render pass with a small area. If then the scissor region was expanded, the render pass was broken. This change instead expands the render area on scissor change to avoid breaking the render pass. If glInvalidateSubFramebuffer previously successfully resulted in storeOp=DONT_CARE, this optimization may need to undo that. As a result, the invalidate area is stored in the render pass and if the render area grows beyond that, invalidate is undone. Bug: angleproject:4988 Change-Id: I4e8039dec53a95a193a97cb40db3f71e397568d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2508983 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Le Hoang Quyen 8a275449 2020-10-25T03:22:10 Metal: Add ES3_METAL to ANGLE_ALL_TEST_PLATFORMS_ES3 Bug: angleproject:2634 Change-Id: Iacc3aaf17565c7b16879897db4b9dac16826d829 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494526 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 265c5fa9 2020-11-02T21:50:25 Vulkan: Fix scissor update in FramebufferVk::syncState A previous change [1] made FramebufferVk::syncState update scissor and rasterization samples only when the DRAW framebuffer is synced. This is incorrect as the READ framebuffer is synced before the DRAW framebuffer, and if the two are the same, the latter is discarded. Very few functions sync both READ and DRAW framebuffers when they are identical. A test is tailored to expose this bug. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/2510013 Bug: angleproject:4988 Change-Id: I6123ac18dded938171bc90a04d4d81f1b42a1694 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2515742 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 57f7c9b5 2020-10-29T16:31:46 Vulkan: Fix prerotation bug with glInvalidateSubFramebuffer The area passed to FramebufferVk::invalidateSub is not rotated, but was being compared with the rotated framebuffer dimensions / render area. Bug: angleproject:5264 Change-Id: I2de181bf77ad650418b757a3848395bbdab13d8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2508978 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Le Hoang Quyen 1c881dad 2020-09-27T01:35:31 Metal: Implement glRenderbufferStorageMultisample(ANGLE) Bug: angleproject:2634 Change-Id: Ia4dd477cfbad298994036705b43f3a5877e3c9cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2433330 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten a3d5a6e3 2020-10-07T15:03:40 Vulkan: Call onColorDraw in resolveColorWithSubpass We are currently calling onImageRenderPassWrite() on the read render target within resolveColorWithSubpass(). We need to instead call onColorDraw() on the draw render target, since that's what's actually being written. Bug: b/159903491 Test: CQ Change-Id: I577381d91228e132950455d2e872fbb9b066d0c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2458850 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Trevor David Black e815afbf 2020-09-07T22:09:22 First pass at increasing inclusivity Link to the inclusivity rules https://source.android.com/setup/contribute/respectful-code Bug: b/162834212 Bug: chromium:1097198 Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Trevor Black <vantablack@google.com>
Shahbaz Youssefi cba9bbbe 2020-09-02T09:55:31 Vulkan: Fix resolve-with-subpass retaining resolve attachment The temporary resolve attachment used to optimize blit was not removed from the framebuffer and render pass descriptions, resulting in subsequent draws to be resolved again. Bug: b/159903491 Change-Id: I9a9c90d25cb07ba9a25999f808b164f9085387d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390441 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi d701eae2 2020-09-02T12:23:21 Vulkan: Fix resolve with different formats vkCmdResolveImage and subpass resolve attachments cannot be used if the source and destination formats aren't identical per Vulkan spec: vkCmdResolveImage: > srcImage and dstImage must have been created with the same image > format VkSubpassDescription: > each resolve attachment that is not VK_ATTACHMENT_UNUSED must have the > same VkFormat as its corresponding color attachment Bug: chromium:1123524 Change-Id: Iaf7182dbcad0420483ac2c23d0acf8c109688565 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390781 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Shahbaz Youssefi 33f8e4d4 2020-08-25T12:06:35 Fix sub-invalidate of incomplete framebuffers Just like invalidate, this should attempt to sync the framebuffer after nooping incomplete framebuffers. Bug: chromium:1119669 Change-Id: Ie4bc6211bbeb1765674f7e0aef884faf7ceb8cc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2375565 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>