Skip to content

Commit ee0f701

Browse files
committed
vo: remove "slack" frames from swapchain
Those are controlled by the `--swapchain-depth` option and is already set to 3 by default. There is no need to add hardcoded hidden frame of "slack". Users can adjust depth by changing the config.
1 parent d7495e4 commit ee0f701

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

video/out/d3d11/context.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,8 @@ static bool d3d11_init(struct ra_ctx *ctx)
548548
.color_space = p->opts->color_space,
549549
.configured_csp = &p->swapchain_csp,
550550
.flip = p->opts->flip,
551-
// Add one frame for the backbuffer and one frame of "slack" to reduce
552-
// contention with the window manager when acquiring the backbuffer
553-
.length = vo_swapchain_depth(ctx->vo) + 2,
551+
// Add one frame for the backbuffer
552+
.length = vo_swapchain_depth(ctx->vo) + 1,
554553
.usage = usage,
555554
};
556555
if (!mp_d3d11_create_swapchain(p->device, ctx->log, &scopts, &p->swapchain))

video/out/opengl/context_angle.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,8 @@ static bool d3d11_swapchain_surface_create(struct ra_ctx *ctx)
291291
.width = p->sc_width,
292292
.height = p->sc_height,
293293
.flip = o->flip,
294-
// Add one frame for the backbuffer and one frame of "slack" to reduce
295-
// contention with the window manager when acquiring the backbuffer
296-
.length = vo_swapchain_depth(ctx->vo) + 2,
294+
// Add one frame for the backbuffer
295+
.length = vo_swapchain_depth(ctx->vo) + 1,
297296
.usage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT,
298297
};
299298
if (!mp_d3d11_create_swapchain(p->d3d11_device, vo->log, &swapchain_opts,

video/out/opengl/context_dxinterop.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,8 @@ static void fill_presentparams(struct ra_ctx *ctx,
339339
.Windowed = TRUE,
340340
.BackBufferWidth = ctx->vo->dwidth ? ctx->vo->dwidth : 1,
341341
.BackBufferHeight = ctx->vo->dheight ? ctx->vo->dheight : 1,
342-
// Add one frame for the backbuffer and one frame of "slack" to reduce
343-
// contention with the window manager when acquiring the backbuffer
344-
.BackBufferCount = vo_swapchain_depth(ctx->vo) + 2,
342+
// Add one frame for the backbuffer
343+
.BackBufferCount = vo_swapchain_depth(ctx->vo) + 1,
345344
.SwapEffect = IsWindows7OrGreater() ? D3DSWAPEFFECT_FLIPEX : D3DSWAPEFFECT_FLIP,
346345
// Automatically get the backbuffer format from the display format
347346
.BackBufferFormat = D3DFMT_UNKNOWN,

0 commit comments

Comments
 (0)