gpui: Take advantage of unified memory on Apple silicon#45577
gpui: Take advantage of unified memory on Apple silicon#45577reflectronic merged 16 commits intozed-industries:mainfrom
Conversation
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
fd243e2 to
069875b
Compare
|
@Anthony-Eid The upstream PR has been merged, and I’ve updated both |
Thanks for keeping track of this! I'm enabling auto merge |
Head branch was pushed to by a user without write access
|
@Anthony-Eid sorry I had to fix a leftover from a conflict. The ci should pass now |
|
Sorry @marcocondrache. I updated nightly from 949972b...22e2c7a and I'm seeing the same behavior I reported in #45020 Zed Nightly launches, no display surface, no errors in log. Hangs and needs to be Force Quit. |
|
@notpeter I'm going to revert this, thanks for the heads up |
…)" This reverts commit ba41499.
) Reverts #45577 This still causes gpui to be unusable for Intel Macs and by extension Zed. Release Notes: - N/A
Port PR zed-industries#45577 performance changes for Apple Silicon-focused builds:\n- use Shared + write-combined buffers when unified memory is available\n- cache unified-memory capability in renderer/atlas\n- skip did_modify_range sync on unified memory\n- use private/memoryless texture storage where applicable\n- bump metal to 0.33 and core-video to 0.5.2
Port PR zed-industries#45577 performance changes for Apple Silicon-focused builds:\n- use Shared + write-combined buffers when unified memory is available\n- cache unified-memory capability in renderer/atlas\n- skip did_modify_range sync on unified memory\n- use private/memoryless texture storage where applicable\n- bump metal to 0.33 and core-video to 0.5.2
Port PR zed-industries#45577 performance changes for Apple Silicon-focused builds:\n- use Shared + write-combined buffers when unified memory is available\n- cache unified-memory capability in renderer/atlas\n- skip did_modify_range sync on unified memory\n- use private/memoryless texture storage where applicable\n- bump metal to 0.33 and core-video to 0.5.2
Third attempt to land this improvement: (#45577, #44273) The previous PR didn’t work on Intel MacBooks because I made a wrong assumption about the unified memory check. `has_unified_memory` only tells us that the CPU and GPU share memory. It does not mean we’re running on an Apple GPU family. Memoryless textures are only supported on Apple GPUs. Some Intel Macs report unified memory, but they don’t support memoryless textures, which is why the previous change failed there. So instead of relying on unified memory, we now explicitly check that we’re running on an Apple GPU family before enabling memoryless textures. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [X] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Reduced memory usage on macOS --------- Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Reapplies #44273
I included metal-rs upgrade so we can get this working on Intel-based Macs
cc: @JosephTLyons @notpeter @rtfeldman @Anthony-Eid
Release Notes: