Hi — I've written a native Metal backend for pl_gpu and wanted to check
interest before filing a formal merge request.
Status: it's working, not a sketch. It mirrors the Vulkan/GL/D3D11 backends
(a pl_gpu_fns vtable + public creation API + CAMetalLayer swapchain), reusing
the in-tree GLSL emitter via GLSL → SPIR-V (pl_spirv) → MSL (SPIRV-Cross) →
MTLLibrary/PSO. ~2260 LOC over 13 staged commits.
What works:
- Passes the full
gpu_tests suite (buffer/texture/shader incl. film grain, HDR
peak, all transfer functions, dithering, error diffusion). 25 formats.
plplay renders real H.264 through pl_renderer on Metal.
pl_timer returns real GPU times (MTLCommandBuffer timestamps).
- Validated on a physical device (Apple A19 / iPhone 17 Pro), including the
iOS-only packed format bgr565.
Branch (public, reviewable via the compare view):
master...simonchrz:libplacebo:metal-pr-series
Three questions before I invest more polish:
- Do you want a Metal backend in-tree at all, or would you rather it lived
out-of-tree? I'm happy to maintain the Apple side either way.
- CI: the GitLab pipeline has no macOS runner, so the existing CI can't build
this. How would you like to handle that — a macOS job (I can draft one), or
merge-with-the-understanding-it's-community-tested?
- Anything in the structure you'd want reshaped before a serious review.
I'll file the formal MR on code.videolan.org once my GitLab account is approved
(currently awaiting admin approval); opening here first since GitHub PRs are
restricted to collaborators. Happy to move the discussion to GitLab if you prefer.
Hi — I've written a native Metal backend for
pl_gpuand wanted to checkinterest before filing a formal merge request.
Status: it's working, not a sketch. It mirrors the Vulkan/GL/D3D11 backends
(a
pl_gpu_fnsvtable + public creation API +CAMetalLayerswapchain), reusingthe in-tree GLSL emitter via GLSL → SPIR-V (
pl_spirv) → MSL (SPIRV-Cross) →MTLLibrary/PSO. ~2260 LOC over 13 staged commits.
What works:
gpu_testssuite (buffer/texture/shader incl. film grain, HDRpeak, all transfer functions, dithering, error diffusion). 25 formats.
plplayrenders real H.264 throughpl_rendereron Metal.pl_timerreturns real GPU times (MTLCommandBuffer timestamps).iOS-only packed format
bgr565.Branch (public, reviewable via the compare view):
master...simonchrz:libplacebo:metal-pr-series
Three questions before I invest more polish:
out-of-tree? I'm happy to maintain the Apple side either way.
this. How would you like to handle that — a macOS job (I can draft one), or
merge-with-the-understanding-it's-community-tested?
I'll file the formal MR on code.videolan.org once my GitLab account is approved
(currently awaiting admin approval); opening here first since GitHub PRs are
restricted to collaborators. Happy to move the discussion to GitLab if you prefer.