Skip to content

OSX Display tearing #1684

Closed Answered by IcemarkUK
IcemarkUK asked this question in Q&A
Feb 14, 2024 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

It appears to be this...

NSView* contentView = [(id)getCocoaWindow() contentView];
[contentView setWantsLayer:YES];
CAMetalLayer* layer = [CAMetalLayer layer];
[layer setDevice:device];
[layer setPixelFormat:MTLPixelFormatBGRA8Unorm];
[layer setFramebufferOnly:YES];
[layer setDrawableSize:size];
layer.displaySyncEnabled = _glContextAttrs.vsync;
[contentView setLayer:layer];
backend::DriverMTL::setCAMetalLayer(layer);

If I set layer.displaySyncEnabled = true then the problem goes away - which makes sense.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@IcemarkUK
Comment options

@IcemarkUK
Comment options

Answer selected by IcemarkUK
@rh101
Comment options

@IcemarkUK
Comment options

@rh101
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants