Commit Graph

14 Commits

Author SHA1 Message Date
Martin Fouilleul f14f397c99 [mtl surface] don't re-acquire drawable if there's already a valid one acquired 2023-03-15 18:51:50 +01:00
Martin Fouilleul bd8e31c535 [mtl canvas] triple buffer vertex/index/shape buffers 2023-03-15 17:48:39 +01:00
Martin Fouilleul 0c74e997ae [mtl surface] fix crash on exit when metal GPU frame capture is enabled. Apparently, if we release resources (on exit) before all GPU work is completed, libMetalCapture crashes on bad access. To work around that, in mg_mtl_surface_destroy(), we enqueue a last (empty) command buffer and call waitUntilCompleted on it, to ensure all previous command buffers are also completed 2023-03-15 13:02:18 +01:00
Martin Fouilleul 7c58145524 [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.
2023-03-13 12:21:33 +01:00
Martin Fouilleul 592f4cdecd end of line renormalization 2023-03-05 16:05:43 +01:00
Martin Fouilleul 731e5b1ae8 [surface] pull mp_layer into the generic mg_surface_data struct, out of each backend-specific implementation 2023-03-03 11:50:12 +01:00
Martin Fouilleul 43d413dbbc [surface] graphics surface sharing API + osx implementation 2023-03-01 16:15:36 +01:00
Martin Fouilleul 28f5af32fa [graphics] Allocate canvases and fonts from graphics subsystem's arena 2023-03-01 11:37:33 +01:00
Martin Fouilleul 6bf989564d [graphics] use a single handle arena for all graphics subsystem handles 2023-02-28 20:33:55 +01:00
Martin Fouilleul d195fb1f61 [canvas, mtl backend] Compute each layer with pre-multiplied alpha, starting from transparent color. Composite them to surface with premultiplied alpha too. 2023-02-27 14:24:59 +01:00
Martin Fouilleul 94373d12ae [surface] extracted common layer functionality from osx surfaces. Use layer in platform-agnostic egl surface. 2023-02-21 13:40:30 +01:00
Martin Fouilleul 4306d0a01c back osx surfaces by CALayer 2023-02-20 16:49:44 +01:00
Martin Fouilleul 2232b647ed reintroduced GLES backend to osx 2023-02-20 11:05:01 +01:00
martinfouilleul 80ea8db687 [surface/canvas cleanup]
- Make build-time and runtime backend selection a bit easier
- Reorganized backend-specific files with slightly more coherent naming scheme
2023-02-10 16:56:10 +01:00