diff options
author | Niklas Haas <git@haasn.xyz> | 2021-04-18 11:48:35 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2021-11-03 14:09:27 +0100 |
commit | 432581b60485433d5497d461730960fa3a2af402 (patch) | |
tree | 2500cf6d6f2e1abd9d3e8256c1843f9beb8a39c0 /video/out/vo_gpu.c | |
parent | 5512f53722a46dd7b4844ca8f7e47b5fed2d7259 (diff) | |
download | mpv-432581b60485433d5497d461730960fa3a2af402.tar.bz2 mpv-432581b60485433d5497d461730960fa3a2af402.tar.xz |
vo_gpu: lift ra_ctx_* opts to a global struct
So I can re-use them for vo_gpu_next.
Diffstat (limited to 'video/out/vo_gpu.c')
-rw-r--r-- | video/out/vo_gpu.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/video/out/vo_gpu.c b/video/out/vo_gpu.c index 38b29c3ceb..9e83b380b8 100644 --- a/video/out/vo_gpu.c +++ b/video/out/vo_gpu.c @@ -48,7 +48,6 @@ struct gpu_priv { char *context_name; char *context_type; - struct ra_ctx_opts opts; struct gl_video *renderer; int events; @@ -291,13 +290,13 @@ static int preinit(struct vo *vo) struct gpu_priv *p = vo->priv; p->log = vo->log; - struct ra_ctx_opts opts = p->opts; - struct gl_video_opts *gl_opts = - mp_get_config_group(p->ctx, vo->global, &gl_video_conf); + struct ra_ctx_opts *ctx_opts = mp_get_config_group(vo, vo->global, &ra_ctx_conf); + struct gl_video_opts *gl_opts = mp_get_config_group(vo, vo->global, &gl_video_conf); + struct ra_ctx_opts opts = *ctx_opts; opts.want_alpha = gl_opts->alpha_mode == 1; + p->ctx = ra_ctx_create(vo, opts); + talloc_free(ctx_opts); talloc_free(gl_opts); - - p->ctx = ra_ctx_create(vo, p->context_type, p->context_name, opts); if (!p->ctx) goto err_out; assert(p->ctx->ra); @@ -321,19 +320,6 @@ err_out: return -1; } -#define OPT_BASE_STRUCT struct gpu_priv -static const m_option_t options[] = { - {"gpu-context", - OPT_STRING_VALIDATE(context_name, ra_ctx_validate_context), - .help = ra_ctx_context_help}, - {"gpu-api", - OPT_STRING_VALIDATE(context_type, ra_ctx_validate_api), - .help = ra_ctx_api_help}, - {"gpu-debug", OPT_FLAG(opts.debug)}, - {"gpu-sw", OPT_FLAG(opts.allow_sw)}, - {0} -}; - const struct vo_driver video_out_gpu = { .description = "Shader-based GPU Renderer", .name = "gpu", @@ -350,5 +336,4 @@ const struct vo_driver video_out_gpu = { .wakeup = wakeup, .uninit = uninit, .priv_size = sizeof(struct gpu_priv), - .options = options, }; |