osx: always deactivate the early opengl flush on macOS
early flushing only caused problems on macOS, which includes: - performance problems and huge amount of dropped frames - problems with playing back video files with fps close to the display refresh rate - rendering at twice the rate of the video fps - not properly detected display refresh rate we always deactivate any early flush for macOS to fix these problems.
This commit is contained in:
1 parent
f670c64e59
commit
abf2efb107
2 files changed
+9
-2
No files matched your search
@@ -5258,6 +5258,9 @@ The following video options are currently all specific to ``--vo=gpu`` and
|
||||
flipping GL front and backbuffers immediately (i.e. it doesn't call it
|
||||
in display-sync mode).
|
||||
|
||||
On OSX this is always deactivated because it only causes performance
|
||||
problems and other regressions.
|
||||
|
||||
``--gpu-dumb-mode=<yes|no|auto>``
|
||||
This mode is extremely restricted, and will disable most extended
|
||||
features. That includes high quality scalers and custom shaders!
|
||||
|
||||
@@ -36,6 +36,7 @@ const struct m_sub_options cocoa_conf = {
|
||||
|
||||
struct priv {
|
||||
GL gl;
|
||||
void (GLAPIENTRY *Flush)(void);
|
||||
CGLPixelFormatObj pix;
|
||||
CGLContextObj ctx;
|
||||
|
||||
@@ -49,6 +50,8 @@ static int set_swap_interval(int enabled)
|
||||
return (err == kCGLNoError) ? 0 : -1;
|
||||
}
|
||||
|
||||
static void glFlushDummy(void) { }
|
||||
|
||||
static void *cocoa_glgetaddr(const char *s)
|
||||
{
|
||||
void *ret = NULL;
|
||||
@@ -138,6 +141,8 @@ static bool create_gl_context(struct ra_ctx *ctx)
|
||||
|
||||
mpgl_load_functions(gl, (void *)cocoa_glgetaddr, NULL, ctx->vo->log);
|
||||
gl->SwapInterval = set_swap_interval;
|
||||
p->Flush = gl->Flush;
|
||||
gl->Flush = glFlushDummy;
|
||||
|
||||
CGLReleasePixelFormat(p->pix);
|
||||
|
||||
@@ -155,9 +160,8 @@ static void cocoa_uninit(struct ra_ctx *ctx)
|
||||
static void cocoa_swap_buffers(struct ra_ctx *ctx)
|
||||
{
|
||||
struct priv *p = ctx->priv;
|
||||
GL *gl = &p->gl;
|
||||
vo_cocoa_swap_buffers(ctx->vo);
|
||||
gl->Flush();
|
||||
p->Flush();
|
||||
}
|
||||
|
||||
static bool cocoa_init(struct ra_ctx *ctx)
|
||||
|
||||
Reference in new issue
Block a user