If layer.device is null, [layer nextDrawable] returns nil, so on surface initialization we set layer.device to a dummy MTLDevice by getting a reference of the system default device. MTLCreateSystemDefaultDevice() requires linking against Metal.framework but Chromium needs to ship on platforms that don't have Metal. This means we can't directly link against the framework, instead we "weakly" link against it so that if it is not present, the function pointers are just null (instead of failing to launch). Bug: dawn:269 Change-Id: I5984613f576849c6f219c253da7eb277fa75ef52 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43209 Kokoro-Presubmit: Corentin Wallez <cwallez@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:Nicolas Capens <nicolascapens@google.com> Tested-by:
Corentin Wallez <cwallez@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| BUILD.gn | Loading commit data... | |
| MetalSurface.h | Loading commit data... | |
| MetalSurface.mm | Loading commit data... | |
| VkSurfaceKHR.cpp | Loading commit data... | |
| VkSurfaceKHR.hpp | Loading commit data... | |
| VkSwapchainKHR.cpp | Loading commit data... | |
| VkSwapchainKHR.hpp | Loading commit data... | |
| Win32SurfaceKHR.cpp | Loading commit data... | |
| Win32SurfaceKHR.hpp | Loading commit data... | |
| XcbSurfaceKHR.cpp | Loading commit data... | |
| XcbSurfaceKHR.hpp | Loading commit data... | |
| XlibSurfaceKHR.cpp | Loading commit data... | |
| XlibSurfaceKHR.hpp | Loading commit data... | |
| libX11.cpp | Loading commit data... | |
| libX11.hpp | Loading commit data... |