From 60e8a3d404f0640fa5a3f834eae54b4f1fb9127d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:13:14 +0200 Subject: Adding upstream version 0.38.0. Signed-off-by: Daniel Baumann --- video/out/gpu_next/context.c | 25 +++++++++++-------------- video/out/gpu_next/context.h | 4 ++-- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'video/out/gpu_next') diff --git a/video/out/gpu_next/context.c b/video/out/gpu_next/context.c index 2887cff..2c7c9fa 100644 --- a/video/out/gpu_next/context.c +++ b/video/out/gpu_next/context.c @@ -88,6 +88,7 @@ static bool d3d11_pl_init(struct vo *vo, struct gpu_ctx *ctx, ctx->swapchain = pl_d3d11_create_swapchain(d3d11, pl_d3d11_swapchain_params( .swapchain = swapchain, + .disable_10bit_sdr = ra_d3d11_ctx_prefer_8bit_output_format(ctx->ra_ctx), ) ); if (!ctx->swapchain) { @@ -106,13 +107,10 @@ err_out: } #endif // HAVE_D3D11 -struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct gl_video_opts *gl_opts) +struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct ra_ctx_opts *ctx_opts) { struct gpu_ctx *ctx = talloc_zero(NULL, struct gpu_ctx); ctx->log = vo->log; - - struct ra_ctx_opts *ctx_opts = mp_get_config_group(ctx, vo->global, &ra_ctx_conf); - ctx_opts->want_alpha = gl_opts->alpha_mode == ALPHA_YES; ctx->ra_ctx = ra_ctx_create(vo, *ctx_opts); if (!ctx->ra_ctx) goto err_out; @@ -145,18 +143,17 @@ struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct gl_video_opts *gl_opts) #if HAVE_GL && defined(PL_HAVE_OPENGL) if (ra_is_gl(ctx->ra_ctx->ra)) { struct GL *gl = ra_gl_get(ctx->ra_ctx->ra); - pl_opengl opengl = pl_opengl_create(ctx->pllog, - pl_opengl_params( - .debug = ctx_opts->debug, - .allow_software = ctx_opts->allow_sw, - .get_proc_addr_ex = (void *) gl->get_fn, - .proc_ctx = gl->fn_ctx, + struct pl_opengl_params params = *pl_opengl_params( + .debug = ctx_opts->debug, + .allow_software = ctx_opts->allow_sw, + .get_proc_addr_ex = (void *) gl->get_fn, + .proc_ctx = gl->fn_ctx, + ); # if HAVE_EGL - .egl_display = eglGetCurrentDisplay(), - .egl_context = eglGetCurrentContext(), + params.egl_display = eglGetCurrentDisplay(); + params.egl_context = eglGetCurrentContext(); # endif - ) - ); + pl_opengl opengl = pl_opengl_create(ctx->pllog, ¶ms); if (!opengl) goto err_out; ctx->gpu = opengl->gpu; diff --git a/video/out/gpu_next/context.h b/video/out/gpu_next/context.h index b98b9e7..aa44196 100644 --- a/video/out/gpu_next/context.h +++ b/video/out/gpu_next/context.h @@ -21,8 +21,8 @@ struct mp_log; struct ra_ctx; +struct ra_ctx_opts; struct vo; -struct gl_video_opts; struct gpu_ctx { struct mp_log *log; @@ -35,6 +35,6 @@ struct gpu_ctx { void *priv; }; -struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct gl_video_opts *gl_opts); +struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct ra_ctx_opts *ctx_opts); bool gpu_ctx_resize(struct gpu_ctx *ctx, int w, int h); void gpu_ctx_destroy(struct gpu_ctx **ctxp); -- cgit v1.2.3