vo_gpu_next: update tmp params before rendering frame

Gives the correct queue size value for the subsequent pl_queue_update()
calls, which avoids a bit of unnecessary overhead.
This commit is contained in:
Niklas Haas 2023-08-27 14:00:39 +02:00 committed by Niklas Haas
parent 0fd357a416
commit 902bbdad35
1 changed files with 6 additions and 7 deletions

View File

@ -918,8 +918,14 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
update_options(vo);
struct pl_render_params params = pars->params;
bool will_redraw = frame->display_synced && frame->num_vsyncs > 1;
bool cache_frame = will_redraw || frame->still;
params.info_callback = info_callback;
params.info_priv = vo;
params.skip_caching_single_frame = !cache_frame;
params.preserve_mixing_cache = p->inter_preserve && !frame->still;
if (frame->still)
params.frame_mixer = NULL;
// Push all incoming frames into the frame queue
for (int n = 0; n < frame->num_frames; n++) {
@ -1069,13 +1075,6 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
}
}
bool will_redraw = frame->display_synced && frame->num_vsyncs > 1;
bool cache_frame = will_redraw || frame->still;
params.skip_caching_single_frame = !cache_frame;
params.preserve_mixing_cache = p->inter_preserve && !frame->still;
if (frame->still)
params.frame_mixer = NULL;
// Render frame
if (!pl_render_image_mix(p->rr, &mix, &target, &params)) {
MP_ERR(vo, "Failed rendering frame!\n");