mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 12:52:14 +00:00
renderer-native: Swap then await earlier flips.
Rendering the next frame (which mostly happens as part of the flush done
in swap buffers) is a task that the GPU can complete independently of
the CPU having to wait for previous page flips. So reverse their order
to get the GPU started earlier, with the aim of greater GPU-CPU
parallelism.
(cherry picked from commit 6e415353e3
)
This commit is contained in:
parent
2da2489da5
commit
b2f9de98d0
@ -1854,18 +1854,18 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
|||||||
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
||||||
frame_info->global_frame_counter = renderer_native->frame_counter;
|
frame_info->global_frame_counter = renderer_native->frame_counter;
|
||||||
|
|
||||||
/*
|
|
||||||
* Wait for the flip callback before continuing, as we might have started the
|
|
||||||
* animation earlier due to the animation being driven by some other monitor.
|
|
||||||
*/
|
|
||||||
wait_for_pending_flips (onscreen);
|
|
||||||
|
|
||||||
update_secondary_gpu_state_pre_swap_buffers (onscreen);
|
update_secondary_gpu_state_pre_swap_buffers (onscreen);
|
||||||
|
|
||||||
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
|
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
|
||||||
rectangles,
|
rectangles,
|
||||||
n_rectangles);
|
n_rectangles);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wait for the flip callback before continuing, as we might have started the
|
||||||
|
* animation earlier due to the animation being driven by some other monitor.
|
||||||
|
*/
|
||||||
|
wait_for_pending_flips (onscreen);
|
||||||
|
|
||||||
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||||
render_gpu);
|
render_gpu);
|
||||||
switch (renderer_gpu_data->mode)
|
switch (renderer_gpu_data->mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user