This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
// workaround for MoltenVK problem that causes flicker | ||
// https://github.com/mpv-player/mpv/pull/13651 | ||
class MetalLayer: CAMetalLayer { | ||
// workaround for a MoltenVK workaround that sets the drawableSize to 1x1 to forcefully complete | ||
// the presentation, this causes flicker and the drawableSize possibly staying at 1x1 | ||
override var drawableSize: CGSize { | ||
get { return super.drawableSize } | ||
set { | ||
if Int(newValue.width) > 1 && Int(newValue.height) > 1 { | ||
super.drawableSize = newValue | ||
} | ||
} | ||
} | ||
} |