Skip to content

Removed busyloop from SDL_GPUFence on MacOS#15223

Open
alexgu754 wants to merge 3 commits intolibsdl-org:mainfrom
alexgu754:macos-busyloop-fix
Open

Removed busyloop from SDL_GPUFence on MacOS#15223
alexgu754 wants to merge 3 commits intolibsdl-org:mainfrom
alexgu754:macos-busyloop-fix

Conversation

@alexgu754
Copy link

Description

Before, MetalFence was implemented as simply a busy loop on an atomic int on metal, meaning the cpu would busy wait on the gpu to finish taking power and resources from it and decreasing the battery life. This was the only kind of cpu-gpu syncing (apart from requesting a swapchain)

What's Implemented

This uses the commandbuffer's actual method [waitUntilCompletion] and .status

Before, MetalFence was implemented as simply a busy loop on an atomic
int on metal, meaning the cpu would busy wait on the gpu to finish
taking power from it and decreasing battery life. This was the only kind
of cpu-gpu syncing (apart from requesting a swapchain) and it is
rediculous.
@alexgu754 alexgu754 force-pushed the macos-busyloop-fix branch from 2cb54b9 to 96af344 Compare March 17, 2026 16:23
@slouken slouken added this to the 3.6.0 milestone Mar 17, 2026
@slouken slouken requested a review from TheSpydog March 17, 2026 16:31
alexgu754 and others added 2 commits March 18, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants