src/libANGLE/renderer/metal/VertexArrayMtl.h


Log

Author Commit Date CI Message
Kyle Piddington 1670c6dd 2022-02-17T14:15:08 Metal: Buffer data is not correctly updated When using a dynamic draw buffer, Metal creates more buffers to avoid in-flight synchronization issues. However, without correctly rebinding the buffers from the VAO, we get missing data. This patch adds a fix and a test to reproduce the issue. Upstream of https://bugs.webkit.org/show_bug.cgi?id=236427 and https://bugs.webkit.org/show_bug.cgi?id=236733 Bug: angleproject:7122 Change-Id: I879ff688af04a8215df6134400d0aab582b92842 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3472691 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
John Cunningham 42bd4fc2 2021-12-10T14:58:17 Metal: add ANGLE_metal_create_context_ownership_identity. This Metal-specific EGL extension allows a given context and the GPU resources it allocates to be associated with a particular task ID on the system, for system-level bookkeeping purposes. Bug: angleproject:6795 Change-Id: I19ee0993564169b01c4a450e63dcfacd339b98b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335172 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kenneth Russell da3db87e 2021-07-06T14:00:58 Upstream latest changes to Metal backend from Apple to 7/1/2021 This CL merges in the ANGLE changes between these two WebKit commits: https://git.webkit.org/?p=WebKit.git;a=commit;h=8648b353ab1d7730438c2e08319e1a4d64982c31 https://git.webkit.org/?p=WebKit.git;a=commit;h=166e4924a52971d6a32ad48247a439b16c00e062 Include provoking vertex buffer out of bounds fix from https://bugs.webkit.org/show_bug.cgi?id=230107 Fix bad merge of resetting of dirty bits, breaking DepthStencilFormatsTest.DepthTextureRender test and perhaps others. Disable GL_APPLE_clip_distance when the direct-to-Metal compiler is active. It can not yet handle the gl_ClipDistance array. Disable use of rectangular textures for IOSurfaces. Metal can bind IOSurfaces to 2D textures, and this was passing all tests in the SPIR-V Metal backend. Introducing rectangular textures breaks the SPIR-V Metal backend, and the tests currently fail on the direct-to-Metal backend. Fix several bugs with ProvokingVertex, which was causing both the SpirV and Direct backends to incorrectly draw indices. (https://bugs.webkit.org/show_bug.cgi?id=230107) Skip the following tests on the Metal backend which is still failing RobustResourceInitTestES3.BlitDepthStencilAfterClearBuffer GLSLTest_ES3.GLVertexIDIntegerTextureDrawArrays/ES3_Metal With these changes, angle_end2end_tests again runs to completion. Bug: angleproject:6395 Change-Id: I3cc58f531426a95fc8f177a4ad87f56c1855a546 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3167010 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Kyle Piddington d33a2222 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile libANGLE. This change is meant to merge the metal backend changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the metal backend code in a state that compiles, but not to switch the Metal backend over to using the direct-to-metal backend yet. Bug: angleproject:5505 Bug: angleproject:6127 Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Le Hoang Quyen 8a50b42b 2020-10-24T19:29:12 Metal: Convert index & vertex format on GPU when possible. - When converting vertex buffer: - if there is no render pass active, use compute shader to convert. - if there is a render pass active and device supports explicit memory barrier then convert the buffer in vertex shader with direct buffer write and insert a memory barrier. - if there is a render pass active and device doesn't support explicit memory barrier then convert the buffer on CPU. Bug: angleproject:2634 Change-Id: I5346e3a2adb855f40e46a3912d9db404a4482e0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2434025 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Le Hoang Quyen ed23dc84 2020-10-24T19:12:32 Metal: default integer attribs & offset mod for idx conv. - Support default integer attributes. - When converting index buffer, use offset modulo instead of offset to reduce number of conversions if application uses many different offsets to the index buffer. Bug: angleproject:2634 Change-Id: I97aa9ea1826ffc9dbe5784fe5b5af2f99df63e2c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494524 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Le Hoang Quyen ab42afa6 2019-11-21T10:13:44 Metal: fix vertex attribute's conversion lost after changing buffer binding. After vertex buffer's attribute is converted and stored in conversion buffer. Binding the same attribute to another buffer, then binding it back to previous buffer will result in previous conversion information lost. The conversion method would skip the conversion due to buffer's content hadn't been changed, however it didn't reuse the old conversion result. This CL also changed the way binding offset is used in Metal backend. - Previous, the offset would be assigned to the offset field of MTLVertexAttributeDescriptor, then the buffer would simply be bound to the command encoder with offset=0 i.e. setVertexBuffer(buffer, index, 0) - However this approach has several disadvantages. Since Metal doesn't allow MTLVertexAttributeDescriptor's offset to be larger than the vertex attribute's stride, the old approach would force the back-end to convert the attribute and store in conversion buffer. New approach: - MTLVertexAttributeDescriptor's offset will be zero. The offset will be used to bind the buffer itself to the render command encoder. i.e. setVertexBuffer(buffer, index, offset) This way the "offset <= stride" restriction no longer exists. The only restriction is the offset must be multiple of attribute's size. Added 3 new tests: - SimpleStateChangeTest.RebindTranslatedAttribute - VertexAttributeTest.DrawWithLargeBufferOffset - VertexAttributeTest.DrawWithLargeBufferOffsetAndLessComponents Bug: angleproject:2634 Change-Id: I6c2fa8091436e4a24405d791f86d17d97df02d64 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940009 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Le Quyen fe26bae4 2019-10-29T18:38:53 Metal backend implementation pt 2 This is without Metal specific shader translator implemented yet. Bug: angleproject:2634 Change-Id: I95d589442251c9ba111bd05a2dc379a36739046c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855069 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Le Quyen d200a77a 2019-10-10T00:44:01 Metal backend skeleton implementation. Bug: angleproject:2634 Change-Id: I34be82f4a80a6851fecb53a51e069b134d82613a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849079 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>