Issue 5505 in angleproject: Upstream Apple's direct-to-Metal backend

93 views
Skip to first unread message

k… via monorail

unread,
Jan 6, 2021, 5:50:29 PM1/6/21
to angleproj...@googlegroups.com
Status: Accepted
Owner: ----
CC: jdarp...@chromium.org
OS: Mac
Priority: High
Renderer: Metal
Type: Defect

New issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

Apple has developed a new backend for ANGLE's shader translator that generates the Metal Shading Language directly, rather than taking an intermediate step through SPIR-V and using SPIRV-Cross to generate MSL.

This work was first done in the WebKit repository, and Apple's indicated they will contribute it to ANGLE. This bug tracks this needed work.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

k… via monorail

unread,
Jan 6, 2021, 5:50:38 PM1/6/21
to angleproj...@googlegroups.com
Updates:
Cc: d...@apple.com

Comment #1 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c1

(No comment was entered for this change.)

k… via monorail

unread,
Jan 6, 2021, 5:50:46 PM1/6/21
to angleproj...@googlegroups.com
Updates:
Cc: kpidd...@apple.com

Comment #2 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c2

asosu… via monorail

unread,
Jan 7, 2021, 3:41:57 AM1/7/21
to angleproj...@googlegroups.com

Comment #3 on issue 5505 by asosu...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c3

i should not be in any projects. Is this how someone is remotely connecting to my phone and i can never connect to anything because i have a ton of outdated certificates in my laptop and phone that i didnt up load nor do i even know how to, get me off of all these projects i am not in any ones organisation

k… via monorail

unread,
Jan 7, 2021, 2:21:42 PM1/7/21
to angleproj...@googlegroups.com
Updates:
Cc: lehoa...@gmail.com

Comment #4 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c4

The first major patch was landed in https://bugs.webkit.org/show_bug.cgi?id=219759 .

Follow-on bug fixes so far:
https://bugs.webkit.org/show_bug.cgi?id=220129
https://bugs.webkit.org/show_bug.cgi?id=220137

Some additional ongoing WebGL 1.0 conformance failures in the Metal backend are being tracked in:
https://bugs.webkit.org/show_bug.cgi?id=220076

k… via monorail

unread,
Jan 7, 2021, 2:43:40 PM1/7/21
to angleproj...@googlegroups.com
Updates:
Cc: syou...@chromium.org geoff...@chromium.org jon...@google.com

Comment #5 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c5


(No comment was entered for this change.)

k… via monorail

unread,
Jan 7, 2021, 8:22:13 PM1/7/21
to angleproj...@googlegroups.com

Comment #6 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c6

These are the GN arguments James was using to debug angle_end2end_tests in Xcode:
is_debug = true
enable_dsyms = true
enable_stripping = !enable_dsyms
is_component_build = false

A more complete set, currently for Google employees:
use_goma = true
is_debug = true
symbol_level = 2
enable_dsyms = true
enable_stripping = !enable_dsyms
is_official_build = false
is_chrome_branded = is_official_build
use_clang_coverage = false

James' rebased, work-in-progress version of Apple's patch:
https://chromium-review.googlesource.com/2616259

le.ho… via monorail

unread,
Jan 8, 2021, 4:57:45 AM1/8/21
to angleproj...@googlegroups.com

Comment #7 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c7

Thanks kpidd...@apple.com and Apple team for starting to implement direct metal shader translator and contribute to ANGLE.

There are couple of things for everyone to consider. I skimmed through the patch and it seems that Apple's changes are based on top of my forked code. Over the few months in the past, I did port my own changes from that fork to upstream ANGLE repo but I never back-port any upstream changes to my fork.
So if it will be troublesome to merge Apple's changes to upstream because the 2 version of the code are largely incompatible and diversified very deep in the history tree (more than a year worth of commits).

I think it is easier if the changes are broken down into small patches and manually rebased on top of upstream repo instead of letting git do the merge & rebase automatically.
Just my 2 cents.

k… via monorail

unread,
Jan 8, 2021, 4:38:17 PM1/8/21
to angleproj...@googlegroups.com

Comment #8 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c8

Hi Quyen - thanks for your input.

Apple's patch is in the process of being upstreamed. The first attempt was:
https://chromium-review.googlesource.com/2612064

James then rebased it and got it building:
https://chromium-review.googlesource.com/2616259

I'm currently in the process of helping test and fix some angle_end2end_tests failures with it:
https://chromium-review.googlesource.com/2618530

Given time pressure it's not practical for us to replay Apple's changes as sets of small changes, so instead we're helping them get onto top-of-tree ANGLE again as quickly as possible.

k… via monorail

unread,
Jan 9, 2021, 5:51:52 PM1/9/21
to angleproj...@googlegroups.com
Updates:
Owner: k...@chromium.org
Status: Started

Comment #9 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c9

After an attempt to reimplement pbuffers in the rebased patch (I'll upload the patch after more debugging), seeing a crash on the second invocation of:
debugging), seeing a crash on the second invocation of:
out/Debug/angle_end2end_tests --gtest_filter=EGLSurfacelessContextTest

with the following command line:
lldb -- out/Debug/angle_end2end_tests --gtest_filter=EGLSurfacelessContextTest.Switcheroo/ES2_Metal_NoFixture --gtest_repeat=10

The color attachment for the FrameBufferMtl doesn't have an attached texture. Trying to figure out why this only happens the second time the test is run.

* thread #2, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x38)
frame #0: 0x000000010fa7c30c libGLESv2.dylib`std::__1::shared_ptr<unsigned long>::operator*(this=0x0000000000000038) const at memory:3843:18
frame #1: 0x000000010fa77dc9 libGLESv2.dylib`rx::mtl::Texture::getColorWritableMask(this=0x0000000000000000) const at mtl_resources.h:235:61
frame #2: 0x000000010fa91bb3 libGLESv2.dylib`rx::(anonymous namespace)::OverrideMTLClearColor(texture=nullptr, clearColor=0x00007ffeefbfe98c, colorOut=0x00007ffeefbfe5f8) at FrameBufferMtl.mm:34:77
* frame #3: 0x000000010fa9198e libGLESv2.dylib`rx::FramebufferMtl::clearWithLoadOpRenderPassNotStarted(this=0x000000010aa27530, context=0x000000010d835800, clearColorBuffers=(mBits = '\x01'), clearOpts=0x00007ffeefbfe988) at FrameBufferMtl.mm:1039:13
frame #4: 0x000000010fa9083f libGLESv2.dylib`rx::FramebufferMtl::clearWithLoadOp(this=0x000000010aa27530, context=0x000000010d835800, clearColorBuffers=(mBits = '\x01'), clearOpts=0x00007ffeefbfe988) at FrameBufferMtl.mm:1017:16
frame #5: 0x000000010fa89a74 libGLESv2.dylib`rx::FramebufferMtl::clearImpl(this=0x000000010aa27530, context=0x000000010d835800, clearColorBuffers=(mBits = '\x01'), pClearOpts=0x00007ffeefbfe988) at FrameBufferMtl.mm:1205:16
frame #6: 0x000000010fa8966a libGLESv2.dylib`rx::FramebufferMtl::clear(this=0x000000010aa27530, context=0x000000010d835800, mask=16384) at FrameBufferMtl.mm:136:12
frame #7: 0x000000010f175f56 libGLESv2.dylib`gl::Framebuffer::clear(this=0x000000010aa27260, context=0x000000010d835800, mask=16384) at Framebuffer.cpp:1453:19
frame #8: 0x000000010f0a372a libGLESv2.dylib`gl::Context::clear(this=0x000000010d835800, mask=16384) at Context.cpp:3951:5
frame #9: 0x000000010ef2ac6d libGLESv2.dylib`gl::Clear(mask=16384) at entry_points_gles_2_0_autogen.cpp:417:22
frame #10: 0x000000010013d530 angle_end2end_tests`(anonymous namespace)::EGLSurfacelessContextTest_Switcheroo_Test::TestBody(this=0x000000010af0b550) at EGLSurfacelessContextTest.cpp:264:9

k… via monorail

unread,
Jan 9, 2021, 6:35:48 PM1/9/21
to angleproj...@googlegroups.com

Comment #10 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c10

Adding default values for the POD class members in IOSurfaceSurfaceMtl.h fixed these failures.

The next set of angle_end2end_tests failures is happening because the ANGLE_MTL_EVENT_AVAILABLE define isn't specified anywhere. I'll look into WebKit's sources to see where and how it's set up and pull its definition into ANGLE's common headers.

The latest patch (still work-in-progress, and will need another big rebase) is https://chromium-review.googlesource.com/2618530 .

le.ho… via monorail

unread,
Jan 9, 2021, 10:06:35 PM1/9/21
to angleproj...@googlegroups.com
Updates:
Cc: jmad...@chromium.org

Comment #11 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c11

ANGLE_MTL_EVENT_AVAILABLE was defined in "mtl_common.h" before this patch. It was a suggestion from Geofflang to add this flag when I ported the fence sync code to upstream ANGLE last time: https://chromium-review.googlesource.com/c/angle/angle/+/2433325.
I think it is accidentally erased in this patch because the patch was based on my fork code, not upstream code.

A lot of changes in this patch are also the revert from upstream version to my fork code's version. For example, on my fork, "auto" is used in a lot of places. But when they were committed to upstream, I had to chance to explicit types per Jamie request's based on ANGLE's coding guidelines. Which can be seen predominantly in "mtl_command_buffer.h" file (explicit types are reverted back to auto in this patch).

Also, it looks like Apple have changed the implementation of Metal transform feedback compare to the implementation on upstream.

Sorry if it sounds like complain (which is not actually), but pls be careful with this patch. It would potentially revert a lot of updated code on upstream to very old version of the code on my fork.
I would help rebase Apple's specific changes on top of upstream if I could find some free time.

le.ho… via monorail

unread,
Jan 10, 2021, 5:45:03 PM1/10/21
to angleproj...@googlegroups.com

Comment #12 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c12

I think this patch could be divided into 3 main smaller patches:
- direct metal translator (which currently seems to not support GLES 3.0 features yet), I think probably syou...@chromium.org could like to take a look.
- primitive restart emulations is extended to be used for every primitive not just triangle fan & line loop as before. This change would impact performance a lot since every indexed draw call would use primitive restart emulation on CPU from now on.
- Apple’s implentation of transform feedback which is different from the existing one on upstream. Although I’m not sure the reason for this change since the existing one is already passing end2end & dEQP tests. But I think it is worth to separate to a standalone CL.
If there are anything missing Apple dev team pls let me know.

The rest of the diff from my seeing are mostly the remnant of the code from my fork which I don’t think Apple have modified much:
- emulated instanced drawing; this is not necessary hence I didn’t commit to upstream.
- emulated framebuffer discard on desktop.
- GL_EXT_multisampled_render_to_texture: implicit MSAA resolve extension. This implementation was not fully compliant on my fork hence I didn’t commit it to upstream.
- a lof of auto types.
- old coding styles not complying to upstream’s requirements.
- some old buggy code which were already fixed on upstream.
...

I understand it is quite impractical at this point to further sudivide the patch into even smaller patches. But the 3 main categories of changes above seems to be doable.

If we just merged everything, then several months of my efforts to port the forked code to upstream would be thrown out of window (some bug fixes, many coding style fixes, some code quality fixes suggested by ANGLE reviewers, and so on). Which might be OK as long as it works. However probably I would have a lot nightmares when sleeping afterwards. If it has happened, we would have just merged everything from my fork from the start instead of going through several months of reviewing, modifying and merging.

le.ho… via monorail

unread,
Jan 11, 2021, 10:52:30 AM1/11/21
to angleproj...@googlegroups.com

Comment #13 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c13

Sorry if my comments were a bit too long. Just do whatever you think best. I was just suggesting some considerations for the merging process.

k… via monorail

unread,
Jan 11, 2021, 12:59:41 PM1/11/21
to angleproj...@googlegroups.com

Comment #14 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c14

Thanks le.hoang.q@ for your detailed analysis and input. It's not too long, and we greatly appreciate it. Please keep them coming.

One additional challenge not yet mentioned here is that if too many changes are made during the upstreaming process, the next roll of ANGLE downstream into WebKit will be much more difficult. There are more changes in WebKit's ANGLE snapshot that still need to be upstreamed in addition to the large https://chromium-review.googlesource.com/2618530 . Ultimately we want to get WebKit's downstream ANGLE snapshot and top-of-tree ANGLE in sync again, and allow Apple to develop directly in ANGLE.

I don't want create a mess while reconciling Apple's work with your tremendous contributions - for which we are extremely grateful. It might be necessary to do some iteration and cleanup after the initial landing. We'll have to work with the rest of the ANGLE team and see what their opinions are about the patch. My first goal is just to get all the tests passing again.

syous… via monorail

unread,
Jan 11, 2021, 1:06:55 PM1/11/21
to angleproj...@googlegroups.com

Comment #15 on issue 5505 by syou...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c15

@kbr, it may be easier to cherry-pick apple's work on top of Quyen's fork into a new change (or rebase, rather), instead of taking the source files as-is, so they replay on ToT ANGLE without reverting Quyen's contributions.

k… via monorail

unread,
Jan 11, 2021, 1:28:49 PM1/11/21
to angleproj...@googlegroups.com

Comment #16 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c16

After re-introducing the ANGLE_MTL_EVENT_AVAILABLE and ANGLE_MTL_SWIZZLE_AVAILABLE #defines in mtl_common.h in https://chromium-review.googlesource.com/2618530 , the next failure (a regression compared to top-of-tree) is:

[ RUN ] BlendIntegerTest.R8I/ES3_Metal
-[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2544: failed assertion `Blending is enabled for render target 0; however, the pixelformat MTLPixelFormatR8Sint for this render target is not blendable.'

k… via monorail

unread,
Jan 11, 2021, 5:19:00 PM1/11/21
to angleproj...@googlegroups.com

Comment #17 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c17

After rerunning the code generation scripts it seems that a different pixel format is being used for the on-screen Metal window and all the Metal tests crash. I'm debugging the regression in this patch set:

https://chromium-review.googlesource.com/c/angle/angle/+/2618530/6..7

k… via monorail

unread,
Jan 11, 2021, 5:23:46 PM1/11/21
to angleproj...@googlegroups.com

Comment #18 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c18

The problem is that MTLPixelFormatRGBA8Unorm is being used, where MTLPixelFormatBGRA8Unorm is needed.

k… via monorail

unread,
Jan 11, 2021, 7:14:10 PM1/11/21
to angleproj...@googlegroups.com

Comment #19 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c19

@syoussefi my understanding is that Apple engineers and @jdarpinian did this - they applied a (very large) patch from downstream WebKit and then attempted to rebase it forward. There was still an unfortunate amount of collision due to concurrently developed features. We will try to minimize the churn before sending Apple's change out for review.

The workaround that was added to src/libANGLE/renderer/metal/mtl_format_map.json mapping B8G8R8A8_UNORM to R8G8B8A8_UNORM was the problem in #c17 and had to be removed.

jdarp… via monorail

unread,
Jan 11, 2021, 9:25:11 PM1/11/21
to angleproj...@googlegroups.com

Comment #20 on issue 5505 by jdarp...@google.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c20

If we run my angle update script in WebKit, it will perform the rebase that's needed to reconcile all of the changes. Afterward upstreaming would be easy. Of course it would be a lot of conflicts to resolve but you'd have the context you need during the rebase. It might be worth a try.

jdarp… via monorail

unread,
Jan 11, 2021, 9:33:38 PM1/11/21
to angleproj...@googlegroups.com

Comment #21 on issue 5505 by jdarp...@google.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c21

Hmm, actually the rebase done by the script may not go back far enough to include all of the necessary changes. If the Apple folks have an actual branch of the angle repo they were working on, that branch would be the place to perform the rebase, rather than the snapshot that's in the WebKit repo.

k… via monorail

unread,
Jan 12, 2021, 8:01:07 PM1/12/21
to angleproj...@googlegroups.com

Comment #22 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c22

jdarpinian@ thanks for your analysis. We'll try your script first when rolling ANGLE back down into WebKit after this big merge.

Kyle and I did a joint debugging session today. Kyle's fixes for a couple of bugs have been added into https://chromium-review.googlesource.com/2618530 .

k… via monorail

unread,
Jan 12, 2021, 8:09:58 PM1/12/21
to angleproj...@googlegroups.com

Comment #23 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c23

For the record, the current test which crashes (aborting the test run) can be run via:

out/Debug/angle_end2end_tests --gtest_filter=AttributeLayoutNonIndexed.Test/ES2_Metal

k… via monorail

unread,
Jan 19, 2021, 2:34:05 PM1/19/21
to angleproj...@googlegroups.com
Issue 5505: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

This issue is now blocking issue 1167763.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1167763

jon… via monorail

unread,
Apr 30, 2021, 3:15:17 PM4/30/21
to angleproj...@googlegroups.com
Updates:
Cc: -jon...@google.com k...@chromium.org
Owner: jon...@google.com

Comment #28 on issue 5505 by jon...@google.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c28

Working on this now

k… via monorail

unread,
Apr 30, 2021, 3:37:41 PM4/30/21
to angleproj...@googlegroups.com

Comment #29 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c29

Super, thank you Jonah!

For the record, initial CL from Kyle Piddington from Apple containing the entire revised Metal backend, conflicts not resolved yet, etc.:
https://chromium-review.googlesource.com/2857366

Let's not collide with each other and duplicate work - Jonah's driving the integration at the moment and will provide status updates.

jon… via monorail

unread,
May 3, 2021, 4:14:59 PM5/3/21
to angleproj...@googlegroups.com

le.ho… via monorail

unread,
May 5, 2021, 2:17:39 PM5/5/21
to angleproj...@googlegroups.com

Comment #31 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c31

Hi,
The works esp the direct translator is really massive. It's really awesome to me.
I just want to leave some comments on the metal back-end's code since I know that part very well. The comments are mostly about out of date code from MetalANGLE which I would like to avoid being merged into upstream:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/

jdarp… via monorail

unread,
May 6, 2021, 12:28:53 AM5/6/21
to angleproj...@googlegroups.com

Comment #32 on issue 5505 by jdarp...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c32

Thank you for the comments, they are very helpful!

Git Watcher via monorail

unread,
Jun 2, 2021, 11:02:09 AM6/2/21
to angleproj...@googlegroups.com

Comment #33 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c33

The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/d7aa0130910c611bc52c38044aa61b6f38deef91

commit d7aa0130910c611bc52c38044aa61b6f38deef91
Author: Kyle Piddington <kpidd...@apple.com>
Date: Mon Apr 26 23:56:15 2021

Upstream Apple's direct-to-Metal backend: compile translator.

This change is meant to merge the translator 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 translator code in a state that
compiles, but not to switch the Metal backend over to use this
translator backend yet.

Bug: angleproject:5505
Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536
Reviewed-by: Jonah Ryan-Davis <jon...@google.com>
Commit-Queue: Jonah Ryan-Davis <jon...@google.com>

[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/BUILD.gn
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/include/GLSLANG/ShaderLang.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/scripts/export_targets.py
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/PoolAlloc.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/PoolAlloc.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/apple_platform_utils.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/platform.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/system_utils_ios.mm
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/common/utilities.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler.gni
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/CodeGen.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/Common.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/Compiler.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/ConstantUnion.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/ConstantUnion.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/IntermNode.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/IntermNode.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/Symbol.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/Symbol.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/SymbolTable.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorGLSL.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/AddExplicitTypeCasts.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/AddExplicitTypeCasts.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/AstHelpers.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/AstHelpers.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ConstantNames.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/DebugSink.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/DiscoverDependentFunctions.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/DiscoverDependentFunctions.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/DiscoverEnclosingFunctionTraverser.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/DiscoverEnclosingFunctionTraverser.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/EmitMetal.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/FixTypeConstructors.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/FixTypeConstructors.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/HoistConstants.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/HoistConstants.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IdGen.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IdGen.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IntermRebuild.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IntermRebuild.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IntroduceVertexIndexID.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/IntroduceVertexIndexID.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Layout.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Layout.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/MapFunctionsToDefinitions.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/MapFunctionsToDefinitions.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/MapSymbols.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/MapSymbols.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ModifyStruct.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ModifyStruct.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Name.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Name.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/NameEmbeddedUniformStructsMetal.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/NameEmbeddedUniformStructsMetal.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/NodeType.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Pipeline.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Pipeline.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/Reference.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteCaseDeclarations.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteCaseDeclarations.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteGlobalQualifierDecls.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteGlobalQualifierDecls.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteKeywords.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteKeywords.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteOutArgs.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteOutArgs.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewritePipelines.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewritePipelines.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteUnaddressableReferences.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/RewriteUnaddressableReferences.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundExpressions.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundExpressions.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundStructDeclarations.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundStructDeclarations.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SkippingTraverser.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SymbolEnv.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/SymbolEnv.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ToposortStructs.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/ToposortStructs.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/TranslatorMetalUtils.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/TranslatorMetalUtils.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/TransposeRowMajorMatrices.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/TransposeRowMajorMatrices.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/WrapMain.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorMetalDirect/WrapMain.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/TranslatorVulkan.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/Types.h
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/NameNamelessUniformBuffers.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/NameNamelessUniformBuffers.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteAtomicCounters.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteAtomicCounters.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteDfdy.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteDfdy.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteRowMajorMatrices.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteRowMajorMatrices.h
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteStructSamplers.cpp
[rename] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/RewriteStructSamplers.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/SimplifyLoopConditions.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/SimplifyLoopConditions.h
[delete] https://crrev.com/9459456b09abc2e75c0c9a67e4b653273087e1eb/src/compiler/translator/tree_ops/gl/mac/RewriteRowMajorMatrices.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_ops/vulkan/RewriteArrayOfArrayOfOpaqueUniforms.cpp
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/AsNode.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/DriverUniform.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/DriverUniform.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/IntermNodePatternMatcher.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/IntermNode_util.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/IntermNode_util.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/SpecializationConstant.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/tree_util/SpecializationConstant.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/util.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/compiler/translator/util.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/libANGLE/Caps.h
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/libANGLE/Compiler.cpp
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/libANGLE/renderer/metal/DisplayMtl.mm
[modify] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/tests/angle_unittests.gni
[add] https://crrev.com/d7aa0130910c611bc52c38044aa61b6f38deef91/src/tests/compiler_tests/MSLOutput_test.cpp

k… via monorail

unread,
Jun 2, 2021, 4:15:43 PM6/2/21
to angleproj...@googlegroups.com
Issue 5505: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

This issue is now blocking issue 1213597.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1213597

k… via monorail

unread,
Jun 25, 2021, 7:29:10 PM6/25/21
to angleproj...@googlegroups.com

Comment #43 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c43

Just a heads up that the direct-to-Metal backend - at least the version currently in WebKit's repository - likely already supports selection of the integrated or discrete GPU during display creation. See https://bugs.webkit.org/show_bug.cgi?id=227408 .

k… via monorail

unread,
Jul 6, 2021, 6:35:25 PM7/6/21
to angleproj...@googlegroups.com
Updates:
Cc: -jdarp...@chromium.org

Comment #46 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c46

Investigation of kernel panics on macOS 10.14.6 while upstreaming Apple's changes to the Metal backend have been ongoing in Issue 6127.

While investigating that issue, it seemed possible that pulling in the latest bug fixes to the Metal backend from WebKit might address them, so time was invested in preparing a CL merging 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

as detailed in:
https://bugs.chromium.org/p/angleproject/issues/detail?id=6127#c17

This CL can be seen here for future reference:
https://chromium-review.googlesource.com/c/angle/angle/+/3010618

However, I'm stopping work on it for the moment as Quyen Le has figured out the cause of the kernel panics (thank you Quyen!), so we're proceeding with the initial upstreaming patch.

k… via monorail

unread,
Jul 7, 2021, 3:38:21 PM7/7/21
to angleproj...@googlegroups.com

Comment #47 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c47

A single place to switch over to the direct-to-MSL compiler is added in this dependent CL:
https://chromium-review.googlesource.com/c/angle/angle/+/3010486

With it enabled, there are widespread test crashes related to the insertion of the ANGLERasterizerDisabled variable in the output shaders; the AST doesn't validate. Perhaps the reference to the variable's being inserted without it being declared, but haven't debugged it yet.

Git Watcher via monorail

unread,
Jul 7, 2021, 4:25:08 PM7/7/21
to angleproj...@googlegroups.com

Comment #48 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c48


The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src/+/de7fb8cfdff7ec7614843a771d7bb6856b056701

commit de7fb8cfdff7ec7614843a771d7bb6856b056701
Author: Kenneth Russell <k...@chromium.org>
Date: Wed Jul 07 20:24:22 2021

Suppress new WebGL failures with ANGLE/Metal upstreaming changes.

conformance/extensions/webgl-debug-shaders.html
conformance/ogles/GL/acos/acos_001_to_006.html
conformance/ogles/GL/asin/asin_001_to_006.html

are failing with the upstreaming of WebKit's libANGLE changes.

Bug: angleproject:5505
Change-Id: Idea65fb550676faff1a920b3d5528558eae9a860
No-Try: True
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3011785
Reviewed-by: Jonah Ryan-Davis <jon...@google.com>
Commit-Queue: Kenneth Russell <k...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#899262}

[modify] https://crrev.com/de7fb8cfdff7ec7614843a771d7bb6856b056701/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt

k… via monorail

unread,
Jul 7, 2021, 4:37:40 PM7/7/21
to angleproj...@googlegroups.com

Comment #49 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c49

Have tested the upstreaming of WebKit's core libANGLE changes from:
https://chromium-review.googlesource.com/c/angle/angle/+/2950067

with the removal of the GPU selection code from DisplayMtl.mm, in Chromium via:
--use-angle=metal

Still renders the WebGL Aquarium OK. Think it's OK to land this with suppressions and move forward.

Git Watcher via monorail

unread,
Jul 8, 2021, 4:28:41 AM7/8/21
to angleproj...@googlegroups.com

Comment #50 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c50


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/08946bee7deb5de30cd4c937ca4bac2c5a5ce361

commit 08946bee7deb5de30cd4c937ca4bac2c5a5ce361
Author: angle-autoroll <angle-a...@skia-public.iam.gserviceaccount.com>
Date: Thu Jul 08 07:00:20 2021

Roll Chromium from 7c193479c917 to 8b6aa9a9bcc2 (411 revisions)

https://chromium.googlesource.com/chromium/src.git/+log/7c193479c917..8b6aa9a9bcc2

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-angle-autoroll
Please CC ti...@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Changed dependencies
* build: https://chromium.googlesource.com/chromium/src/build.git/+log/04f716686d..27e956c028
* buildtools: https://chromium.googlesource.com/chromium/src/buildtools.git/+log/fd3f3c1998..2500c1d8f3
* buildtools/third_party/libc++/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git/+log/8fa8794677..79a2e924d9
* buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/d87a06daa9..cb34896ebd
* testing: https://chromium.googlesource.com/chromium/src/testing/+log/57a831388b..7a41b10cc1
* third_party/abseil-cpp: https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp/+log/173d8869cf..3a5a816917
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..096f6b42b5
* third_party/zlib: https://chromium.googlesource.com/chromium/src/third_party/zlib/+log/00ade15d94..199485df6c
* tools/clang: https://chromium.googlesource.com/chromium/src/tools/clang.git/+log/ccc7ba229a..293314acab
* tools/perf: https://chromium.googlesource.com/chromium/src/tools/perf/+log/116022c2e3..c3d86f5268
Clang version changed llvmorg-13-init-14634-gf814cd74:llvmorg-13-init-14732-g8a7b5ebf
Details: https://chromium.googlesource.com/chromium/src/tools/clang/+/ccc7ba229ab7e050d8276a442cf1f9ad25c846cc..293314acabd2beeb271e67c1cdd11664db9c2881/scripts/update.py

Bug: angleproject:5505
Tbr: ti...@google.com
Change-Id: I9d067fac37b5b64d150f646166f357ec9b11b429
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3013455
Commit-Queue: angle-autoroll <angle-a...@skia-public.iam.gserviceaccount.com>
Bot-Commit: angle-autoroll <angle-a...@skia-public.iam.gserviceaccount.com>

[modify] https://crrev.com/08946bee7deb5de30cd4c937ca4bac2c5a5ce361/DEPS

Git Watcher via monorail

unread,
Jul 9, 2021, 4:00:07 PM7/9/21
to angleproj...@googlegroups.com

Comment #51 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c51


The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src/+/1b8b04abd3693ef05d71a72db5594ac897c22c8c

commit 1b8b04abd3693ef05d71a72db5594ac897c22c8c
Author: Jonah Ryan-Davis <jon...@google.com>
Date: Fri Jul 09 19:59:34 2021

Suppress Webgl failures on ARM Macs with Apple's metal changes.

After merging Apple's direct-to-metal backend, there are two new
failures on the ARM Macs. We can suppress these because it's still
running the old spirv-metal backend, which will no longer be used.

Bug: angleproject:5505
Change-Id: I0daf3a902c47b620116b9d4d021720da7b77e743
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3016118
Commit-Queue: Jonah Ryan-Davis <jon...@google.com>
Commit-Queue: Kenneth Russell <k...@chromium.org>
Reviewed-by: Kenneth Russell <k...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900113}

[modify] https://crrev.com/1b8b04abd3693ef05d71a72db5594ac897c22c8c/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt

Git Watcher via monorail

unread,
Jul 12, 2021, 4:47:06 AM7/12/21
to angleproj...@googlegroups.com

Comment #52 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c52


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/a7d8f8cd51151d4c2453320a321e14d143091e48

commit a7d8f8cd51151d4c2453320a321e14d143091e48
Author: angle-autoroll <angle-a...@skia-public.iam.gserviceaccount.com>
Date: Mon Jul 12 07:00:51 2021

Roll Chromium from e09623df2fbf to 7d1a6713a379 (478 revisions)

https://chromium.googlesource.com/chromium/src.git/+log/e09623df2fbf..7d1a6713a379


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-angle-autoroll
Please CC ti...@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Changed dependencies
* build: https://chromium.googlesource.com/chromium/src/build.git/+log/9d1af1fefb..70f58488ed
* testing: https://chromium.googlesource.com/chromium/src/testing/+log/e1152a2ffc..e065358b5a
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..f691b8d997
* third_party/libjpeg_turbo: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git/+log/b7bef8c05b..e9e400e0af
* tools/clang: https://chromium.googlesource.com/chromium/src/tools/clang.git/+log/2c35569e9f..3fa819890a
* tools/luci-go: git_revision:6808332cfd84a07aeefa906674273fc762510c8c..git_revision:2f836b4882d2fa8c7a44c8ac8881c3a17fad6a86
* tools/luci-go: git_revision:6808332cfd84a07aeefa906674273fc762510c8c..git_revision:2f836b4882d2fa8c7a44c8ac8881c3a17fad6a86
* tools/luci-go: git_revision:6808332cfd84a07aeefa906674273fc762510c8c..git_revision:2f836b4882d2fa8c7a44c8ac8881c3a17fad6a86
* tools/perf: https://chromium.googlesource.com/chromium/src/tools/perf/+log/0039c5300b..511dbaffd9
* tools/skia_goldctl/linux: gyVsF3sYTmaXRfH5ZxgrkitNlEIMmcqWZBcixfrfJ30C..tu1vY2W9BQ6Wx0o3zk5oqBwnr5rfFQGiaztbTpGiRNgC
* tools/skia_goldctl/mac: b-Qs2BgADASerBkyWLb2sUtPJBkhTpZQJNAwASkgrmcC..DPVSayDIq4ga78XaXXcfTzeTE2v33yM8z1w-eaD-ZuQC
* tools/skia_goldctl/win: qrVPZODzWaMfj0T74i2cbqiMzFoqTbUk01Xft2ZTSRMC..HMJwTrgrkRmSqDuyQtWly6YxYSHJXsM6zQJFLkojAVwC
No update to Clang.


Bug: angleproject:5505
Tbr: ti...@google.com
Change-Id: I3c077b02c889b5a1d02a8fb15fb4c4682b9a0eae
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3020444

Git Watcher via monorail

unread,
Jul 12, 2021, 10:55:15 AM7/12/21
to angleproj...@googlegroups.com

Comment #53 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c53


The following revision refers to this bug:

Author: Kyle Piddington <kpidd...@apple.com>
Date: Mon Apr 26 23:56:15 2021

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 <jon...@google.com>
Reviewed-by: Kenneth Russell <k...@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jon...@google.com>

[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/include/platform/FeaturesMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/samples/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/scripts/code_generation_hashes/ANGLE_load_functions_table.json
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/scripts/code_generation_hashes/Metal_default_shaders.json
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/scripts/code_generation_hashes/Metal_format_table.json
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/common/gl/cgl/FunctionsCGL.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/common/system_utils.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/common/system_utils.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/common/utilities.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler.gni
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/TranslatorMetalDirect.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/TranslatorMetalDirect.h
[delete] https://crrev.com/b7cfbac4f8c5f77a1e45064ea9decb6bf654544c/src/compiler/translator/TranslatorMetalDirect/ConstantNames.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundExpressions.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/compiler/translator/tree_util/DriverUniform.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/gpu_info_util/SystemInfo_ios.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/Caps.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/Display.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/driver_utils.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/driver_utils.h
[add] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/driver_utils_ios.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/driver_utils_mac.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/apple/DisplayApple_api.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/cgl/ContextCGL.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/eagl/FunctionsEAGL.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/gl/eagl/FunctionsEAGL.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/load_functions_data.json
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/load_functions_table_autogen.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/BufferMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/BufferMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/CompilerMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ContextMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ContextMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/DisplayMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/DisplayMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/FrameBufferMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/FrameBufferMtl.mm
[add] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.h
[add] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ProgramMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ProgramMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/QueryMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/QueryMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/RenderBufferMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/RenderBufferMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ShaderMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/ShaderMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/SurfaceMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/SurfaceMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/SyncMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/SyncMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/TextureMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/TextureMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/VertexArrayMtl.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/VertexArrayMtl.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_buffer_pool.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_buffer_pool.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_command_buffer.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_command_buffer.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_common.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_format_map.json
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_format_table_autogen.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_format_utils.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_format_utils.mm
[add] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.h
[add] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_glslang_utils.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_glslang_utils.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_occlusion_query_pool.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_occlusion_query_pool.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_render_utils.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_render_utils.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_resources.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_resources.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_state_cache.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_state_cache.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_utils.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/mtl_utils.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/blit.metal
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/copy_buffer.metal
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/format_autogen.h
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/gen_indices.metal
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/gen_mipmap.metal
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/libANGLE/renderer/metal/shaders/mtl_default_shaders_src_autogen.inc
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/compiler_tests/MSLOutput_test.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/deqp_support/deqp_gles2_test_expectations.txt
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/deqp_support/deqp_gles3_test_expectations.txt
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/BlitFramebufferANGLETest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/DepthStencilFormatsTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/MultisampledRenderToTextureTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/RobustResourceInitTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/SimpleOperationTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/TextureUploadFormatTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/gl_tests/TransformFeedbackTest.cpp
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/src/tests/test_expectations/GPUTestConfig_ios.mm
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/third_party/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/util/BUILD.gn
[modify] https://crrev.com/d33a22228ee2999ab5e2d2eda4d405c5768555d2/util/test_utils_unittest.cpp

k… via monorail

unread,
Jul 12, 2021, 6:00:51 PM7/12/21
to angleproj...@googlegroups.com

Comment #54 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c54

Kyle suggested on Slack that we investigate:
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c47

next - e.g. trying to turn on the direct-to-Metal backend and debug the AST validation failure regarding the internal ANGLERasterizerDisabled variable.

jon… via monorail

unread,
Jul 12, 2021, 6:05:05 PM7/12/21
to angleproj...@googlegroups.com

Comment #55 on issue 5505 by jon...@google.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c55

The stack trace around the AST validation failure is:

AST validation error(s):
ERROR: 0:? : 'ANGLERasterizerDisabled' : Found reference to undeclared or inconsistently transformed variable <validateVariableReferences>

../../src/tests/test_utils/ANGLETest.cpp:64: Failure
Compiler.cpp:559 (validateAST): ! Assert failed in validateAST (../../src/compiler/translator/Compiler.cpp:559): valid
Backtrace:
angle::(anonymous namespace)::TestPlatform_logError(angle::PlatformMethods*, char const*) (+0x94)
angle::LoggingAnnotator::logMessage(gl::LogMessage const&) const (+0xf1)
gl::LogMessage::~LogMessage() (+0xa6)
gl::LogMessage::~LogMessage() (+0x15)
sh::TCompiler::validateAST(sh::TIntermNode*) (+0x1e3)




There was also an issue that may or may not crop up after this related to adding keys in kGraphicsDriverUniformNamesExt in DriverUniforms.cpp.
It was causing a crash on shader compilation with very little stack trace info. I haven't debugged much, and the issue might be gone now.

k… via monorail

unread,
Jul 12, 2021, 7:37:50 PM7/12/21
to angleproj...@googlegroups.com
Updates:
Cc: jon...@google.com
Owner: k...@chromium.org

Comment #56 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c56

While Jonah's on other work the next couple of days I'll try to move this debugging forward.

syous… via monorail

unread,
Jul 12, 2021, 7:45:06 PM7/12/21
to angleproj...@googlegroups.com

Comment #57 on issue 5505 by syou...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c57

The AST validation error is due to the fact that some transformation in the metal path is leaving the tree in an inconsistent state. This particular failure is because the AST is referencing a variable (a specialization constant actually) that's not defined in the tree (but rather generated in text). Look for kRasterizerDiscardEnabledConstName.

The AST validation is actually prepared to make a special-case for this, and `validateSpecConstReferences` is false by default. However, spec consts are identified by the qualifier `EvqSpecConst`. This diff should make the AST validation go away:

// Create kRasterizerDiscardEnabledConstName variable reference.
TType *boolType = new TType(EbtBool);
- boolType->setQualifier(EvqConst);
+ boolType->setQualifier(EvqSpecConst);
TVariable *discardEnabledVar =
new TVariable(symbolTable, ImmutableString(mtl::kRasterizerDiscardEnabledConstName),
boolType, SymbolType::AngleInternal);

syous… via monorail

unread,
Jul 12, 2021, 7:46:53 PM7/12/21
to angleproj...@googlegroups.com

Comment #58 on issue 5505 by syou...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c58

FYI, the Vulkan path no longer generates the spec const definitions in text, but rather creates actual tree nodes for them. If the metal backend is fixed to do that too, then the `validateSpecConstReferences` validation can also be enabled.

k… via monorail

unread,
Jul 12, 2021, 8:59:43 PM7/12/21
to angleproj...@googlegroups.com

Comment #59 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c59

Following up to #c46 above, a CL merging in many more of Apple's ANGLE changes from WebKit can be seen here:
https://chromium-review.googlesource.com/c/angle/angle/+/3010618

It's been rebased on top of ToT ANGLE.

Right now, will be working on the ANGLERasterizerDisabled failure above.

jon… via monorail

unread,
Jul 13, 2021, 1:33:07 PM7/13/21
to angleproj...@googlegroups.com
Issue 5505: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

This issue is now blocking issue 1228433.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1228433

Git Watcher via monorail

unread,
Jul 13, 2021, 3:14:07 PM7/13/21
to angleproj...@googlegroups.com

Comment #61 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c61


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/b202d5cf30685cb9b51df60ccf8311b1bec48b64

commit b202d5cf30685cb9b51df60ccf8311b1bec48b64
Author: Jonah Ryan-Davis <jon...@google.com>
Date: Tue Jul 13 17:34:19 2021

Suppress BlitFramebufferTest.MultisampleDepth on Metal

This test is failing on Intel as well, expand the suppression.

Bug: chromium:1228433
Bug: angleproject:5505
Change-Id: I98e240897b996d5d8d9a5977ef777f928b25c9dd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3024591
Reviewed-by: Cody Northrop <cnor...@google.com>
Reviewed-by: Yuly Novikov <ynov...@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jon...@google.com>

[modify] https://crrev.com/b202d5cf30685cb9b51df60ccf8311b1bec48b64/src/tests/gl_tests/BlitFramebufferANGLETest.cpp

k… via monorail

unread,
Jul 13, 2021, 4:03:41 PM7/13/21
to angleproj...@googlegroups.com

Comment #62 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c62

Changing the generated variables to EvqSpecConst and turning on the direct-to-Metal backend produces the next failure here, in the first test run with the Metal backend:

$ out/Debug/angle_end2end_tests --gtest_filter=\*ES\*Metal\*

-----
[ RUN ] EGLBlobCacheTest.Functional/ES2_Metal
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "r+") is skipped
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "w+") is skipped
AST validation error(s):
ERROR: 0:6: 'aTest' : Found reference to undeclared or inconsistently transformed variable <validateVariableReferences>
ERROR: 0:7: 'aPosition' : Found reference to undeclared or inconsistently transformed variable <validateVariableReferences>

../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
Compiler.cpp:559 (validateAST): ! Assert failed in validateAST (../../third_party/angle/src/compiler/translator/Compiler.cpp:559): valid
Stack trace:
0 angle_end2end_tests 0x000000010fb1ecdd angle::(anonymous namespace)::TestPlatform_logError(angle::PlatformMethods*, char const*) + 125
1 libGLESv2.dylib 0x000000011f517bd1 angle::LoggingAnnotator::logMessage(gl::LogMessage const&) const + 241
2 libGLESv2.dylib 0x00000001202e2196 gl::LogMessage::~LogMessage() + 166
3 libGLESv2.dylib 0x00000001202e1b35 gl::LogMessage::~LogMessage() + 21
4 libGLESv2.dylib 0x000000012031b253 sh::TCompiler::validateAST(sh::TIntermNode*) + 483
5 libGLESv2.dylib 0x000000012054eeb3 sh::TIntermRebuild::rebuildRoot(sh::TIntermBlock&) + 67
6 libGLESv2.dylib 0x00000001205aac31 (anonymous namespace)::GeneratePipelineStruct::exec(sh::TIntermBlock&) + 65
7 libGLESv2.dylib 0x00000001205a9a5e (anonymous namespace)::GeneratePipelineStruct::Exec((anonymous namespace)::PipelineStructInfo&, sh::TCompiler&, sh::TIntermBlock&, sh::IdGen&, sh::Pipeline const&, sh::SymbolEnv&, sh::Invariants&) + 158
8 libGLESv2.dylib 0x00000001205a9631 (anonymous namespace)::RewritePipeline(sh::TCompiler&, sh::TIntermBlock&, sh::IdGen&, sh::Pipeline const&, sh::SymbolEnv&, sh::Invariants&, sh::PipelineScoped<sh::TStructure>&) + 497
9 libGLESv2.dylib 0x00000001205a93a0 sh::RewritePipelines(sh::TCompiler&, sh::TIntermBlock&, sh::IdGen&, sh::DriverUniform&, sh::SymbolEnv&, sh::Invariants&, sh::PipelineStructs&) + 768
10 libGLESv2.dylib 0x000000012051be3d sh::TranslatorMetalDirect::translateImpl(sh::TInfoSinkBase&, sh::TIntermBlock*, unsigned long long, sh::PerformanceDiagnostics*, sh::SpecConst*, sh::DriverUniform*) + 6957
...
-----

Disabling AST validation in TIntermRebuild causes a crash which needs to be caught in the debugger to be useful:

-----
(lldb) bt
* thread #6, stop reason = signal SIGABRT
* frame #0: 0x00007fff2044e92e libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff2047d5bd libsystem_pthread.dylib`pthread_kill + 263
frame #2: 0x00007fff203d2411 libsystem_c.dylib`abort + 120
frame #3: 0x0000000112f31971 libGLESv2.dylib`std::__1::__throw_out_of_range(__msg="unordered_map::at: key not found") at stdexcept:270:5
frame #4: 0x0000000114095631 libGLESv2.dylib`std::__1::unordered_map<unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::at(this=0x000000010b08d048 size=2, __k=0x0000700003891510) at unordered_map:1789:9
frame #5: 0x000000011409484e libGLESv2.dylib`sh::TranslatorMetalReflection::getOriginalName(this=0x000000010b08d040, id=3096) at TranslatorMetalDirect.h:72:73
frame #6: 0x00000001140209dd libGLESv2.dylib`(anonymous namespace)::GenMetalTraverser::emitUniformBufferDeclaration(this=0x0000700003892df8, field=0x000000010b8a7900, annotationIndices=0x0000700003891808)::GenMetalTraverser::FieldAnnotationIndices&) at EmitMetal.cpp:1165:50
frame #7: 0x000000011401e65c libGLESv2.dylib`(anonymous namespace)::GenMetalTraverser::emitStructDeclaration(this=0x0000700003892df8, type=0x000000010b8a9510) at EmitMetal.cpp:1225:13
frame #8: 0x000000011401d466 libGLESv2.dylib`(anonymous namespace)::GenMetalTraverser::emitVariableDeclaration(this=0x0000700003892df8, decl=0x0000700003892678, evdConfig=0x00007000038922b8)::VarDecl const&, (anonymous namespace)::GenMetalTraverser::EmitVariableDeclarationConfig const&) at EmitMetal.cpp:1282:17
frame #9: 0x0000000114013cb5 libGLESv2.dylib`(anonymous namespace)::GenMetalTraverser::visitDeclaration(this=0x0000700003892df8, (null)=PreVisit, declNode=0x000000010b8a9490) at EmitMetal.cpp:2211:9
frame #10: 0x0000000113f29a37 libGLESv2.dylib`sh::TIntermDeclaration::visit(this=0x000000010b8a9490, visit=PreVisit, it=0x0000700003892df8) at IntermTraverse.cpp:169:16
frame #11: 0x0000000113f2935c libGLESv2.dylib`void sh::TIntermTraverser::traverse<sh::TIntermNode>(this=0x0000700003892df8, node=0x000000010b8a9490) at IntermTraverse.cpp:32:23
frame #12: 0x0000000113f2954d libGLESv2.dylib`sh::TIntermNode::traverse(this=0x000000010b8a9490, it=0x0000700003892df8) at IntermTraverse.cpp:63:9
frame #13: 0x0000000114013596 libGLESv2.dylib`(anonymous namespace)::GenMetalTraverser::visitBlock(this=0x0000700003892df8, (null)=PreVisit, blockNode=0x000000010b86c480) at EmitMetal.cpp:2165:18
frame #14: 0x0000000113f29aa4 libGLESv2.dylib`sh::TIntermBlock::visit(this=0x000000010b86c480, visit=PreVisit, it=0x0000700003892df8) at IntermTraverse.cpp:179:16
frame #15: 0x0000000113f2c07a libGLESv2.dylib`sh::TIntermTraverser::traverseBlock(this=0x0000700003892df8, node=0x000000010b86c480) at IntermTraverse.cpp:466:23
frame #16: 0x0000000113f297c1 libGLESv2.dylib`sh::TIntermBlock::traverse(this=0x000000010b86c480, it=0x0000700003892df8) at IntermTraverse.cpp:101:9
frame #17: 0x000000011400f5ea libGLESv2.dylib`sh::EmitMetal(compiler=0x000000010b08c400, root=0x000000010b86c480, idGen=0x0000700003893560, pipelineStructs=0x00007000038933e8, invariants=0x00007000038936a0, symbolEnv=0x00007000038937e8, ppc=0x0000700003893558, symbolTable=0x000000010b08c7e0) at EmitMetal.cpp:2485:14
frame #18: 0x0000000113ff9082 libGLESv2.dylib`sh::TranslatorMetalDirect::translateImpl(this=0x000000010b08c400, sink=0x000000010b08cf88, root=0x000000010b86c480, compileOptions=36594225705386060, (null)=0x0000700003893b08, specConst=0x0000700003893a38, driverUniforms=0x0000700003893a18) at TranslatorMetalDirect.cpp:1153:10
frame #19: 0x0000000113ffbe0b libGLESv2.dylib`sh::TranslatorMetalDirect::translate(this=0x000000010b08c400, root=0x000000010b86c480, compileOptions=36594225705386060, perfDiagnostics=0x0000700003893b08) at TranslatorMetalDirect.cpp:1200:10
-----

The TranslatorMetalDirect path is producing invalid variable references - I assume it's moving global variables into a top-level struct and failing to update those variables to refer to the struct's fields, or something similar.

syous… via monorail

unread,
Jul 13, 2021, 4:33:43 PM7/13/21
to angleproj...@googlegroups.com

Comment #63 on issue 5505 by syou...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c63


> I assume it's moving global variables into a top-level struct and failing to update those variables to refer to the struct's fields, or something similar.

Very likely. I usually use a VariableReplacementMap that maps the replaced variables with their replacement (for example during visitDeclaration), then make sure the transformation replaces the variables (in visitSymbol) accordingly.


> ERROR: 0:6: 'aTest' : Found reference to undeclared or inconsistently transformed variable <validateVariableReferences>
> ERROR: 0:7: 'aPosition' : Found reference to undeclared or inconsistently transformed variable <validateVariableReferences>

From the test, these are vertex shader attributes, so I'd look at whatever is changing those (which you should be able to find easily from the stack trace of the validation error). I cannot attest to the correctness of sh::TIntermRebuild::rebuildRoot itself, as it's a reinvent-the-wheel piece of code.

k… via monorail

unread,
Jul 13, 2021, 6:30:00 PM7/13/21
to angleproj...@googlegroups.com

Comment #64 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c64

cnorthrop@ found that the ANGLE roll into Chromium is failing on the ios-simulator bot:
https://ci.chromium.org/ui/p/chromium/builders/try/ios-simulator/902112/overview

Attempting to fix in:
https://chromium-review.googlesource.com/c/angle/angle/+/3025238

Git Watcher via monorail

unread,
Jul 13, 2021, 6:59:09 PM7/13/21
to angleproj...@googlegroups.com

Comment #65 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c65


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/4d9dbf9cb79affe51a106cfdfbe3acea954f0daa

commit 4d9dbf9cb79affe51a106cfdfbe3acea954f0daa
Author: Kenneth Russell <k...@chromium.org>
Date: Tue Jul 13 22:23:30 2021

Use "frameworks" rather than "libs" for iOS dependencies.

The angle_test_expectations static library has added this dependency
but it fails to build on the ios-simulator bot. Try using "frameworks"
instead.

Bug: angleproject:5505
Change-Id: Ia08240a042f241c7eefe0de730b6942a60047054
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3025238
Reviewed-by: Cody Northrop <cnor...@google.com>
Commit-Queue: Cody Northrop <cnor...@google.com>

[modify] https://crrev.com/4d9dbf9cb79affe51a106cfdfbe3acea954f0daa/src/tests/BUILD.gn

k… via monorail

unread,
Jul 13, 2021, 8:49:11 PM7/13/21
to angleproj...@googlegroups.com

Comment #66 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c66

Kyle pointed out on Slack that in the upstreaming, the default uniform block is declared differently: WebKit declares ANGLEUniformblock as a struct, where Chrome declares it as an InterfaceBlock. The WebKit team pulled out the functions to create driver uniforms into TranslatorMetalDirect, and Kyle assumes that was reverted to reduce code duplication, but doing so changed the behavior.

Git Watcher via monorail

unread,
Jul 13, 2021, 9:24:21 PM7/13/21
to angleproj...@googlegroups.com

Comment #67 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c67


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/2a668d9219dd91c3c0ab648be36d367d9a6086a5

commit 2a668d9219dd91c3c0ab648be36d367d9a6086a5
Author: Kenneth Russell <k...@chromium.org>
Date: Tue Jul 13 23:49:16 2021

Fix iOS Simulator build after direct-to-Metal upstreaming.

Bug: angleproject:5505
Change-Id: I4e690099502be2f2404a25d67356d452cf63451b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3025240

Reviewed-by: Cody Northrop <cnor...@google.com>
Reviewed-by: Yuly Novikov <ynov...@chromium.org>

jon… via monorail

unread,
Jul 14, 2021, 11:39:28 AM7/14/21
to angleproj...@googlegroups.com
Updates:
Cc: cnor...@google.com beh...@chromium.org

Comment #68 on issue 5505 by jon...@google.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c68

Issue chromium:1228433 has been merged into this issue.

k… via monorail

unread,
Jul 16, 2021, 2:06:23 AM7/16/21
to angleproj...@googlegroups.com

Comment #69 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c69

Making some progress. Added a mode to DriverUniforms to emit a struct rather than an interface block, which is what WebKit's version expected. Removed emission of @@XFB-Bindings@@ as other xfb-related changes were undone during the upstreaming. Fixed name of ANGLERasterizationDiscard constant, which has to match the SPIR-V Metal backend due to code changes during review. Running into problem where pipelines aren't specializing properly; the shader still references ANGLEUniforms, where the specialization was supposed to have renamed this to ANGLE_angleUniforms.

k… via monorail

unread,
Jul 16, 2021, 7:17:32 PM7/16/21
to angleproj...@googlegroups.com

Comment #70 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c70

Here's the output of the first test, which fails:
out/Debug/angle_end2end_tests --gtest_filter=EGLBlobCacheTest.Functional/ES2_Metal

and attached is the generated Metal shader which fails to compile.

In the process of extracting the same output from top-of-tree WebKit to see exactly what it produces.


---
[ RUN ] EGLBlobCacheTest.Functional/ES2_Metal
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "r+") is skipped
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "w+") is skipped
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "r+") is skipped
fopen("/var/folders/4j/b231sqks3ts88_ls1h2069jm002z4b/C//com.apple.metal/31001/libraries.data", "w+") is skipped
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
ProgramMtl.mm:743 (createMslShaderLib): Internal error compiling shader with Metal backend.
Compilation failed:

program_source:96:70: error: use of undeclared identifier 'ANGLEUniforms'
ANGLE_vertexOut.gl_Position.z = (ANGLE_vertexOut.gl_Position.z * ANGLEUniforms.ANGLE_depthRange.ANGLE_reserved);
^
program_source:97:70: error: use of undeclared identifier 'ANGLEUniforms'
ANGLE_vertexOut.gl_Position.y = (ANGLE_vertexOut.gl_Position.y * ANGLEUniforms.ANGLE_negFlipXY.y);
^

Stack trace:
0 angle_end2end_tests 0x000000010451f27d angle::(anonymous namespace)::TestPlatform_logError(angle::PlatformMethods*, char const*) + 125
1 libGLESv2.dylib 0x00000001172c2f81 angle::LoggingAnnotator::logMessage(gl::LogMessage const&) const + 241
2 libGLESv2.dylib 0x000000011809a276 gl::LogMessage::~LogMessage() + 166
3 libGLESv2.dylib 0x0000000118099c15 gl::LogMessage::~LogMessage() + 21
4 libGLESv2.dylib 0x0000000117c5d27c rx::ProgramMtl::createMslShaderLib(rx::mtl::Context*, gl::ShaderType, gl::InfoLog&, rx::mtl::TranslatedShaderInfo*, NSDictionary<NSString*, NSObject*>*) + 988
5 libGLESv2.dylib 0x0000000117c5d9a9 rx::ProgramMtl::linkImplDirect(gl::Context const*, gl::ProgramLinkedResources const&, gl::InfoLog&) + 1241
6 libGLESv2.dylib 0x0000000117c5bae7 rx::ProgramMtl::linkImpl(gl::Context const*, gl::ProgramLinkedResources const&, gl::InfoLog&) + 71
7 libGLESv2.dylib 0x0000000117c5b98f rx::ProgramMtl::link(gl::Context const*, gl::ProgramLinkedResources const&, gl::InfoLog&, std::__1::vector<gl::ProgramVaryingRef, std::__1::allocator<gl::ProgramVaryingRef> > const&) + 95
8 libGLESv2.dylib 0x00000001172e9e57 gl::Program::linkImpl(gl::Context const*) + 3975
9 libGLESv2.dylib 0x00000001172e8e58 gl::Program::link(gl::Context const*) + 40
10 libGLESv2.dylib 0x00000001171c0315 gl::Context::linkProgram(gl::ShaderProgramID) + 421
11 libGLESv2.dylib 0x0000000117032b4a GL_LinkProgram + 330
12 libangle_util.dylib 0x000000010e5cfe83 (anonymous namespace)::CompileProgramInternal(char const*, char const*, char const*, char const*, char const*, std::__1::function<void (unsigned int)> const&) + 771
13 libangle_util.dylib 0x000000010e5cff49 CompileProgram(char const*, char const*) + 89
14 angle_end2end_tests 0x00000001033019f9 angle::GLProgram::makeRaster(char const*, char const*) + 41
15 angle_end2end_tests 0x00000001033013bc EGLBlobCacheTest_Functional_Test::TestBody() + 620
...

Attachments:
shader-mtl.txt 3.2 KB

k… via monorail

unread,
Jul 16, 2021, 7:36:42 PM7/16/21
to angleproj...@googlegroups.com

Comment #71 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c71

Here's the WebGL test case and WebKit's direct-to-Metal output. There are a few differences but no big surprises. The only problem is that the references to ANGLEUniforms aren't being rewritten. Debugging why not.

Attachments:
basic-shader.html 1.2 KB
shader-webkit-mtl.txt 3.4 KB

k… via monorail

unread,
Jul 17, 2021, 3:19:18 AM7/17/21
to angleproj...@googlegroups.com

Comment #72 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c72

https://chromium-review.googlesource.com/c/angle/angle/+/3010486 is up for review fixing several crashes and assertion failures in the direct-to-MSL backend. With those fixes in place, several hundred angle_end2end_tests run without crashing, though still with many failures. Have been running with:

out/Debug/angle_end2end_tests --gtest_filter=\*Metal\*

The next crash is:

[ RUN ] GLSLTest.NamelessScopedStructs/ES2_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
IdGen.cpp:52 (createNewName): ! Assert failed in createNewName (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/IdGen.cpp:52): *base != '_'
Stack trace:
0 angle_end2end_tests 0x00000001040ce8fd angle::(anonymous namespace)::TestPlatform_logError(angle::PlatformMethods*, char const*) + 125
1 libGLESv2.dylib 0x00000001135a7f81 angle::LoggingAnnotator::logMessage(gl::LogMessage const&) const + 241
2 libGLESv2.dylib 0x000000011437f276 gl::LogMessage::~LogMessage() + 166
3 libGLESv2.dylib 0x000000011437ec15 gl::LogMessage::~LogMessage() + 21
4 libGLESv2.dylib 0x00000001145eb7bd _ZN2sh5IdGen13createNewNameINS_15ImmutableStringEZNS0_13createNewNameESt16initializer_listIS2_EE3$_0EENS_4NameEmPKT_RKT0_ + 765
5 libGLESv2.dylib 0x00000001145eb3c0 sh::IdGen::createNewName(std::initializer_list<sh::ImmutableString>) + 96
6 libGLESv2.dylib 0x00000001145eb329 sh::IdGen::createNewName(sh::ImmutableString const&) + 89
7 libGLESv2.dylib 0x00000001145eb48c sh::IdGen::createNewName(char const*) + 76
8 libGLESv2.dylib 0x0000000114675cee (anonymous namespace)::Separator::visitDeclaration(sh::Visit, sh::TIntermDeclaration*) + 734
9 libGLESv2.dylib 0x00000001144c2297 sh::TIntermDeclaration::visit(sh::Visit, sh::TIntermTraverser*) + 39
10 libGLESv2.dylib 0x00000001144c1d28 void sh::TIntermTraverser::traverse<sh::TIntermNode>(sh::TIntermNode*) + 424
11 libGLESv2.dylib 0x00000001144c1dad sh::TIntermNode::traverse(sh::TIntermTraverser*) + 29
12 libGLESv2.dylib 0x00000001144c4865 sh::TIntermTraverser::traverseBlock(sh::TIntermBlock*) + 325
13 libGLESv2.dylib 0x00000001144c2021 sh::TIntermBlock::traverse(sh::TIntermTraverser*) + 33
14 libGLESv2.dylib 0x00000001144c46a0 sh::TIntermTraverser::traverseFunctionDefinition(sh::TIntermFunctionDefinition*) + 288
15 libGLESv2.dylib 0x00000001144c1ff1 sh::TIntermFunctionDefinition::traverse(sh::TIntermTraverser*) + 33
16 libGLESv2.dylib 0x00000001144c4865 sh::TIntermTraverser::traverseBlock(sh::TIntermBlock*) + 325
17 libGLESv2.dylib 0x00000001144c2021 sh::TIntermBlock::traverse(sh::TIntermTraverser*) + 33
18 libGLESv2.dylib 0x000000011467576b sh::SeparateCompoundStructDeclarations(sh::TCompiler&, sh::IdGen&, sh::TIntermBlock&) + 123
19 libGLESv2.dylib 0x00000001145bddba sh::TranslatorMetalDirect::translateImpl(sh::TInfoSinkBase&, sh::TIntermBlock*, unsigned long long, sh::PerformanceDiagnostics*, sh::SpecConst*, sh::DriverUniform*) + 6618
20 libGLESv2.dylib 0x00000001145c0edd sh::TranslatorMetalDirect::translate(sh::TIntermBlock*, unsigned long long, sh::PerformanceDiagnostics*) + 589
21 libGLESv2.dylib 0x000000011442dfdb sh::TCompiler::compile(char const* const*, unsigned long, unsigned long long) + 315
22 libGLESv2.dylib 0x0000000114433cea sh::Compile(void*, char const* const*, unsigned long, unsigned long long) + 410
23 libGLESv2.dylib 0x0000000113802bb3 rx::TranslateTask::operator()() + 339
24 libGLESv2.dylib 0x00000001136f793f _ZZN5angle15AsyncWorkerPool22checkToRunPendingTasksEvENK3$_1clEv + 319
...

and will likely require either a larger bug fix or more code to be upstreamed from WebKit, so checkpointing the work here.

Git Watcher via monorail

unread,
Jul 19, 2021, 4:03:10 PM7/19/21
to angleproj...@googlegroups.com

Comment #73 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c73


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/b3cbfd55859c950636bccc5ac51c2fa758a4ed31

commit b3cbfd55859c950636bccc5ac51c2fa758a4ed31
Author: Kenneth Russell <k...@chromium.org>
Date: Wed Jul 07 19:31:57 2021

Fix multiple end2end crashes in direct-to-MSL compiler.

This set of changes:

- Adds a single place (CompilerMtl::useDirectToMSLCompiler) where the
direct-to-MSL compiler can be enabled, still at compile time rather
than run time. It is still disabled by default.
- Initializes MTLWaitableCompileEventImpl::mShader, without which all
shader compiles crash.
- Fixes a mismatch of the ANGLERasterizerDisabled variable name in
the generated MSL.
- Removes the transform feedback bindings as an argument to the
vertex shader's main0(). Transform feedback support needs to be
reimplemented in this compiler backend.
- Added an option to the DriverUniform class to emit as either an
interface block or a struct. The direct-to-MSL backend assumes it
is a struct.
- Disable variable reference validation when referencing either
sample mask or rasterizer discard functionality in the shader.
- Disable struct usage validation when inserting references to
ANGLE_TextureEnv. This occurs during pipeline rewriting and it's
infeasible to disable it at that point, so disable it during
pipeline rewriting - which means it's disabled for all shaders.
- For angle_end2end_tests, disable the file API hooking which
disables the Metal shader cache. This speeds up the tests
significantly - by roughly a factor of 5.

With these changes, several hundred angle_end2end_tests run without
any assertion failures, though still with many test failures. The next
crash is in:
GLSLTest.NamelessScopedStructs/ES2_Metal
and will likely require a larger bug fix, or more changes to be
upstreamed from WebKit's repository.

Bug: angleproject:5505
Change-Id: Ia1ea9a13867f00035d4aeccf907fd032255588e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3010486
Commit-Queue: Kenneth Russell <k...@chromium.org>
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jon...@google.com>

[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/TranslatorMetal.h
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/TranslatorMetalDirect.cpp
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.cpp
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/TranslatorVulkan.cpp
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/tree_util/DriverUniform.cpp
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/compiler/translator/tree_util/DriverUniform.h
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/libANGLE/renderer/metal/CompilerMtl.h
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/libANGLE/renderer/metal/CompilerMtl.mm
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/libANGLE/renderer/metal/ProgramMtl.mm
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/libANGLE/renderer/metal/ShaderMtl.mm
[modify] https://crrev.com/b3cbfd55859c950636bccc5ac51c2fa758a4ed31/src/tests/test_utils/runner/TestSuite.cpp

k… via monorail

unread,
Jul 26, 2021, 8:22:02 PM7/26/21
to angleproj...@googlegroups.com

Comment #75 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c75

Got past the GLSLTest.NamelessScopedStructs/ES2_Metal failure on kpiddington@'s advice by cherry-picking the fix for:

ASSERT in webgl/1.0.x/conformance/glsl/misc/uninitialized-local-global-variables.html IdGen ASSERT(*base != '_');
https://bugs.webkit.org/show_bug.cgi?id=227482

and making some additional fixes. To have this recorded here, a merge of Apple's ANGLE changes up to July 12 is:

Upstream latest changes to the Metal backend from Apple.
https://chromium-review.googlesource.com/c/angle/angle/+/3010618/2

and contains the changes between these WebKit commits:
https://git.webkit.org/?p=WebKit.git;a=commit;h=8648b353ab1d7730438c2e08319e1a4d64982c31
https://git.webkit.org/?p=WebKit.git;a=commit;h=166e4924a52971d6a32ad48247a439b16c00e062

Looking for a change which may have fixed an assertion failure while running:

[ RUN ] GLSLTest.ArrayOfStructContainingArrayOfSamplers/ES2_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
RewritePipelines.cpp:787 (visitMain): ! Assert failed in visitMain (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/RewritePipelines.cpp:787): !envType.isArrayOfArrays()

k… via monorail

unread,
Jul 28, 2021, 4:04:05 AM7/28/21
to angleproj...@googlegroups.com

Comment #76 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c76

The cause of the assertion failure above was that Apple's version of the RewriteStructSamplers pass wasn't upstreamed. The version in the compiler's common code is incompatible with the rest of the transformations done in the direct-to-Metal backend.

https://chromium-review.googlesource.com/c/angle/angle/+/3058524 fixes this and several other assertion failures. With this CL, angle_end2end_tests runs to completion (no crashes) with the direct-to-Metal backend turned on! There are still ~1300 failures of the ~4000 tests, which will be worked on next.

k… via monorail

unread,
Jul 28, 2021, 4:09:05 AM7/28/21
to angleproj...@googlegroups.com

Comment #77 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c77

I can't attach the text file containing the current angle_end2end_tests results; see https://crbug.com/monorail/9985 .

k… via monorail

unread,
Jul 28, 2021, 8:42:35 PM7/28/21
to angleproj...@googlegroups.com

Comment #79 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c79

Working with Shabi on the latest upstreaming patch. Trying to remove the old copy of RewriteStructSamplers which I reintroduced. This version of the CL still contains it:
https://chromium-review.googlesource.com/c/angle/angle/+/3058524/3

While trying to remove it and use the current RewriteStructSamplers as advised on that CL, the following assertion failure is hit:

[ RUN ] GLSLTest.ArrayOfStructContainingArrayOfSamplers/ES2_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
RewritePipelines.cpp:787 (visitMain): ! Assert failed in visitMain (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/RewritePipelines.cpp:787): !envType.isArrayOfArrays()

This is the same assertion failure that was hit during earlier testing, and which motivated upstreaming what turns out was an old copy of this code.

This is the source of the fragment shader:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/swiftshader/third_party/angle/angle/src/tests/gl_tests/GLSLTest.cpp;l=2300?q=ArrayOfStructContainingArrayOfSamplers
Here's its AST at the point just before calling RewritePipelines:
0:1: Code block
0:? : Declaration
0:? : ''(symbol id 3073) (structure)
0:? : Declaration
0:? : 'test_data' (symbol id 3071) (uniform mediump array[2] of array[2] of sampler2D)
0:? : Declaration
0:? : ''(symbol id 3075) (uniform structure)
0:? : Declaration
0:? : 'ANGLE_angleUniforms' (symbol id 3076) (uniform structure)
0:? : Function Definition:
0:? : Function Prototype (internal function): _0_main (symbol id 3070) (void)
0:4: Code block
0:5: move second child to first child (mediump 4-component vector of float)
0:5: 'gl_FragColor' (symbol id 2962) (FragColor mediump 4-component vector of float)
0:5: Construct (mediump 4-component vector of float)
0:5: vector swizzle (x) (mediump float)
0:5: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:5: direct index (mediump sampler2D)
0:? : direct index (mediump array[2] of sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[2] of array[2] of sampler2D)
0:5: 1 (const int)
0:5: 1 (const int)
0:5: 0.0 (const float)
0:5: 0.0 (const float)
0:6: vector swizzle (x) (mediump float)
0:6: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:6: direct index (mediump sampler2D)
0:? : direct index (mediump array[2] of sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[2] of array[2] of sampler2D)
0:6: 1 (const int)
0:6: 0 (const int)
0:6: 0.0 (const float)
0:6: 0.0 (const float)
0:7: vector swizzle (x) (mediump float)
0:7: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:7: direct index (mediump sampler2D)
0:? : direct index (mediump array[2] of sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[2] of array[2] of sampler2D)
0:7: 0 (const int)
0:7: 1 (const int)
0:7: 0.0 (const float)
0:7: 0.0 (const float)
0:8: vector swizzle (x) (mediump float)
0:8: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:8: direct index (mediump sampler2D)
0:? : direct index (mediump array[2] of sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[2] of array[2] of sampler2D)
0:8: 0 (const int)
0:8: 0 (const int)
0:8: 0.0 (const float)
0:8: 0.0 (const float)
0:? : Declaration
0:? : 'gl_FragColor' (symbol id 2962) (FragColor mediump 4-component vector of float)
0:? : Declaration
0:? : 'gl_SampleMask' (symbol id 3077) (SampleMask highp uint)
0:? : Function Definition:
0:4: Function Prototype: main (symbol id 3069) (void)
0:? : Code block
0:? : Call a user-defined function (internal function): _0_main (symbol id 3070) (void)
0:? : If test
0:? : Condition
0:? : 'ANGLECoverageMaskEnabled' (symbol id 3078) (const bool)
0:? : true case
0:? : Code block
0:? : Call a user-defined function (internal function): writeSampleMask (symbol id 3079) (void)
0:? : direct index for structure (uint)
0:? : 'ANGLE_angleUniforms' (symbol id 3076) (uniform structure)
0:? : 12 (field 'coverageMask')
0:? : 'gl_SampleMask' (symbol id 3077) (SampleMask highp uint)


The uniform's been flattened and the struct removed, but the array of arrays is still present, which RewritePipelines can't handle.

I'll try to dump the AST using the old RewriteStructSamplers for comparison.

k… via monorail

unread,
Jul 28, 2021, 8:50:55 PM7/28/21
to angleproj...@googlegroups.com

Comment #80 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c80

Here's the AST with the old RewriteStructSamplers. test_data's been flattened into a single array of sampler2D of length 4.


0:1: Code block
0:? : Declaration
0:? : ''(symbol id 3073) (structure)
0:? : Declaration
0:? : 'test_data' (symbol id 3071) (uniform mediump array[4] of sampler2D)

0:? : Declaration
0:? : ''(symbol id 3075) (uniform structure)
0:? : Declaration
0:? : 'ANGLE_angleUniforms' (symbol id 3076) (uniform structure)
0:? : Function Definition:
0:? : Function Prototype (internal function): _0_main (symbol id 3070) (void)
0:4: Code block
0:5: move second child to first child (mediump 4-component vector of float)
0:5: 'gl_FragColor' (symbol id 2962) (FragColor mediump 4-component vector of float)
0:5: Construct (mediump 4-component vector of float)
0:5: vector swizzle (x) (mediump float)
0:5: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:? : indirect index (mediump sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[4] of sampler2D)
0:? : add (const int)
0:? : add (const int)
0:? : 0 (const int)
0:? : component-wise multiply (const int)
0:? : 1 (const int)

0:5: 1 (const int)
0:? : component-wise multiply (const int)
0:? : 2 (const int)

0:5: 1 (const int)
0:5: 0.0 (const float)
0:5: 0.0 (const float)
0:6: vector swizzle (x) (mediump float)
0:6: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:? : indirect index (mediump sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[4] of sampler2D)
0:? : add (const int)
0:? : add (const int)
0:? : 0 (const int)
0:? : component-wise multiply (const int)
0:? : 1 (const int)

0:6: 0 (const int)
0:? : component-wise multiply (const int)
0:? : 2 (const int)

0:6: 1 (const int)
0:6: 0.0 (const float)
0:6: 0.0 (const float)
0:7: vector swizzle (x) (mediump float)
0:7: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:? : indirect index (mediump sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[4] of sampler2D)
0:? : add (const int)
0:? : add (const int)
0:? : 0 (const int)
0:? : component-wise multiply (const int)
0:? : 1 (const int)
0:7: 1 (const int)
0:? : component-wise multiply (const int)
0:? : 2 (const int)

0:7: 0 (const int)
0:7: 0.0 (const float)
0:7: 0.0 (const float)
0:8: vector swizzle (x) (mediump float)
0:8: Call a built-in function: texture2D (symbol id 678) (mediump 4-component vector of float)
0:? : indirect index (mediump sampler2D)
0:? : 'test_data' (symbol id 3071) (uniform mediump array[4] of sampler2D)
0:? : add (const int)
0:? : add (const int)
0:? : 0 (const int)
0:? : component-wise multiply (const int)
0:? : 1 (const int)

0:8: 0 (const int)
0:? : component-wise multiply (const int)
0:? : 2 (const int)

0:8: 0 (const int)
0:8: 0.0 (const float)
0:8: 0.0 (const float)
0:? : Declaration
0:? : 'gl_FragColor' (symbol id 2962) (FragColor mediump 4-component vector of float)
0:? : Declaration
0:? : 'gl_SampleMask' (symbol id 3077) (SampleMask highp uint)
0:? : Function Definition:
0:4: Function Prototype: main (symbol id 3069) (void)
0:? : Code block
0:? : Call a user-defined function (internal function): _0_main (symbol id 3070) (void)
0:? : If test
0:? : Condition
0:? : 'ANGLECoverageMaskEnabled' (symbol id 3078) (const bool)
0:? : true case
0:? : Code block
0:? : Call a user-defined function (internal function): writeSampleMask (symbol id 3079) (void)
0:? : direct index for structure (uint)
0:? : 'ANGLE_angleUniforms' (symbol id 3076) (uniform structure)
0:? : 12 (field 'coverageMask')
0:? : 'gl_SampleMask' (symbol id 3077) (SampleMask highp uint)

k… via monorail

unread,
Jul 28, 2021, 9:58:10 PM7/28/21
to angleproj...@googlegroups.com

Comment #81 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c81

Have revised https://chromium-review.googlesource.com/c/angle/angle/+/3058524 with debugging code for the RewriteStructSamplers pass, and have asked for some help there.

Git Watcher via monorail

unread,
Jul 29, 2021, 4:26:09 AM7/29/21
to angleproj...@googlegroups.com

Comment #82 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c82


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/e74638fed769977a36038f74fdba10a71eee233f

commit e74638fed769977a36038f74fdba10a71eee233f
Author: Kenneth Russell <k...@chromium.org>
Date: Thu Jul 29 02:03:43 2021

Disable Metal shader cache again in angle_end2end_tests.

This hooking was removed in
https://chromium-review.googlesource.com/3010486 and sped up local
test runs, but seems to have reintroduced flakiness on the Mac AMD
Retina bots.

Bug: chromium:1233864
Bug: angleproject:5505
Change-Id: I46d95545fbbedc0e881e3a2832a5ac5d5384f405
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3057823
Commit-Queue: ccameron <ccam...@chromium.org>
Reviewed-by: ccameron <ccam...@chromium.org>

[modify] https://crrev.com/e74638fed769977a36038f74fdba10a71eee233f/src/tests/test_utils/runner/TestSuite.cpp

Git Watcher via monorail

unread,
Jul 30, 2021, 1:27:10 PM7/30/21
to angleproj...@googlegroups.com

Comment #83 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c83


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/aec5e65cb77a503d466d7c414e72d03f3a0b39d3

commit aec5e65cb77a503d466d7c414e72d03f3a0b39d3
Author: Kenneth Russell <k...@chromium.org>
Date: Wed Jul 28 07:36:12 2021

Get direct-to-Metal backend to run angle_end2end_tests.

Cherry-pick nameless struct fix from Apple in
https://bugs.webkit.org/show_bug.cgi?id=227482 .

Fix SeparateCompoundStructDeclarations pass to stop generating
multiple declarations; thanks syoussefi@ for advice.

Incorporate additional passes from TranslatorVulkan
(MonomorphizeUnsupportedFunctionsInVulkanGLSL,
RewriteArrayOfArrayOfOpaqueUniforms,
SeparateStructFromUniformDeclarations) needed by RewriteStructSamplers
pass in TranslatorMetalDirect. Fixes many assertion failures in GLSL
tests. Moved these passes out of tree_ops/vulkan. Thanks again to
syoussefi@ for advice and help.

Disable a validation check related to the RewritePipelines pass. Skip
two tests that were failing for other reasons.

With these changes, angle_end2end_tests runs to completion when the
direct-to-Metal backend is turned on. There are still ~1300 failures
of the ~4000 tests which will be investigated next.

Bug: angleproject:5505
Change-Id: Ibca77822543e8e8e8d2a8c862e92cdf74bfa3545
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3058524
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler.gni
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/Compiler.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorMetalDirect.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorMetalDirect/IdGen.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorMetalDirect/IdGen.h
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundExpressions.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundStructDeclarations.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/TranslatorVulkan.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/ValidateAST.cpp
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.cpp
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.h
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.cpp
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.h
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteAtomicCounters.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteStructSamplers.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/RewriteStructSamplers.h
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.cpp
[rename] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.h
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/compiler/translator/tree_ops/vulkan/RewriteR32fImages.cpp
[modify] https://crrev.com/aec5e65cb77a503d466d7c414e72d03f3a0b39d3/src/tests/gl_tests/GLSLTest.cpp

k… via monorail

unread,
Aug 6, 2021, 3:21:15 PM8/6/21
to angleproj...@googlegroups.com

Comment #84 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c84

Working on upstreaming more recent direct-to-Metal changes in:


Upstream latest changes to the Metal backend from Apple.
https://chromium-review.googlesource.com/c/angle/angle/+/3010618

Several tests are newly crashing with assertion failures. I think these are due to changes in ANGLE in the last month or so, as opposed to regressions caused by the newly upstreamed code. A few examples:

[ RUN ] ProgramBinaryES3Test.ActiveUniformShader/ES3_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
Layout.cpp:320 (CommonGlslLayoutOf): ! Assert failed in CommonGlslLayoutOf (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/Layout.cpp:320): type.isMatrix()

[ RUN ] UniformBlockWithOneLargeArrayMemberTest.MemberTypeIsFloat/ES3_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
Layout.cpp:320 (CommonGlslLayoutOf): ! Assert failed in CommonGlslLayoutOf (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/Layout.cpp:320): type.isMatrix()

[ RUN ] SimpleUniformTest.FloatIntUniformStateQuery/ES2_Metal
../../third_party/angle/src/tests/test_utils/ANGLETest.cpp:64: Failure
Layout.cpp:320 (CommonGlslLayoutOf): ! Assert failed in CommonGlslLayoutOf (../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/Layout.cpp:320): type.isMatrix()
...

Git Watcher via monorail

unread,
Aug 6, 2021, 4:46:10 PM8/6/21
to angleproj...@googlegroups.com

Comment #85 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c85


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/07c21bccda27c15dd298a96f4b6cf0952a1c8bd4

commit 07c21bccda27c15dd298a96f4b6cf0952a1c8bd4
Author: Kenneth Russell <k...@chromium.org>
Date: Fri Aug 06 08:54:58 2021

Add run-time switch for direct-to-Metal compiler.

Setting the environment variable:
ANGLE_USE_MSL_COMPILER=1
will switch from the SPIR-V Metal to the direct-to-Metal compiler.

This makes it easier to diagnose regressions as the direct-to-Metal
compiler is upstreamed.

Bug: angleproject:5505
Change-Id: I78593e8ddc4e483bb0795960c432bcfa17e0a5b1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076332

Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

Git Watcher via monorail

unread,
Aug 6, 2021, 5:34:32 PM8/6/21
to angleproj...@googlegroups.com

Comment #86 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c86


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/d191bc32a44273f1b66651bce7062bb6877ec224

commit d191bc32a44273f1b66651bce7062bb6877ec224
Author: Kenneth Russell <k...@chromium.org>
Date: Fri Aug 06 19:59:39 2021

Reintroduce TType::isRank0.

This concept was used in the direct-to-Metal compiler, and its
replacement with isScalar wasn't completely correct. Fixes several
assertion failures in tests.

Bug: angleproject:4889
Bug: angleproject:5505
Change-Id: I9b8800ed50591560c8e53faa81eca581c4f07a02
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3078474
Reviewed-by: Jamie Madill <jma...@chromium.org>

Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

k… via monorail

unread,
Aug 6, 2021, 6:39:30 PM8/6/21
to angleproj...@googlegroups.com

Comment #88 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c88

It looks like fragment shaders' outputs are broken in the upstreamed direct-to-Metal compiler. Debugging this now in Issue 6259. There's not much point in proceeding with the upstreaming in:


Upstream latest changes to the Metal backend from Apple.
https://chromium-review.googlesource.com/c/angle/angle/+/3010618

until this is understood and resolved. That upstreaming patch only introduces more failures.

k… via monorail

unread,
Aug 7, 2021, 2:10:30 AM8/7/21
to angleproj...@googlegroups.com

Comment #89 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c89

The root cause of Issue 6259's been fixed. At this point we can proceed with deploying more testing of the direct-to-Metal backend on the automated testing machines in https://chromium-review.googlesource.com/c/angle/angle/+/3079083 and follow-ons.

k… via monorail

unread,
Aug 9, 2021, 2:40:43 PM8/9/21
to angleproj...@googlegroups.com

Comment #90 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c90

Note, with the fix of Issue 6259 about 90% of the angle_end2end_tests failures with the direct-to-Metal backend have been fixed. There are ~140 remaining failures and look like they are in a few specific areas, including known problem areas like transform feedback.

Attachments:
angle-end2end-results.txt 15.8 KB

k… via monorail

unread,
Aug 9, 2021, 2:41:31 PM8/9/21
to angleproj...@googlegroups.com
Updates:
Cc: gm...@chromium.org

Comment #91 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c91

(No comment was entered for this change.)

k… via monorail

unread,
Aug 10, 2021, 8:44:09 PM8/10/21
to angleproj...@googlegroups.com

Comment #92 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c92

For the record, the tests that were asserting because of the removal of TType::isRank0 were:
GLSLTest_ES3.MissingReturnStructOfArrays
ProgramBinaryES3Test.ActiveUniformShader
SimpleUniformTest.FloatArrayUniformStateQuery
SimpleUniformTest.FloatIntUniformStateQuery
UniformBlockWithOneLargeArrayMemberTest.MemberTypeIsFloat
UniformTest.*
UniformTestES3.OverflowArray
UniformTestES3.ReturnsOnlyOneArrayElement
WebGL2GLSLTest.InitUninitializedStructContainingArrays
WebGLGLSLTest.InitUninitializedGlobals

Attempting to enable some of these tests along with the introduction of the direct-to-Metal feature in https://chromium-review.googlesource.com/c/angle/angle/+/3079083 . Unfortunately, some of these tests, or other tests in these suites, are still failing.

k… via monorail

unread,
Aug 10, 2021, 10:33:52 PM8/10/21
to angleproj...@googlegroups.com

Comment #93 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c93

Comparing the output of WebGLGLSLTest.InitUninitializedGlobals/ES2_Metal_DirectMetalGen when it's the only version run (via ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration ) and when it runs after WebGLGLSLTest.InitUninitializedGlobals/ES2_Metal. The EGLDisplay's completely reinitialized between these tests in src/tests/test_utils/ANGLETest.cpp. The shader compiler's output is almost but not quite identical between these two runs, and I'm not sure whether that's relevant. Attached are the compiled shaders for this test when the direct-to-Metal translator's used globally, vs. set incrementally by the _DirectMetalGen modifier.

Attachments:
direct-to-metal-output-global.txt 7.1 KB
direct-to-metal-output-incremental.txt 7.1 KB

Git Watcher via monorail

unread,
Aug 11, 2021, 4:59:09 PM8/11/21
to angleproj...@googlegroups.com

Comment #94 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c94


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/ff64d2c7e562f401bf174ba2030bc10583a4b307

commit ff64d2c7e562f401bf174ba2030bc10583a4b307
Author: Kenneth Russell <k...@chromium.org>
Date: Sat Aug 07 04:24:09 2021

Choose direct-to-Metal translator through a feature.

Define directMetalGeneration in FeaturesMtl.h. If
ANGLE_ENABLE_METAL_SPIRV is defined to 1 (still the default),
directMetalGeneration defaults to false. It can be overridden via the
standard ANGLE mechanism:
ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration

It can also be overridden by instantiating angle_end2end_tests with
the directives:
WithDirectMetalGeneration(ES2_METAL())
WithDirectMetalGeneration(ES3_METAL())

These directives aren't working properly yet though. The
direct-to-Metal compiler is instantiated, but the _DirectMetalGen
versions of the tests fail. They pass when switching the Metal
backend's default behavior using the above environment variable. This
will be debugged in follow-on CLs.

Thanks to syoussefi@ for the prototype of this CL:
https://chromium-review.googlesource.com/3076129

Bug: angleproject:5505
Change-Id: I188ab89abc75bf89c5ed2d90102af311feaa1960
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3079083

Reviewed-by: Jamie Madill <jma...@chromium.org>
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/include/platform/FeaturesMtl.h
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/CompilerMtl.h
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/CompilerMtl.mm
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/ContextMtl.mm
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/DisplayMtl.h
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/DisplayMtl.mm
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/libANGLE/renderer/metal/ProgramMtl.mm
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/tests/test_utils/angle_test_configs.cpp
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/src/tests/test_utils/angle_test_configs.h
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/util/EGLPlatformParameters.h
[modify] https://crrev.com/ff64d2c7e562f401bf174ba2030bc10583a4b307/util/EGLWindow.cpp

k… via monorail

unread,
Aug 11, 2021, 7:52:46 PM8/11/21
to angleproj...@googlegroups.com

Comment #95 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c95

To reproduce the current direct-to-Metal failures:

ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration out/Debug/angle_end2end_tests --gtest_filter=\*Metal\*

It'll be faster to restrict the run to the known failures in #c90 above, for example:

--gtest_filter=ClearTest\*Metal\*

k… via monorail

unread,
Aug 11, 2021, 8:24:36 PM8/11/21
to angleproj...@googlegroups.com

Comment #96 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c96

Even more targeted repro of just one failure:
ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration out/Debug/angle_end2end_tests --gtest_filter=ClearTest.ClearStencilMask/ES2_Metal

kkinn… via monorail

unread,
Aug 12, 2021, 2:22:37 AM8/12/21
to angleproj...@googlegroups.com
Updates:
Cc: kkinn...@apple.com

Comment #97 on issue 5505 by kkinn...@apple.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c97


(No comment was entered for this change.)

Git Watcher via monorail

unread,
Aug 17, 2021, 2:46:05 PM8/17/21
to angleproj...@googlegroups.com

Comment #99 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c99


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/63bb0e53680b0939d405746b09c5ec82ddd962b5

commit 63bb0e53680b0939d405746b09c5ec82ddd962b5
Author: Gregg Tavares <gm...@chromium.org>
Date: Mon Aug 16 23:30:32 2021

Add depth fix to convert from GL to Metal

Vertex shaders need to convert from GL's -1 to +1 z range
to Metal's 0 to +1 z range with:

z = (z + w) * 0.5

This code is being upstreamed from WebKit.

It fixes these end to end tests.

BlitFramebufferTest.MultisampleDepthClear/ES3_Metal
BlitFramebufferTest.MultisampleDepthClear/ES3_Metal_NoStencilOutput
BlitFramebufferTest.BlitDepthStencilPixelByPixel/ES3_Metal
BlitFramebufferTest.BlitDepthStencilPixelByPixel/ES3_Metal_NoStencilOutput
ClearTest.ClearStencilMask/ES2_Metal
ClearTest.ClearStencilMask/ES3_Metal
ClearTestES3.ClearMultipleAttachmentsIndividually/ES3_Metal
ClearTestES3.MaskedClearHeterogeneousAttachments/ES3_Metal
ClearTestES3.ScissoredClearHeterogeneousAttachments/ES3_Metal
ClearTestES3.ClearBufferivStencilMask/ES3_Metal
ClearTestES3.ClearBufferfiNoStencilAttachment/ES3_Metal
MaskedScissoredClearTest.Test/ES2_Metal__clear_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_s_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_s_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_d
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_d
MaskedScissoredClearTest.Test/ES2_Metal__clear_ds
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_ds
MaskedScissoredClearTest.Test/ES2_Metal__clear_ds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_ds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cs_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cd
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cd
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__clear_cd_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cd_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_s_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_s_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_d
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_d
MaskedScissoredClearTest.Test/ES3_Metal__clear_ds
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_ds
MaskedScissoredClearTest.Test/ES3_Metal__clear_ds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_ds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cs_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cd
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cd
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_cd_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cd_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_cs
DepthStencilFormatsTest.DepthTextureRender/ES2_Metal
DepthStencilFormatsTest.DepthBuffer16/ES2_Metal
DepthStencilFormatsTest.DepthBuffer24/ES2_Metal
DepthStencilFormatsTest.VerifyDepth32UploadData/ES2_Metal
DepthStencilFormatsTest.VerifyDepth16UploadData/ES2_Metal
TinyDepthStencilWorkaroundTest.DepthTexturesStick/ES3_Metal
DiscardFramebufferEXTTest.ClearDepthThenDrawWithDepthTestThenDiscard/ES2_Metal
DiscardFramebufferEXTTest.ClearDepthThenDrawWithDepthTestThenDiscard/ES3_Metal

Bug: angleproject:5505
Change-Id: I9b52bb46569678636afc6a243bfa8779f101b6af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097161
Reviewed-by: Kenneth Russell <k...@chromium.org>
Reviewed-by: Jamie Madill <jma...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

[modify] https://crrev.com/63bb0e53680b0939d405746b09c5ec82ddd962b5/src/compiler/translator/TranslatorMetalDirect.cpp
[modify] https://crrev.com/63bb0e53680b0939d405746b09c5ec82ddd962b5/src/compiler/translator/TranslatorMetalDirect.h

g… via monorail

unread,
Aug 17, 2021, 2:46:15 PM8/17/21
to angleproj...@googlegroups.com

Comment #100 on issue 5505 by gm...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c100

latest failing angle-end2end tests list, 73 failed, 4 skipped

Attachments:
angle-end2end-results.txt 7.8 KB

k… via monorail

unread,
Aug 17, 2021, 8:34:13 PM8/17/21
to angleproj...@googlegroups.com
Issue 5505: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

This issue is now blocking issue 1240563.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1240563

Git Watcher via monorail

unread,
Aug 18, 2021, 7:43:09 PM8/18/21
to angleproj...@googlegroups.com

Comment #104 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c104


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/5ca0953de6379822e9e5c563b03bf1eb16606c82

commit 5ca0953de6379822e9e5c563b03bf1eb16606c82
Author: Gregg Tavares <gm...@chromium.org>
Date: Wed Aug 18 20:22:22 2021

Use the correct attribute locations in Metal

Fixes these tests:

BlendIntegerTest.MRTSigned/ES3_Metal
BlendIntegerTest.MRTUnsigned/ES3_Metal
DrawBuffersTest.Gaps/ES3_Metal
DrawBuffersTest.BlendWithGaps/ES3_Metal
DrawBuffersTest.FirstAndLast/ES3_Metal
DrawBuffersTest.FirstHalfNULL/ES3_Metal
DrawBuffersWebGL2Test.TwoProgramsWithDifferentOutputsAndClear/ES3_Metal
WebGLCompatibilityTest.DrawBuffers/ES3_Metal

Bug: angleproject:5505
Change-Id: I9ea82a8c7a0c5bbc78eb69eb92552909e3f437f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105439
Reviewed-by: Kenneth Russell <k...@chromium.org>
Commit-Queue: Kenneth Russell <k...@chromium.org>

[modify] https://crrev.com/5ca0953de6379822e9e5c563b03bf1eb16606c82/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp

Git Watcher via monorail

unread,
Aug 18, 2021, 8:35:10 PM8/18/21
to angleproj...@googlegroups.com

Comment #105 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c105


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/8ffb4602b3f42c0409f9fd686bfeb896d5d74914

commit 8ffb4602b3f42c0409f9fd686bfeb896d5d74914
Author: Kenneth Russell <k...@chromium.org>
Date: Wed Aug 18 23:55:56 2021

Turn on the first few direct-to-Metal tests by default.

All of the subtests of these previously-asserting tests are passing
with --bot-mode:

ProgramBinaryES3Test
UniformTest
WebGLGLSLTest

so start running them on ANGLE's CQ.

Bug: angleproject:5505
Change-Id: Ibdaa814cec846379e2c073117efa816fc871be33
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105442
Reviewed-by: Jamie Madill <jma...@chromium.org>
Commit-Queue: Jamie Madill <jma...@chromium.org>

[modify] https://crrev.com/8ffb4602b3f42c0409f9fd686bfeb896d5d74914/src/tests/gl_tests/GLSLTest.cpp
[modify] https://crrev.com/8ffb4602b3f42c0409f9fd686bfeb896d5d74914/src/tests/gl_tests/ProgramBinaryTest.cpp
[modify] https://crrev.com/8ffb4602b3f42c0409f9fd686bfeb896d5d74914/src/tests/gl_tests/UniformTest.cpp

jonr… via monorail

unread,
Aug 19, 2021, 9:14:28 AM8/19/21
to angleproj...@googlegroups.com

Comment #107 on issue 5505 by jonr...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c107

See also issue 6301, as the new ProgramBinaryTests are failing on Intel bots

Git Watcher via monorail

unread,
Aug 19, 2021, 3:08:10 PM8/19/21
to angleproj...@googlegroups.com

Comment #109 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c109


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/6a8abffcbd8632b0f5dd7138697947e8ccd79403

commit 6a8abffcbd8632b0f5dd7138697947e8ccd79403
Author: Jonathan Ross <jon...@chromium.org>
Date: Thu Aug 19 17:24:24 2021

Turn off ProgramBinaryES3Test direct-to-Metal tests

We enabled these tests, however they are failing consistently on Intel.

Original change:
https://chromium-review.googlesource.com/c/angle/angle/+/3105442
Bug: angleproject:5505
Bug: angleproject:6301
Change-Id: Iddc36400d55e8b06b15663c2d9bc00df7e04ce02
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3107508

Reviewed-by: Jamie Madill <jma...@chromium.org>
Commit-Queue: Jamie Madill <jma...@chromium.org>

lehoa… via monorail

unread,
Aug 19, 2021, 4:47:45 PM8/19/21
to angleproj...@googlegroups.com

Comment #110 on issue 5505 by lehoa...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c110

Sorry, I still couldn't accept the invitation. Not sure what's wrong. Here
is the screenshot.

le.ho… via monorail

unread,
Aug 19, 2021, 4:56:49 PM8/19/21
to angleproj...@googlegroups.com

Comment #111 on issue 5505 by le.ho...@gmail.com: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c111

Sorry, mistake reply. Could anyone delete my comment above?

Git Watcher via monorail

unread,
Aug 19, 2021, 7:42:10 PM8/19/21
to angleproj...@googlegroups.com

Comment #113 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c113


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/54e311162ff31a7a0ce502c5476cda41ff73fee8

commit 54e311162ff31a7a0ce502c5476cda41ff73fee8
Author: Gregg Tavares <gm...@chromium.org>
Date: Thu Aug 19 22:02:16 2021

Add delimeter to attribute search

Attributes are written in MSL as

type nameOfAttrib __unassigned_attribute__

and then at link time a string substitution
replaces __unassigned_attribute__

The test had these attributes

metal::float4 floatInput __unassigned_attribute__;
metal::uint4 uintInput __unassigned_attribute__;
metal::int4 intInput __unassigned_attribute__;

and was searching for "intInput __unassigned_attribute__"
which matching "uintInput __unassigned_attribute__".

Adding a space in front of the search string fixes the issue.

This fixes this test:
WebGL2CompatibilityTest.VertexShaderAttributeTypeMismatch/ES3_Metal

Bug: angleproject:5505
Change-Id: Ide07e5120e88927b1fdeb3cc32b456a661092802
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3108339
Reviewed-by: Jamie Madill <jma...@chromium.org>
Reviewed-by: Kenneth Russell <k...@chromium.org>
Commit-Queue: Gregg Tavares <gm...@chromium.org>

[modify] https://crrev.com/54e311162ff31a7a0ce502c5476cda41ff73fee8/src/libANGLE/renderer/metal/mtl_glslang_mtl_utils.mm

Git Watcher via monorail

unread,
Aug 24, 2021, 4:00:08 PM8/24/21
to angleproj...@googlegroups.com

Comment #115 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c115


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/411137bf2f582fcf0c31289cde27a7963afb7e90

commit 411137bf2f582fcf0c31289cde27a7963afb7e90
Author: Gregg Tavares <gm...@chromium.org>
Date: Tue Aug 24 18:46:51 2021

Emit INFINITY for infinite constants

GLSL had `v = 1.0e40` which was output as
`v = inff` in MSL. Changed to output
`v = INFINITY`.

Fixes Tests:

GLSLTest_ES3.LiteralInfinityOutput/ES3_Metal
GLSLTest_ES3.LiteralNegativeInfinityOutput/ES3_Metal

Bug: angleproject:5505
Change-Id: Ib651583e608351784dcd49d602a23b5ecb8475cb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3116548
Reviewed-by: Kenneth Russell <k...@chromium.org>

Reviewed-by: Jamie Madill <jma...@chromium.org>
Commit-Queue: Jamie Madill <jma...@chromium.org>

k… via monorail

unread,
Aug 27, 2021, 1:02:11 AM8/27/21
to angleproj...@googlegroups.com
Issue 5505: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

This issue is now blocking issue 1227767.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1227767

Git Watcher via monorail

unread,
Aug 27, 2021, 7:18:29 PM8/27/21
to angleproj...@googlegroups.com

Comment #117 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c117


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/4c56534f31716339769a322372614bfbbbc037bf

commit 4c56534f31716339769a322372614bfbbbc037bf
Author: Gregg Tavares <gm...@chromium.org>
Date: Wed Aug 25 22:56:59 2021

Include globals when defering global initializers

Fixes these tests:

GLSLTest.StructWithInitializer/ES2_Metal
GLSLTest.StructWithInitializer/ES3_Metal
GLSLTest.StructWithUniformInitializer/ES2_Metal
GLSLTest.StructWithUniformInitializer/ES3_Metal
GLSLTest_ES3.SequenceOperatorEvaluationOrderDynamicVectorIndexingInLValue/ES3_Metal
WebGL2GLSLTest.InitUninitializedLocals/ES3_Metal

Bug: angleproject:5505
Change-Id: Ib8258898c60b9e9ffbb71f0024f8189dc6cf4d5b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3120093
Commit-Queue: Gregg Tavares <gm...@chromium.org>
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>

Reviewed-by: Jamie Madill <jma...@chromium.org>
Reviewed-by: Kenneth Russell <k...@chromium.org>

k… via monorail

unread,
Sep 3, 2021, 12:15:29 AM9/3/21
to angleproj...@googlegroups.com

Comment #122 on issue 5505 by k...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c122

Tried switching all the tests over to the direct-to-Metal backend by default:
https://chromium-review.googlesource.com/c/angle/angle/+/3140721

The WebGL 1.0 conformance tests on Metal (webgl_conformance_metal_passthrough_tests) don't look too bad:
https://ci.chromium.org/ui/p/chromium/builders/try/gpu-fyi-try-mac-amd-retina-rel/365/overview

The dEQP tests for ES 2.0 and 3.0 have a considerable number of failures though which might be difficult to suppress:
https://ci.chromium.org/ui/p/chromium/builders/try/mac-angle-try/1716/overview

Maybe to prevent regressions we can switch angle_end2end_tests over to use the direct-to-Metal backend while we get the other test suites in good enough shape to switch them over and suppress the remaining regressions.

Git Watcher via monorail

unread,
Sep 3, 2021, 2:55:29 PM9/3/21
to angleproj...@googlegroups.com

Comment #123 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c123


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/ab187c35b601569f8830a896ae0e29842ab53773

commit ab187c35b601569f8830a896ae0e29842ab53773
Author: Gregg Tavares <gm...@chromium.org>
Date: Thu Sep 02 21:46:29 2021

Handle comparing arrays of scalars/vectors/matrices

Fixes:
UniformBlockWithOneLargeArrayMemberTest.MemberArrayOperations/ES3_Metal

Bug: angleproject:5505
Change-Id: Ife35db2146ac8ce8c0880cdb98df57dc75cb35cb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140712
Commit-Queue: Gregg Tavares <gm...@chromium.org>
Reviewed-by: Kenneth Russell <k...@chromium.org>
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>

[modify] https://crrev.com/ab187c35b601569f8830a896ae0e29842ab53773/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.cpp
[modify] https://crrev.com/ab187c35b601569f8830a896ae0e29842ab53773/src/tests/angle_end2end_tests_expectations.txt
[modify] https://crrev.com/ab187c35b601569f8830a896ae0e29842ab53773/src/tests/gl_tests/GLSLTest.cpp

Git Watcher via monorail

unread,
Sep 8, 2021, 3:39:13 PM9/8/21
to angleproj...@googlegroups.com

Comment #124 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c124


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/c9acd7992699f56f6348d15c9572855e0ad84b18

commit c9acd7992699f56f6348d15c9572855e0ad84b18
Author: Gregg Tavares <gm...@chromium.org>
Date: Wed Sep 08 05:25:23 2021

Only rewrite constructors for scalars/vectors/matrices

Bug: angleproject:5505
Change-Id: I50b3a9a585b2eec6e4d7bd9b3197206a973d4400
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3147071
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Commit-Queue: Gregg Tavares <gm...@chromium.org>

[modify] https://crrev.com/c9acd7992699f56f6348d15c9572855e0ad84b18/src/compiler/translator/tree_ops/ConvertUnsupportedConstructorsToFunctionCalls.cpp

g… via monorail

unread,
Sep 8, 2021, 6:16:26 PM9/8/21
to angleproj...@googlegroups.com

Comment #125 on issue 5505 by gm...@chromium.org: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c125

Top of tree, running angle_end2end_tests with ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration and "--gtest_filter=-*IOSurface*" (ie, turn off any test with IOSurface in the name), this is the list of failing tests (not sure what tests are off)

ClipDistanceTest.OneClipDistance/ES2_Metal
ClipDistanceTest.OneClipDistance/ES3_Metal
ClipDistanceTest.ThreeClipDistances/ES2_Metal
ClipDistanceTest.ThreeClipDistances/ES3_Metal
ClipDistanceTest.ThreeClipDistancesRedeclared/ES2_Metal
ClipDistanceTest.ThreeClipDistancesRedeclared/ES3_Metal
TinyDepthStencilWorkaroundTest.DepthTexturesStick/ES3_Metal
GLSLTest.VectorAndMatrixScalarizationDoesNotAffectRendering/ES2_Metal
GLSLTest.VectorAndMatrixScalarizationDoesNotAffectRendering/ES3_Metal
GLSLTest_ES3.MaxVaryingWithFeedbackAndGLline/ES3_Metal
GLSLTest_ES3.NonScalarEqualOperator/ES3_Metal
GLSLTest_ES3.ValidIndexClampES300/ES3_Metal
GLSLTest_ES3.MixedRowAndColumnMajorMatrices_ReadSideEffectOrder/ES3_Metal
GLSLTest_ES3.MixedRowAndColumnMajorMatrices_ReadSideEffectShortCircuit/ES3_Metal
RobustResourceInitTestES3.BlitDepthStencilAfterClearBuffer/ES3_Metal
StateChangeTestES3.RedefineTransformFeedbackBuffer/ES3_Metal
EGLDeviceCGLQueryTest.QueryDevice/ES2_OpenGL
EGLDeviceCGLQueryTest.QueryDevice/ES3_OpenGL

Git Watcher via monorail

unread,
Sep 9, 2021, 4:06:09 PM9/9/21
to angleproj...@googlegroups.com

Comment #126 on issue 5505 by Git Watcher: Upstream Apple's direct-to-Metal backend
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505#c126


The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/f8ad5bbb9ea98019e7e326ba51cf0d248d41bcf5

commit f8ad5bbb9ea98019e7e326ba51cf0d248d41bcf5
Author: Gregg Tavares <gm...@chromium.org>
Date: Thu Sep 09 17:53:53 2021

Don't advertize GL_APPLE_clip_distance on direct metal

The direct metal backend does not support
gl_ClipDistance array.

Bug: angleproject:5505
Change-Id: I9a1736bd70ee3543ecbe82b36b6ea30df0dac3c8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3152216

Commit-Queue: Gregg Tavares <gm...@chromium.org>
Reviewed-by: Kenneth Russell <k...@chromium.org>

It is loading more messages.
0 new messages