Skip to content

Commit 90f4f44

Browse files
guidocelladancingmirrors
authored andcommitted
various: allow changing GPU API options at runtime
Set UPDATE_VO to GPU API options that are only set on init. To change multiple options without multiple reinits, use set vo null; set opengl-foo 1; set opengl-bar 1; set vo gpu
1 parent 31f3f02 commit 90f4f44

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

video/out/opengl/context.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ const struct m_sub_options opengl_conf = {
5757
.opts = (const struct m_option[]) {
5858
{"opengl-glfinish", OPT_BOOL(use_glfinish)},
5959
{"opengl-waitvsync", OPT_BOOL(waitvsync)},
60-
{"opengl-swapinterval", OPT_INT(swapinterval)},
60+
{"opengl-swapinterval", OPT_INT(swapinterval), .flags = UPDATE_VO},
6161
{"opengl-check-pattern-a", OPT_INT(vsync_pattern[0])},
6262
{"opengl-check-pattern-b", OPT_INT(vsync_pattern[1])},
6363
{"opengl-es", OPT_CHOICE(gles_mode,
64-
{"auto", GLES_AUTO}, {"yes", GLES_YES}, {"no", GLES_NO})},
64+
{"auto", GLES_AUTO}, {"yes", GLES_YES}, {"no", GLES_NO}),
65+
.flags = UPDATE_VO,
66+
},
6567
{"opengl-early-flush", OPT_CHOICE(early_flush,
6668
{"no", FLUSH_NO}, {"yes", FLUSH_YES}, {"auto", FLUSH_AUTO})},
6769
{0},

video/out/vulkan/context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const struct m_sub_options vulkan_conf = {
107107
.async_transfer = true,
108108
.async_compute = true,
109109
},
110+
.change_flags = UPDATE_VO,
110111
};
111112

112113
struct priv {

0 commit comments

Comments
 (0)