[mtl surface] Allow setting swap interval to 0. Note however that vsync needs to be turned off at the OS level for that to work smoothly. Otherwise, we get jittery frame rate with stalls when we run off of drawables (I suppose? should investigate some more).

This can be done with Quart Debugger in Additional Tools for XCode.
This commit is contained in:
Martin Fouilleul 2023-03-13 12:21:33 +01:00
parent 716bdc53d4
commit 7c58145524
2 changed files with 6 additions and 6 deletions

View File

@ -193,14 +193,14 @@ int main()
mg_set_font(font); mg_set_font(font);
mg_set_font_size(12); mg_set_font_size(12);
mg_move_to(50, 600-50); mg_move_to(50, 600-50);
/*
str8 text = str8_pushf(mem_scratch(), str8 text = str8_pushf(mem_scratch(),
"Milepost vector graphics test program (frame time = %fs, fps = %f)...", "Milepost vector graphics test program (frame time = %fs, fps = %f)...",
frameTime, frameTime,
1./frameTime); 1./frameTime);
mg_text_outlines(text); mg_text_outlines(text);
mg_fill(); mg_fill();
*/
printf("Milepost vector graphics test program (frame time = %fs, fps = %f)...\n", printf("Milepost vector graphics test program (frame time = %fs, fps = %f)...\n",
frameTime, frameTime,
1./frameTime); 1./frameTime);

View File

@ -120,10 +120,10 @@ void mg_mtl_surface_present(mg_surface_data* interface)
void mg_mtl_surface_swap_interval(mg_surface_data* interface, int swap) void mg_mtl_surface_swap_interval(mg_surface_data* interface, int swap)
{ {
mg_mtl_surface* surface = (mg_mtl_surface*)interface; mg_mtl_surface* surface = (mg_mtl_surface*)interface;
@autoreleasepool
//////////////////////////////////////////////////////////////// {
//TODO [surface->mtlLayer setDisplaySyncEnabled: (swap ? YES : NO)];
//////////////////////////////////////////////////////////////// }
} }
void mg_mtl_surface_set_frame(mg_surface_data* interface, mp_rect frame) void mg_mtl_surface_set_frame(mg_surface_data* interface, mp_rect frame)