Skip to content

Commit

Permalink
Fix initial blurriness on Metal
Browse files Browse the repository at this point in the history
This reverts libretro#14963 and part of libretro#14942. Instead of forcing a size
change on mac the way we do on tvos, bring back the old way of making
two setContentSize calls.
  • Loading branch information
warmenhoven committed Feb 21, 2023
1 parent 51894c3 commit 85d30f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gfx/drivers/metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ - (instancetype)initWithVideo:(const video_info_t *)video

[apple_platform setVideoMode:mode];

#ifdef HAVE_COCOATOUCH
[self mtkView:view drawableSizeWillChange:CGSizeMake(mode.width, mode.height)];
#endif

*input = NULL;
*inputData = NULL;
Expand Down
4 changes: 4 additions & 0 deletions ui/drivers/ui_cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,10 @@ - (void)setVideoMode:(gfx_ctx_mode_t)mode
[self updateWindowedMode];
}

/* HACK(sgc): ensure MTKView posts a drawable resize event */
if (mode.width > 0)
[self.window setContentSize:NSMakeSize(mode.width-1, mode.height)];
[self.window setContentSize:NSMakeSize(mode.width, mode.height)];
[self.window displayIfNeeded];
}

Expand Down

0 comments on commit 85d30f5

Please sign in to comment.