Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Targets/App/Sources/UI/Components/EDRMetalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ struct EDRMetalView: UIViewRepresentable {
/// Whether the current device supports EDR rendering via Metal.
///
/// Callers should check this before entering the EDR rendering path to avoid
/// displaying a blank view on unsupported devices (e.g. the iOS Simulator).
/// This property reads from `Renderer.device`, the same shared `MTLDevice`
/// that the renderer uses, so the check is consistent with actual rendering capability.
static var isSupported: Bool { Renderer.device != nil }
/// displaying a blank view on unsupported devices. Always returns `false` on
/// the iOS Simulator: on Apple Silicon hosts `MTLCreateSystemDefaultDevice()`
/// returns a device, but Metal-backed views don't render correctly for
/// `XCUIScreenshot` capture, and the resulting `MTKView` doesn't expose as an
/// accessibility image element. Both matter for the App Store screenshot
/// pipeline, which renders on simulators.
static var isSupported: Bool {
#if targetEnvironment(simulator)
return false
#else
return Renderer.device != nil
#endif
}

let imageProvider: (_ contentScaleFactor: CGFloat, _ headroom: CGFloat) -> CIImage?

Expand Down
Loading