OSDN Git Service
MetalSurface: set layer.device to a ref of the system default device.
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>