Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Metal fences to rely on GPU-side signals instead #30

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

frenzibyte
Copy link
Member

Dependency for getting rid of all the mutex locks surrounding MTLCommandBuffer completion handler, and potentially getting rid of the completion handler altogether.

In Metal, there is an object which can be accessed & updated by both the CPU and the GPU, and this PR relies on that object to use for implementing fences instead. Works pretty efficiently, and on a 10 second run on sample game, there's about 12ms spent on reading the signal value by the CPU:

CleanShot 2023-07-09 at 09 29 55

src/Veldrid/MTL/MTLFence.cs Outdated Show resolved Hide resolved
@peppy peppy merged commit b84af63 into ppy:master Jul 10, 2023
@frenzibyte frenzibyte deleted the metal-gpu-fences branch July 10, 2023 02:46
peppy pushed a commit that referenced this pull request Jul 13, 2023
This reverts commit b84af63, reversing
changes made to 6a43198.
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