summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2019-09-28 10:26:23 +0200
committerJan Ekström <jeebjp@gmail.com>2019-09-28 14:10:01 +0300
commit62904203804afb614f4809495f1a1bb6e4006aaa (patch)
treeffeaceaebb78c664c9d183333836594b245ba1e1 /video/out/opengl
parent9538fb5a7af951e220f26c87c80aaaa2a5cfbc67 (diff)
downloadmpv-62904203804afb614f4809495f1a1bb6e4006aaa.tar.bz2
mpv-62904203804afb614f4809495f1a1bb6e4006aaa.tar.xz
vo: make swapchain-depth option generic for all VOs
In preparation for making vo_drm able to use swapchain-depth
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context.c2
-rw-r--r--video/out/opengl/context_angle.c4
-rw-r--r--video/out/opengl/context_drm_egl.c3
-rw-r--r--video/out/opengl/context_dxinterop.c4
4 files changed, 7 insertions, 6 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 9b3dd6a827..530fc54a85 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -306,7 +306,7 @@ void ra_gl_ctx_swap_buffers(struct ra_swapchain *sw)
check_pattern(p, step);
}
- while (p->num_vsync_fences >= sw->ctx->opts.swapchain_depth) {
+ while (p->num_vsync_fences >= sw->ctx->vo->opts->swapchain_depth) {
gl->ClientWaitSync(p->vsync_fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1e9);
gl->DeleteSync(p->vsync_fences[0]);
MP_TARRAY_REMOVE_AT(p->vsync_fences, p->num_vsync_fences, 0);
diff --git a/video/out/opengl/context_angle.c b/video/out/opengl/context_angle.c
index 6d45e29496..76d104e9b9 100644
--- a/video/out/opengl/context_angle.c
+++ b/video/out/opengl/context_angle.c
@@ -226,7 +226,7 @@ static bool d3d11_device_create(struct ra_ctx *ctx)
.force_warp = o->d3d11_warp == 1,
.max_feature_level = o->d3d11_feature_level,
.min_feature_level = D3D_FEATURE_LEVEL_9_3,
- .max_frame_latency = ctx->opts.swapchain_depth,
+ .max_frame_latency = ctx->vo->opts->swapchain_depth,
};
if (!mp_d3d11_create_present_device(vo->log, &device_opts, &p->d3d11_device))
return false;
@@ -294,7 +294,7 @@ static bool d3d11_swapchain_surface_create(struct ra_ctx *ctx)
.flip = o->flip,
// Add one frame for the backbuffer and one frame of "slack" to reduce
// contention with the window manager when acquiring the backbuffer
- .length = ctx->opts.swapchain_depth + 2,
+ .length = ctx->vo->opts->swapchain_depth + 2,
.usage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT,
};
if (!mp_d3d11_create_swapchain(p->d3d11_device, vo->log, &swapchain_opts,
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c
index fcc31df682..736db7a4ec 100644
--- a/video/out/opengl/context_drm_egl.c
+++ b/video/out/opengl/context_drm_egl.c
@@ -603,7 +603,8 @@ static void drm_egl_swap_buffers(struct ra_swapchain *sw)
enqueue_bo(ctx, new_bo);
new_fence(ctx);
- while (drain || p->gbm.num_bos > ctx->opts.swapchain_depth || !gbm_surface_has_free_buffers(p->gbm.surface)) {
+ while (drain || p->gbm.num_bos > ctx->vo->opts->swapchain_depth ||
+ !gbm_surface_has_free_buffers(p->gbm.surface)) {
if (p->waiting_for_flip) {
wait_on_flip(ctx);
swapchain_step(ctx);
diff --git a/video/out/opengl/context_dxinterop.c b/video/out/opengl/context_dxinterop.c
index 2e65a8956e..d4d3b874d6 100644
--- a/video/out/opengl/context_dxinterop.c
+++ b/video/out/opengl/context_dxinterop.c
@@ -346,7 +346,7 @@ static void fill_presentparams(struct ra_ctx *ctx,
.BackBufferHeight = ctx->vo->dheight ? ctx->vo->dheight : 1,
// Add one frame for the backbuffer and one frame of "slack" to reduce
// contention with the window manager when acquiring the backbuffer
- .BackBufferCount = ctx->opts.swapchain_depth + 2,
+ .BackBufferCount = ctx->vo->opts->swapchain_depth + 2,
.SwapEffect = IsWindows7OrGreater() ? D3DSWAPEFFECT_FLIPEX : D3DSWAPEFFECT_FLIP,
// Automatically get the backbuffer format from the display format
.BackBufferFormat = D3DFMT_UNKNOWN,
@@ -398,7 +398,7 @@ static int d3d_create(struct ra_ctx *ctx)
return -1;
}
- IDirect3DDevice9Ex_SetMaximumFrameLatency(p->device, ctx->opts.swapchain_depth);
+ IDirect3DDevice9Ex_SetMaximumFrameLatency(p->device, ctx->vo->opts->swapchain_depth);
// Register the Direct3D device with WGL_NV_dx_interop
p->device_h = gl->DXOpenDeviceNV(p->device);