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. Using 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: I8719c45a19718ff79ef21f47515fe1c15b99628b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43112 Presubmit-Ready: Nicolas Capens <nicolascapens@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... |