Fix application freezing on macOS when trace_tracy is enabled#23201
Fix application freezing on macOS when trace_tracy is enabled#23201xremming wants to merge 2 commits intobevyengine:mainfrom
trace_tracy is enabled#23201Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
e7e8bfb to
e7fcc1d
Compare
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
@xremming Just confirming that you meant to point this PR to be merged into the Does this issue appear on main? If so, I think it’s better to point this PR to be merged into main, and then we can tag it appropriately for inclusion in the correct milestone |
|
Indeed: we should point this to |
|
@kfc35 I did indeed point this to 0.18.1 branch for a reason, which is that it's where I made the fix at for myself for (and tested it). I can rebase this to main if that's preferable. However 0.18.1 is not yet released at crates.io? |
Yes, this needs to be rebased :)
Correct; just waiting for final sign-off from fellow maintainers. |
e7fcc1d to
8a86699
Compare
|
Rarely does a rebase work on the first try as intended... Nice. Tested it out with and without the patch on main against the 3d_shapes example and can confirm the fix still works (and is still required). |
|
Would be interesting if someone with an older macOS version could test this. Seeing that it has worked on macOS previously, at least based on the profiling.md that has a screenshot from macOS. This also made me wonder if this will need to be gated on iOS too. 🤔 I remember seeing an issue about supporting Tracy on iOS and Android. Perhaps another PR will be required to rework the GPU profiling based on support for it. |
| Backend::Vulkan => GpuContextType::Vulkan, | ||
| Backend::Dx12 => GpuContextType::Direct3D12, | ||
| Backend::Gl => GpuContextType::OpenGL, | ||
| Backend::Metal | Backend::BrowserWebGpu | Backend::Noop => GpuContextType::Invalid, |
There was a problem hiding this comment.
Why do we even bother continuing if we hit an invalid backend - could we just make this function fallible and do nothing on unsupported platforms? Then we can stop worrying about these hacks.
Objective
On macOS (26.3) enabling tracy for tracing causes Bevy to freeze here.
https://github.com/bevyengine/bevy/blob/release-0.18.1/crates/bevy_render/src/diagnostic/tracy_gpu.rs#L64
I assume this problem is likely related to the same root cause as #22365.
Solution
Testing