summaryrefslogtreecommitdiffstats
path: root/video/out/gpu_next
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/gpu_next
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--video/out/gpu_next/context.c25
-rw-r--r--video/out/gpu_next/context.h4
2 files changed, 13 insertions, 16 deletions
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, &params);
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);