Metal: Call terminate if display initialization fails.

This ensures that any resources that were partially initialized are
cleaned up.

This is a speculative fix for dual GPU macs not falling back to the
low power GPU. DisplayMtl leaks the metal device if it fails to
initialize due to unsupported GPU families or vendors.

Bug: chromium:1322521
Change-Id: I93930de8c07bb94318ac41c67513a3b1c8bd3bf0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4681842
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This commit is contained in:
Geoff Lang
2023-07-13 12:41:56 -04:00
committed by Angle LUCI CQ
parent 8f76a7ebf6
commit cc8ea4c29a

View File

@@ -114,6 +114,7 @@ egl::Error DisplayMtl::initialize(egl::Display *display)
angle::Result result = initializeImpl(display);
if (result != angle::Result::Continue)
{
terminate();
return egl::EglNotInitialized();
}
return egl::NoError();