From 4809a3f48d41f5414057e965c0f18e0279cc2abe Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Fri, 11 Oct 2019 00:14:28 +0300 Subject: vo_gpu/d3d11: utilize actual backbuffer values for bit depth And if backbuffer is not around, return an error value utilized elsewhere already. --- video/out/d3d11/context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c index 17bcdcc1f6..003e3ff173 100644 --- a/video/out/d3d11/context.c +++ b/video/out/d3d11/context.c @@ -162,7 +162,12 @@ static bool d3d11_reconfig(struct ra_ctx *ctx) static int d3d11_color_depth(struct ra_swapchain *sw) { - return 8; + struct priv *p = sw->priv; + + if (!p->backbuffer) + return 0; + + return p->backbuffer->params.format->component_depth[0]; } static bool d3d11_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo) -- cgit v1.2.3