src/libANGLE


Log

Author Commit Date CI Message
Shahbaz Youssefi 84613b97 2024-04-09T12:36:55 Vulkan: Suppress Undefined-Value-ShaderInputNotProduced If the app doesn't write to an attachment from the shader, it'll get undefined values. Bug: angleproject:8401 Change-Id: I60f2bf510f0f0f9779f00dafbeee3b7364283bf4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5440653 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Geoff Lang 0e19adb2 2024-04-08T13:21:09 Validate non-negative vertex attribute offsets. When robust buffer access is enabled, validat that buffers cannot be read with a negative index. Bug: chromium:323699974 Change-Id: I05beb72c60832ab4decbf16c47b3d92bd374286b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5435736 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao d3aaf795 2024-04-05T15:57:38 Vulkan: Early out ImageHelper::updateLayoutAndBarrier when possible If one image is attached to more than one attach points, when render pass closes we end up calling ImageHelper::updateLayoutAndBarrier multiple times. The first one is required since it does the layout transition etc. But the second call is unnecessarily inserting memory barriers. This is optimization itself, but will also fix the other bigger problem when we start using VkEvent instead of PipelineBarrier: we may end up waiting for an event that has not been set (since setEvent gets called after we end render pass but waitEvent is before render pass. Calling this sequence twice on the same image for the same render pass means second waitEvent is called before setEvent). Bug: b/333391804 Change-Id: Ic7b409c71806e63cb56c25e10b0bd0bfc9f6086d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5431033 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 126f8269 2024-04-05T22:00:02 Additional fix for link task worker pool race See [1] for context. While that change fixed the race condition, it was not great that the task held on to the worker pool for so long. This change avoids the race condition as well by releasing the worker pool as soon as the link task has no further use for it. [1]:https://chromium-review.googlesource.com/c/angle/angle/+/5428806 Bug: angleproject:8661 Change-Id: Ibcbad0afe518e649a63dfdf938bd566c8f80e368 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5431154 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya ba208b45 2024-04-06T21:08:15 Vulkan: wait for post-link tasks in resetLayout Wait for post-link tasks before resetting ProgramExecutableVk. Otherwise mGraphicsProgramInfos, which post-link tasks use to create pipeline, can be prematurely invalidated. Bug: angleproject:8297 Tests: Texture2DTestES3YUV*DisableProgramCaching Change-Id: Ib84cebad252777ae4c37cb32c455c326911416a2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5430927 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang c632fae0 2024-04-02T15:03:17 GL: Support KHR_blend_equation_advanced Combine blend equation setting when they are equal. It is invalid to set advanced blend equations for color/alpha separately. Emit blend equation layout qualifiers. Bug: angleproject:8660 Change-Id: I1d8a88594c80027b564eed70d3b540e0b065968d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5415033 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi d55464ff 2024-04-04T14:13:02 Vulkan: Remove the supportsDepthClipEnable feature This feature is unused since: https://chromium-review.googlesource.com/c/angle/angle/+/4545084 Bug: angleproject:3970 Change-Id: I78acfda80d4ae04d1387a452e9f52a55a4298a4c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5426530 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 49e63e07 2024-04-03T13:22:30 Vulkan: Selectively wait for WarmUp tasks If the GraphicsPipelineDesc used by a draw call differs from the one being used by the WarmUp tasks there is no need to wait for their completion. Bug: angleproject:8297 Change-Id: Ibbf3ee710036936060990455bb8657d83c7b6faf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5421594 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Mohan Maiya ad13fec3 2024-03-30T15:31:49 Vulkan: warmUpGraphicsPipelineCache(...) shouldn't set state The prepareForWarmUpPipelineCache(...) method would have already setup all necessary state for the warm up task. Make that intent explicit by calling into a method that sets no state. Bug: angleproject:8297 Change-Id: I959d8591045ff05ddb2a410fd0e0eda8dd692d37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5408796 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 13829f20 2024-03-26T23:03:12 Vulkan: Optimize depth/stencil resolve with glBlitFramebuffer Like color resolve, depth/stencil resolve is now also possibly done by modifying the render pass and attaching a depth/stencil resolve attachment. Bug: angleproject:7551 Change-Id: I045e3875e24006d2473a55b6c3856dd768fe8b84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5398004 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 924b40dc 2024-04-04T18:44:21 Selectively wait for post-link tasks in the frontend The frontend waits for post-link tasks only for a relink or in syncState when `disableProgramCaching` feature is not enabled. Bug: angleproject:8297 Change-Id: If7a3b8a10a2d01f82fd2bebac5c8f378be56e19e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5427001 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 06472a7e 2024-04-04T21:07:02 Extend ProgramExecutableImpl API waitForPostLinkTasks(...) will be called into by the frontend. Backends can now choose to defer or avoid waiting for post-link tasks. Also, move warmUp task code to ProgramExecutableVk in the Vulkan backend Bug: angleproject:8297 Change-Id: Ia8a0682923e2f8c6287d62a606eed7f481cda08f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5427000 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand 76636ddb 2024-04-04T15:39:08 CL/VK: Update missing reflection ops & DS creation Adding CLProgramVk routine to allocate DS. Also adding reflection parsing support for WGS IDs and PushConstantGlobalSize. Additionally, we now check VK implementation if non-semantic reflection data (in SPIR-V) is supported. If not, we strip that data from binary (via vk_feature check). Bug: angleproject:8631 Change-Id: Ife02867c7c30b919abf663865adc92858e1bff8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5421574 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com>
Austin Annestrand 7a78c2c9 2024-04-03T14:32:35 CL/VK: Add helper to select LWS In the case where user passes NULL for LWS, the runtime has the responsibility to select an appropriate LWS for user. Bug: angleproject:8631 Change-Id: I89048c57880a5a4f18d4ef46340b73338cee933e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5421573 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Annestrand 2dc9d0cd 2024-04-04T14:38:31 CL/VK: Add workgroup size/count types Replacing existing CompiledWorkgroupSize type with "WorkgroupSize" and "WorkgroupCount". (since CompiledWorkgroupSize == WorkgroupSize). Bug: angleproject:8631 Change-Id: I4094d10e6ad5db51a56ae92fe4f2fb4a6e72bdc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5425447 Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya ac654931 2024-04-04T15:42:47 ProgramExecutable manages post-link tasks Post-link tasks are now owned and managed by ProgramExecutable. Also, update `LinkTask::link` API so backends have a choice to populate either the linkSubTask or postLinkSubTask containers (but not both). Bug: angleproject:8297 Change-Id: I5dbed6a070efe851fc1376699e9eccd3a21bd03f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5406487 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Matthew Denton be42f20b 2024-03-22T05:45:46 Start implementing glClear Currently, because both SurfaceWgpu::getAttachmentRenderTarget() and TextureWgpu::getAttachmentRenderTarget() are unimplemented, there is no actual RenderTargetWgpu in the RenderTargetCache to clear. Bug: angleproject:8582 Change-Id: I9ad33c57d533d81178d7d2a802d35b106ece5848 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388076 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Austin Annestrand 35c7e186 2024-04-03T14:31:59 CL: Introduce NDRange object/ops abstraction Create new FrontEnd type "NDRange" to encapsulate OpenCL's NDRange items. Update backend implementations to make use of this new object. Bug: angleproject:8650 Change-Id: I3c1549c50c85153b3ea77267e104eec04ba1bd93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5421572 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev cdbc58f1 2024-04-04T00:00:00 Metal: Align texture view constructors with the API Fully expose Metal API parameters through texture view constructors. No behavioral change. Bug: angleproject:8355 Change-Id: I2a55f1e799d6e06b2528eefdee4bf5936e5b4301 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5426671 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Erica Li 3b650ffa 2024-03-19T09:53:06 Metal: Assert while using gl_VertexID as ivec Metal [vertex_id] is uint while gl_VertexID is int. Replacing gl_VertexID with gl_VertexIDMetal without rewrites of the expressions would cause invalid expressions. Fix by casting uint kgl_VertexIDMetal to int kgl_VertexID instead of replacing variable during compile. Bug: angleproject:8597 Change-Id: I76acdb2a0ab5982aa05181175925b3359068e901 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5376498 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Matthew Denton 5c6a531e 2024-04-03T02:53:13 Add ContextWgpu methods for managing current render pass For simplicity ensureRenderPassStarted() just ends the current render pass and starts a new one. Bug: angleproject:8582 Change-Id: I929526cf2574fa33309310e7f60191c10ab3bf7a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388075 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 103c1b53 2024-03-29T14:37:23 Vulkan: Drop MSRTT emulation dependency on independentResolveNone Usage of VK_RESOLVE_MODE_NONE was removed in [1], but dependency to this property was accidentally added in [2]. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/2743666 [2]: https://chromium-review.googlesource.com/c/angle/angle/+/3353895. Bug: angleproject:4836 Change-Id: I25028b5d343686edd794acdac3714c4a6cb5fa17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5407073 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 57eded36 2024-04-03T23:02:39 Vulkan: Fix off-by-one error in compute-based stencil blit The coordinates used for sampling were calculated based on pixel's top-left (integer) coordinates and used with a NEAREST sampler. This resulted in two bugs: - When X was flipped, the bounds check rejected the first column - The sampling could pick the wrong pixel as the on-the-edge coordinates could map to either of 4 pixels that share that corner. This change moves the sampling coordinates to the pixel's center. Bug: angleproject:8652 Change-Id: I0b54fa0bad366f52f8e6c17bb0054fa373af8b5c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5420834 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 58ecad7a 2024-04-03T23:12:05 Remove assertion that program is not linking when bound/unbound It's valid to link a program, let it happen in parallel and in the meantime bind and unbind the program in other contexts. The add/release ref functions were asserting that link is resolved, which is not true in that case. Bug: angleproject:8647 Change-Id: I784b5adbb04f062752a873deb1e7a4aaf4527e33 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5420990 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Hailin Zhang dc643d9b 2024-04-01T15:59:46 Vulkan: add feature control for client buffer merge add feature control for client attribute buffer merge. default is off to reduce memeory usage for some application. Bug: b/328301788 Change-Id: I5bfd39fb1ea656ebb29bd2dc21726b60bbc1a8d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5410942 Commit-Queue: Hailin Zhang <hailinzhang@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev ceb3c0e1 2024-03-28T00:00:00 Remove redundant AND from ValidateClear Component types of disabled draw buffers are already set to zero. Bug: angleproject:8618 Change-Id: I193dc6249158c6314076fedc7b4f43261d81f074 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5419708 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand ff03a7b1 2024-03-19T10:54:22 CL/VK: Program build_status & mCallback fixes Was missing saving the build_status in the program export/binary to disk. Also, missing dereference for mCallback. Bug: angleproject:8435 Change-Id: I77f070f5bc1c40454d625abcf13c1a4b70c465b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5406613 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Gowtham Tammana bb70f5d1 2024-03-13T06:02:40 CL/VK: Setup platform as provider of vk::Context Setup the CLPlatformVk to be the implementer of `vk::Context`. Initialize the Renderer instance during platform setup. This removes the dependency on the DisplayVk instance and as a consequence any associated egl state. Bug: angleproject:8515 Change-Id: If1848b002d6309911305ca3cb93c316ed7f48965 Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5406612 Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya e4fe461f 2024-04-01T16:41:37 Vulkan: Apply mask during transition search When checking the transition cache for the shaders subset, mask transition bits with kShadersTransitionBitsMask Bug: angleproject:7369 Change-Id: Ic8e4ad00312d5e601dbfc0d84bbc76e809358427 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5410940 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 64cfbb68 2024-04-02T13:22:09 GL: Fix MultisampledRenderToTexture tests and expectations Some MSRTT tests were failing on the GL backend due to exact GL_EQUAL depth tests, others were marked as skipped on all of Android due to old device issues. Update the Android expectations for these tests. Bug: angleproject:8642 Change-Id: I2aad2637773967102a6172fd0a8ae2cb58a420ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5413775 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com>
Alexey Knyazev abf7b612 2024-03-28T00:00:00 Optimize WebGL clear type validation Use cached component type masks instead of iterating over all attachments every time. Fixed: angleproject:8618 Change-Id: I45b83639120c0b4f50027d1d85fe9158f5cf187d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5407657 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Gowtham Tammana a8e9aa26 2024-03-11T23:50:18 CL/VK: Setup GlobalOps for the platform Setup CLPlatformVk as a provider of vk::GlobalOps, and use the vk::GlobalOps associated thread pool for async tasks. Bug: angleproject:8515 Change-Id: I3e1ae069afabeadfdfa02f4a2f99419882f91c6a Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5403225 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 85b3e967 2024-04-01T14:31:17 Fail link and validation of invalid tessellation program The GL_EXT_tessellation_shader spec says - The tessellation control and evaluation shaders are both optional. If neither shader type is present, the tessellation stage has no effect. However, if either a tessellation control or a tessellation evaluation shader is present, the other must also be present. Fail link and validation if a program contains TCS or TES shader but not both. Bug: angleproject:3572 Tests: KHR-GLES32.core.tessellation_shader.single.xfb_captures_data_from_correct_stage Change-Id: I6799f101a186f3bfae738df442e9aeee691fd91a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5410646 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Gowtham Tammana 47ca7552 2024-03-07T14:19:06 CL/VK: Select Vulkan Angle as platform Ask for Vulkan Angle platform when setting up the platform. Else it is picking from the default one, which might not be Vulkan. Bug: angleproject:8515 Change-Id: I1f43a5de3eb2c72900631695e2b3a5ffef3d966d Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5403224 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 4d317b52 2024-03-22T15:48:51 Vulkan: Add MSRTSS preferred usage for tex init The image create flag related to multisampled render to single- sampled was used when this feature flag was enabled. However, this could lead to some platforms allocating extra memory for the image, even if the image did not use this feature. In this change, a new feature is added regarding whether to prefer this flag from the start. If disabled, ANGLE will only use this bit for the texture if it is actually bound to an MSRTT framebuffer object (through FramebufferTexture2DMultisampleEXT()). * Added a new feature: preferMSRTSSFlagByDefault * If enabled, the MSRTSS is used for all image inits. * (TextureVk::initImage()) * Otherwise, it will create the image without the flag at first. * Added member to texture frontend to track if the texture has been bound to an MSRTT framebuffer. * mHasBeenBoundToMSRTTFramebuffer * During TextureVk::syncState(), if the image without the MSRTSS bit is bound to an MSRTT framebuffer, it is recreated using the MSRTSS flag. * Checked in respecifyImageStorageIfNecessary(). Bug: b/329911999 Bug: angleproject:8622 Change-Id: I5e7d43e3828ae272441d65b2be35d09b23b68f84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5402978 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
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 e85bc345 2024-03-29T13:43:46 Account for disableProgramCaching Blob cache tests rely on implicit caching of programs. Account for disableProgramCaching frontend feature when saving and retrieving from cache. Also skip EGLBlobCache tests if the feature is enabled. Bug: angleproject:8297 Change-Id: Ib101eb5712deb7c04dd19c7092f93a6c6b42cd40 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5408103 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 321c6b63 2024-03-29T10:30:59 Remove is_always_lock_free assertion from AtomicQueueSerial Build will fail when compiled on 32 bit architecture. The code will still function on 32 bit architecture but with performance penalty due to lock. But we are not really expecting it actually run on 32 bit platform with vulkan backend (the atomic queue serial is only used by vulkan backend). We could move AtomicQueueSerial into vulkan backend, but that will be a much larger change that I try to avoid. This CL removes the static_assertion and make it 8 bytes aligned as well. Bug: angleproject:7989 Change-Id: I3c0bd9877c4171485ca1aa9af0cf4621c1c23f56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5407870 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Alexey Knyazev 2b66694d 2024-03-28T00:00:00 Metal: Untangle public draw calls Do not call public Metal backend draw commands from itself. Bug: angleproject:8630 Change-Id: I7c0e016dc0eb3365520cdb39db215e4233e0d9fa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5401865 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi b559efa8 2024-03-26T22:02:41 Vulkan: Allow depth and stencil resolve to be separately added In preparation for optimizing resolve through glBlitFramebuffer for depth/stencil attachments. Bug: angleproject:7551 Change-Id: I57650d82c0cc6e56f44591eadfc42ac794cfef09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5399140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi b4cf07c3 2024-03-27T15:58:04 Vulkan: Move the interface pipeline library caches to share group When linking libraries into a pipeline, the linked pipeline lives in ProgramExecutableVk and may be shared between contexts in a share group. The caches for the vertex input and fragment output libraries thus cannot live in the context, but should remain alive until all contexts in the share group are destroyed. This change moves these caches to the share group. Bug: angleproject:8629 Change-Id: I2f7edf44d676505cf5e7e24640c6850c67f8b5e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5401514 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c71a67de 2024-03-27T15:50:00 Vulkan: Move pipeline cache graph dump to renderer In preparation for moving some caches to the share group. Bug: angleproject:6565 Bug: angleproject:8629 Change-Id: I1a06a18417502e499da0edb9abb0d510e3ad99ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5401513 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi 0e9254bd 2024-03-25T16:37:51 Vulkan: Optimize color invalidates By not flushing the render pass when there is an invalidate. Previously, the tracking of invalidation, write to attachments, management of load/store ops, and whether image contents are defined or not have all been unified between color and depth/stencil images. As such, it is possible to not close the render pass when a color image is invalidated just as is not done for depth/stencil images. Together with the optimization to resolve attachments [1], it is now finally possible to efficiently do MSAA rendering with ANGLE. Note that the optimization to use resolve attachments for depth/stencil is not yet implemented. For color only, the perf test added in [2] shows the following improvement on Pixel 6: - Single sampled rendering: ~2.73ms - Resolve + invalidate (before optimizations): ~3.54ms - Resolve + invalidate (after this change): ~2.85ms [1]: https://chromium-review.googlesource.com/c/angle/angle/+/5388492 [2]: https://chromium-review.googlesource.com/c/angle/angle/+/5392548 Bug: angleproject:7551 Change-Id: I008adf9f53df97ab464b0a0399f0b312bf4d0d3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391905 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9475ac40 2023-11-15T10:25:06 Vulkan: Make efficient MSAA resolve possible Prior to this change, using a resolve attachment to implement resolve through glBlitFramebuffer was done by temporarily modifying the source FramebufferVk's framebuffer description. This caused a good deal of complexity; enough to require the render pass to be immediately closed after this optimization. The downsides to this are: - Only one attachment can be efficiently resolved - There is no chance for the MSAA attachment to be invalidated In this change, resolve attachments that are added because of glBlitFramebuffer are stored in the command buffer, with the FramebufferVk completely oblivious to them. When the render pass is closed, either the FramebufferVk's original framebuffer object is used (if no resolve attachments are added) or a temporary one is created to include those resolve attachments. With the above method, the render pass is able to accumulate many resolve attachments as well as have its MSAA attachments be invalidated before it is flushed. For a FramebufferVk that is resolved in this way, there used to be two framebuffers created each time and thrown away as the code alternated between starting a render pass without a resolve attachment and then closing with one. With this change, there is now one framebuffer (without resolve attachments) that is cached in FramebufferVk (and is not recreated every time), and only the framebuffer with resolve attachments is recreated every time. Ultimatley, when VK_KHR_dynamic_rendering is implemented in ANGLE, there would be no framebuffers to create and destroy, and this change paves the way for that support too. WindowSurfaceVk framebuffers are still imagefull. Making them imageless adds unnecessary complication with no benefit. ----------------- To achieve efficient MSAA rendering on tiling hardware, applications should do the following: ``` glBindFramebuffer(GL_FRAMEBUFFER, msaaFBO); // Clear the framebuffer to avoid a load // Or invalidate, if not needed to load: // glInvalidateFramebuffer(GL_DRAW_FRAMEBUFFER, ...); glClear(...); // Draw calls // Resolve into the single sampled framebuffer glBindFramebuffer(GL_DRAW_FRAMEBUFFER, resolveFBO); glBlitFramebuffer(...); // Immediately discard the contents of the MSAA buffer, to avoid store glInvalidateFramebuffer(GL_READ_FRAMEBUFFER, ...); ``` The above would translate to the following Vulkan render pass: - MSAA LOAD_OP_CLEAR/DONT_CARE - MSAA STORE_OP_DONT_CARE - Resolve LOAD_OP_DONT_CARE - Resolve STORE_OP_STORE This makes sure the MSAA data doesn't leave the tile memory and greatly reduces bandwidth usage. Once anglebug.com/4892 is fixed, this would also allow the MSAA image to never be allocated either. Bug: angleproject:7551 Bug: angleproject:8625 Change-Id: Ia9f4d20863d76a013d8495033f95c7b39f77e062 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388492 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Le Hoang Quyen 085ff15a 2024-03-26T03:33:26 Metal: Fix RenderTargetMtl::getFormat() could return nullptr. Bug: b/326301256 Change-Id: Ia8914e4bc77e34bd510661689837b97d5de82d92 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5394149 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Cody Northrop 71e5a43f 2024-03-26T14:03:14 FrameCapture: Don't use shadow memory on Pixel after Android 14 The platform bug that required shadow memory to track changes to coherent mapped buffers has been fixed in Android 14. mprotect now works on Vulkan surfaces. Test: MEC with title using coherent buffers Bug: angleproject:7402 Bug: b/269535398 Change-Id: I370f29ee7d033b19facf48cfd76576950c39b735 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5399117 Reviewed-by: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Mike Schuchardt <mikes@lunarg.com> Auto-Submit: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Liza Burakova beae7959 2024-03-26T11:12:15 Implement a basic setImage to TextureWgpu. Bug: angleproject:8457 Change-Id: I62d7996b0492aa5dccfbc95892b5edc5cc05b20d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5392381 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Liza Burakova 0add1163 2024-03-25T11:39:41 Move extent and dimension conversions to wgpu_utils. This change moves some helper methods out of the ImageHelper and wgpu_helpers and into wgpu_utils. Bug: angleproject:8457 Change-Id: I1cc641e4a48eec30519e331b6150e2432d3bc3c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5392380 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton eacd6acd 2024-03-22T05:38:13 Add RenderTargetCache to FramebufferWgpu ...and update it based on dirty bits. Bug: angleproject:8582 Change-Id: If227392b24b3fc649d48cb1bce1144400cd98d70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386900 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Mohan Maiya 318e5e02 2024-03-24T08:17:56 Vulkan: Update EGL_EXT_buffer_age implementation 1. Buffer age is always 1 when swap behavior is EGL_BUFFER_PRESERVED. 2. WindowSurfaceVk::getBufferAge no longer acquires a swapchain image. See commit: b46cf6989f6fe8db5f0759001f633681a96fadde 3. It is valid to pass attributes of eglQuerySurface API to eglQuerySurface64KHR API 4. Add deadlock fix to eglQuerySurface64KHR Bug: angleproject:3529 Bug: angleproject:6851 Tests: EGLLockSurface3Test.QuerySurfaceAndQuerySurface64Parity* Tests: EGLBufferAgeTest.QueryBufferAge* Change-Id: Idf3c4fc08364f671fb02e99111be2beb7a1d9f3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5389461 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya ee02014d 2024-03-22T11:52:35 Selectively wait for LinkSubTasks Backends have the option to request frontend to run their LinkSubTask post-link. Do not wait for such sub tasks during most glProgram APIs. Note that we do wait for these "post-link sub tasks" incase of a program relink or first use by a draw call. Bug: angleproject:8297 Change-Id: I936fb5a127570f9dfa567ee8cbc02e25c4b70a6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5387064 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 16fef70f 2024-03-22T12:09:12 Vulkan: Refactor imageless framebuffer creation Bug: angleproject:7551 Change-Id: I6789123d1b854a64ce405dd1e096b9c28a227b5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5384139 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 1bd82319 2024-03-22T05:00:11 Add RenderTargetWgpu Based on RenderTargetMtl without any multisampling support for now. Bug: angleproject:8582 Change-Id: I4c77e747b341f08a0dd88f507e6d805d34a01d24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386899 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Amirali Abdolrashidi a53bd62a 2024-03-21T14:51:29 Disable MSRTSS on QCOM Currently, some QCOM devices supporting MSRTSS allocate extra memory for all images when this feature is enabled, even if those images do not use this feature. * Disabled supportsMultisampledRenderToSingleSampled on QCOM devices. Bug: b/329911999 Change-Id: I3cfa4c4e7e3c8160ca240c492e5f29e982884f0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386331 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Geoff Lang 33a09305 2024-03-22T11:10:05 Metal: Remove work texture and work buffer from ContextMtl These objects did not have lifetime management and would persist until the destruction of the context which added significant memory overhead when clients use many contexts. Allocate them specifically for the ReadPixels call and destroy them when finished. Bug: chromium:330163368 Change-Id: I95e2c11e14fb4ad0728850a7a0fabcf53916b9ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388258 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi ad013650 2024-03-22T03:42:44 Revert "Rename LinkSubTask -> PostLinkTask" This reverts commit 00eb6edba074a22389b09990ab856adfd417dd64. Reason for revert: Sub tasks are not actually post-link tasks for all the other backends (other than Vulkan), but they are a real part of the link job. Original change's description: > Rename LinkSubTask -> PostLinkTask > > This is a renaming change, no behavior changes are expected. > > Bug: angleproject:8297 > Change-Id: I734c7959f5ed6db2447853cc6f6256e3c8e86213 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5382224 > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:8297 Change-Id: Iaebf9d165d810344bfc524042206ca427d270034 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386432 Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski f3a819f1 2024-03-21T08:12:09 Context: Limit max texture size for ANGLE captures Tracing Poppy Playtime generates glTexStorage2D calls with widths exceeding P7 capabilities, so limit GL_MAX_TEXTTURE_SIZE to 16k for wider compatibility. Bug: b/330696626 Change-Id: Icfbfce1c8b59941bc5c6911aaba31fea43976cef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5385681 Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Liza Burakova 6c379733 2024-03-21T14:25:52 Add more helper methods for textures. This change adds a DisplayWgpu member variable to ContextWgpu as well as a getter for the display so other objects can access a webgpu device. This change also adds helper methods to translate GL texture information (size, dimension, mip level count, etc.) to webgpu compatible texture information. Bug: angleproject:8547 Change-Id: Ifb2c5d021b1cbb95304a732c57d3250f1731496b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5385574 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Liza Burakova 07137f57 2024-03-20T13:28:34 Add ImageHelper to TextureWgpu Bug: angleproject:8547 Change-Id: If718d57704c2548cec27ca15e9adc7bf1a7f92b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5381638 Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Mohan Maiya 00eb6edb 2024-03-20T06:49:38 Rename LinkSubTask -> PostLinkTask This is a renaming change, no behavior changes are expected. Bug: angleproject:8297 Change-Id: I734c7959f5ed6db2447853cc6f6256e3c8e86213 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5382224 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f8b18577 2024-03-15T16:31:02 Set the Dawn proc addresses at in DisplayWgpu initialization This allows the display to fully initialize and some tests to pass! Bug: angleproject:8485 Change-Id: I83176c572793ba8a6992264e873f7d24d3698d35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372136 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi efd41bd2 2024-03-15T13:25:03 Vulkan: Rename ResourceVk.* to vk_resource.* This file adds helpers to namespace vk, so its name is changed for consistency with other namespace vk files. Bug: angleproject:8564 Change-Id: I6525e7609eb9385f2a3eecaa7c52b7417fda7f12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370108 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang e3aac00b 2024-03-18T18:18:36 Vulkan: only request OPAQUE compositeAlpha on Android if no alpha Android used to only advertise INHERIT bit with the expectations that a Vulkan swapchain is only connected with SurfaceFlinger so that WM takes full control of the composition. That works fine till an encoder surface with EGL client (via ANGLE + KHR_swapchain) hits a suboptimal code path if the backing storage is RGBA but not RGBX. This change prepares for Android KHR_swapchain advertising OPAQUE bit for such surfaces as a hint to get RGBX backing. Bug: b/328125698, b/328122401 Test: encoder cts is passing, and no regression to ImageReader use cases Change-Id: Ia7f1c69935690f20efac6295eb824bee0d03eb07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5378134 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 914fe61b 2024-03-15T13:20:49 Vulkan: Rename RendererVk.* to vk_renderer.* Done in a separate CL from the move to namespace vk to avoid possible rebase-time confusion with the file name change. Bug: angleproject:8564 Change-Id: Ibab79029834b88514d4466a7a4c076b1352bc450 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370107 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Yiwei Zhang 1fc548c1 2024-03-18T21:50:39 Vulkan: enable recordable bit for RGB8 This is needed by encoder surface that is in favor of RGBX as the backing format. Bug: b/328125698 Test: android.media.encoder.cts.SurfaceEncodeTimestampTest Change-Id: Ic64653ccb1a9a0cea689b2e5554788fb0361a2d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5378133 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski 7cb518bc 2024-03-14T18:10:08 Reset shader images modified during trace ANGLE will track and restore texture resources modified during replay by reinitializing them in the Reset function, but shader images resources modified by glDispatchCompute calls were unhandled. Test: angle_trace_tests --gtest_filter=*poppy_playtime Bug: b/329824015 Change-Id: I2852b5a3cecdd2e2213ea457ea43e7cf84741986 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5375541 Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jose Dapena Paz 2f934a47 2024-03-18T12:53:27 libstdc++: replace std::powf with std:pow libstdc++ before GCC 14 does not provide std::powf. So replace the call with std::pow, that provides an overload for floats. For reference of the bug tracking the missing methods in libstdc++: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700 Bug: chromium:41455655 Change-Id: Idfb53fe3c71f4dc0198cf6ba3e26c07895f65bc6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5379670 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d2cef82a 2024-03-18T18:15:11 Vulkan: Use fragment shading rate access flags Image memory barrier for a fragment shading rate attachment needs to use VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR as the access flag instead of VK_ACCESS_SHADER_READ_BIT Bug: angleproject:8484 Change-Id: I3316f1a5965ed3866e683494ee4f8df0b208d92c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5379262 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 6d569003 2024-03-17T13:15:21 Vulkan: Deduplicate merge to Renderer's pipeline cache Decouple warmUp*PipelineCache(...) and the merge of ProgramExecutableVk::mPipelineCache into Renderer's global cache. This allows the last link subtask to perform the merge once instead of doing so in each subtask. Also, remove AtomicShared datatype and use AtomicRefCounted directly Bug: angleproject:8601 Change-Id: If27831d7d132a3b8644c425072169cf2e9a4bc69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5376409 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Alexey Knyazev 490ff869 2024-03-14T00:00:00 Always redeclare clip/cull distance built-ins When clip or cull distance built-in arrays are implicitly sized, various pruning passes may produce an inconsistent AST state thus causing translation or linking failures. Adjusted the dedicated validation pass to inject an explicit declaration thus bypassing the issue. Additional updates: * Ensured that API clip distance state emulation is applied when a variable is declared but not assigned * Reverted previous clip/cull distance related changes to TIntermBinary::hasSideEffects as they are redundant now * Fixed failing AST validation for MSL varying emulation * Aligned linking error messages with the specifications * Updated tests and cleaned-up obsolete code Fixed: angleproject:8591 Change-Id: Ic8cfaf37778b8532bbab32ab998d5350b85d67ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372714 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya 21d124c4 2024-03-16T10:06:02 Vulkan: Remove support for pipeline cache control For current and upcoming uses for pipeline caches the benefits of having an externally synchronized pipeline cache is minimal at best. Remove support for that and have all caches be internally synchronized by the Vulkan driver. Bug: angleproject:8601 Change-Id: Ic5d9740934641f61b527094aa301e27302b02a57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5375102 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 553e3c80 2024-03-15T08:40:42 Vulkan: Async compile pipelines with different surface rotations Add prepareForWarmUpPipelineCache(...) method to ProgramExecutableVk that sets up the required common state for warmup tasks. On platforms that support worker threads enqueue a warmup task per surface rotation. Bug: angleproject:8601 Change-Id: I22c0d664736ef682d4207c1e08163f79ac79f7d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5366173 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 21ef298e 2024-03-13T11:06:22 Consider textures without an attached Buffer as incomplete There are apps that perform a draw call using GL_TEXTURE_BUFFER but without binding a valid buffer thus causing a crash. Instead consider them as incomplete textures and fail validation checks. Also, there is no need to explicitly track the buffer associated with an incomplete buffer texture, the owning texture will handle cleanup. Bug: b/328846669 Tests: TextureBufferTestES31.DrawIncomplete* Tests: TextureBufferTestES31.DrawComplete* Change-Id: Id0b68e8048ba582d677e6767272a86761913ea3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369639 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi 60aaf4a0 2024-03-14T12:58:56 Vulkan: Move renderer to namespace vk This class is agnostic of EGL. This change moves it to namespace vk for use with the OpenCL implementation Bug: angleproject:8564 Change-Id: I57f7807d6af8b3d5d7f8efbaf8b5d537a930f881 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5371324 Reviewed-by: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov d4d34781 2024-03-14T13:03:55 Multisampling support check: sampleCounts > 1 and createFlags At least two drivers are returning VK_SUCCESS from vkGetPhysicalDeviceImageFormatProperties2 but also set sampleCounts to 1 which supposedly means no MSRTT Qualcomm reference device driver fails vkCreateImageView when enabling the multisampling bit one cubemaps which have sampleCounts == 1 Additionally, * include vk::GetMinimalImageCreateFlags() in createFlags - we don't get the cubemap bit without that * check both the image format and the additional view format (linear+srgb) as we set both of these when creating the image This fixes a bunch of cubemap and 3D tests on Qualcomm reference device Bug: b/329286011 Change-Id: I6d3ddea0cd997cf37b503050063f42d69723bd50 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372826 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Mohan Maiya 7220307b 2024-03-13T16:13:45 Conditionally support EGL_OPENGL_API Advertize support for EGL_OPENGL_API only if angle_enable_gl_desktop_frontend is enabled. Bug: b/322142833 Tests: EGLQueryContextTest.DesktopGlApi* Change-Id: I680ea985e45e793d92fc087d21f38fd5d38f0241 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369641 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Geoff Lang c3fdc811 2024-03-14T14:20:43 Raise the WebGL texture size limit on Android >= 14 The previous limit of 4096 is overly restrictive for newer devices that can have screen sizes close to or greater than 4096. Bug: angleproject:8611 Change-Id: If453b7e0c6e2af218b65a631821b441330a50b69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370399 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang e5cb7f1f 2024-03-12T16:06:37 Vulkan: Fix access to inactive attributes ... within range of active ones. Since a buffer is bound for inactive attributes, it must be considered accessed. Ultimately, the nullDescriptor feature could be used to avoid binding a buffer for inactive attributes. Bug: chromium:327807820 Change-Id: Ieceea9442310c23568c47cef7357b4094b7ebbb4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369336 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 533fa5ce 2024-03-09T10:15:33 Metal: Update few asserts when resolving FS output Update few asserts when resolving FS output locations and indexes. Bug: angleproject:8558 Change-Id: Ic3c3c1df19b2de9db78a73b1c14f26444442d74f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5358814 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Mohan Maiya 9bae5859 2024-03-13T10:55:18 Vulkan: Add blend factors to allow dithering to work Previously, we had - src: GL_SRC_ALPHA, dst: GL_ONE_MINUS_SRC_ALPHA Now, this adds - src: GL_ONE, dst: GL_ONE_MINUS_SRC_ALPHA This showed up in app "com.inertiasoftware.justjigsaws". Bug: b/328837151 Change-Id: I88208b1ed4dd050283d8d02cf31ccdcb3d02a444 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369638 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand cd90294b 2024-03-12T17:00:42 OpenCL/Vulkan: Add initial CL Event creation Introduce initial support for CL Event (and user event) creation as well as implement initial event status query routine. Bug: angleproject:8574 Change-Id: I97eb57a720610e00a04e512328f0b3b4287bf021 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5341378 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com>
Austin Annestrand 66bc9cfa 2024-03-11T16:24:20 OpenCL: Fix mCallback in linkProgram ctor During linkProgram construction, mCallback member was not properly initailized prior to calling linkProgram backend. Bug: angleproject:8435 Change-Id: I5700fe75a20d69193bba4f5ff4f7ade7383802ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5362894 Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 17facd2b 2024-03-13T10:14:59 Fix CreateDirectory name clash with Windows headers. CreateDirectory is a windows macro to CreateDirectoryA/W. This caused conflicts with the newly added CreateDirectory function which also internally called CreateDirectory with the wrong arguments. Bug: angleproject:8571 Change-Id: I596a4c2d711537e92e5e8b53b8eea2ab6b3ca7ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369333 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Austin Annestrand 065b333c 2024-03-12T16:59:22 OpenCL/Vulkan: Add initial CL Buffer routines Enabling CL buffer creation and initial routines for the Vulkan Backend. Bug: angleproject:8573 Change-Id: I55674efde6cab2cb45a336cf9211d19d49166f82 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5341377 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Chia-I Wu aea2abc1 2024-03-11T14:59:16 Vulkan: Input attachment requires both texturable and renderable VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT requires VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT or VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT. Set VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT only when the external image is both texturable and renderable. Bug: b/280353184 Change-Id: If80712bf3f6074f6c4ade3223a93d803a02d6000 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5362899 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya a339585e 2024-03-11T12:10:41 Vulkan: Add AtomicShared type In preparation for upcoming changes related to decoupling warmup of pre-rast and fragment shader subsets, create a new thread-safe version of vk::Shared so multiple threads can consume and safely destroy a shared Vulkan handle. Bug: angleproject:8601 Change-Id: I079e4186325537842456b7f2c7017f7e95ea7d54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5361151 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Austin Annestrand bc633ad7 2024-01-18T12:24:40 OpenCL/Vulkan: Implement compile and link routines Enables the following OpenCL APIs for the Vulkan Backend: clCompileProgram clLinkProgram Bug: angleproject:8571 Change-Id: Ide7d2911922347055051537c9c70b83be4e24575 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5341375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 99c2157b 2024-03-11T14:57:06 Metal: Add Quyen as OWNER Change-Id: I8bca1075423fac0a8ce72dae167a63e316ef1f49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5362574 Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen b9c6cf8e 2024-03-08T10:11:11 Metal: Stop blit encoder after render encoder Render encoder might resolve visibility query with blit encoder. Fixes an assert due to "Metal: Release prov. vertex buffers on event set". Bug: angleproject:8586 Change-Id: If3ede1771e5c72e2de0b6f78ce73fbdafb74cd22 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5352252 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Austin Annestrand 9fee9156 2024-01-18T13:50:38 OpenCL/Vulkan: Add initial CL Kernel routines Enables the following OpenCL APIs for Vulkan Backend: clCreateKernel clCreateKernels clSetKernelArg Bug: angleproject:8572 Change-Id: Iaaabd295d7951a48bf9bd6717ed3957960052dbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5341376 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com>
Mohan Maiya f16eea30 2024-03-07T07:02:16 Vulkan: Enable QCOM foveated rendering extensions Enable support for GL_QCOM_framebuffer_foveated and GL_QCOM_texture_foveated extensions if supportsFoveatedRendering is enabled. Bug: angleproject:8484 Change-Id: I141fe43404b3461c3a222081f435c2f8b3c7f3d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5347134 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Mohan Maiya e904e37b 2024-03-07T16:45:26 Vulkan: Enable imageless framebuffer on Samsung drivers Newer Samsung Vulkan drivers have fixed the issue with imageless framebuffer support. Enable the feature on newer drivers. Bug: angleproject:8484 Change-Id: Ifa3d428ecedec83b86aeff65012f002ef8acc087 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5353229 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Kimmo Kinnunen 26da3174 2024-03-08T18:44:36 Make 2024-03-05 changes compile with clang 15 pt.2 Constructing with function style cast constructor is not supported when the type does not have a constructor. One cast was missing, still. Bug: angleproject:8585 Change-Id: Ia56000afe5a972bab234a470ba8c72ccd129e33a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5352262 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Steven Noonan c55c8ad2 2024-03-05T15:42:28 extension XML cleanup Add a bunch of missing extensions, commands, enums, and aliases to the extension XML files. These were missing when I generated a GL loader from the XML. Additionally, removing the unimplemented ANGLE_timer_query specification. Bug: angleproject:8432 Change-Id: I55b7393a313070719200c150a91b1751206ca2cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5347156 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao ecaefce0 2024-03-06T14:54:17 Vulkan: Disable optimizeWithLoadOp if there is unresolve If there is unresolve operation for MSRTT emulation code path, dont fall back to loadOp for midRenderPassClear. Otherwise the clear will be lost due to unresolve. Bug: b/309355117 Change-Id: Ib39be0c980f663c08e80855ead32f6e0b07e60fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5350741 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi aba3705b 2024-03-02T21:58:34 Vulkan: Completely remove egl::Display from RendererVk This class is now independent of EGL. The only mentions of EGL is egl::ContextPriority, which is just an enum and is tolerable for now. OpenCL can now instantiate RendererVk without having to create a temp egl::Display. Bug: angleproject:8564 Change-Id: Ia78cfcb3a48c97f397441cf7cda71d74cfaddd8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5335581 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 7e065b6f 2024-03-07T13:52:47 Fix SRV and RTV confliction Bug: chromium:324422644 Change-Id: Id0f8fd1183938f3077e97fd6904fbfbad7efda85 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5354106 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 74af31ad 2024-02-28T00:00:00 GL: Add ClearsWithGapsNeedFlush workaround Enabled on older Adreno drivers to avoid clear/draw race conditions in certain cases. Fixed: angleproject:8374 Change-Id: Ifc30f66ece562027ae4dd7672fcb121f91ec4696 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5335662 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 91ddf851 2024-03-03T10:57:22 Vulkan: support QCOM foveated rendering extensions Add support for foveated rendering in the vulkan backend. This is done by leveraging the VK_KHR_fragment_shading_rate extension. Bug: angleproject:8484 Change-Id: I0d01d07583f710b2302ea07b19c9d113c73bfe41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5269907 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi c71de868 2024-03-05T13:14:54 Add workaround for ext dynamic state on Win/Intel The feature "useVertexInputBindingStrideDynamicState" seems to be causing test crashes on older Win/Intel drivers. A workaround should be added to disable extended dynamic state on such platforms. * useVertexInputBindingStrideDynamicState is now disabled for Win/Intel drivers before 100.9684. * Added constructor for IntelDriverVersion to use major and minor versions (Windows only). Bug: angleproject:8563 Bug: b/326657712 Bug: b/288916329 Change-Id: I36e27ec1189435a75075a9ac9d235ff224cfcb42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5341658 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>