Reduce GPU memory usage (#7319)
This pull request decreases the size of each instance buffer and shares instance buffers across windows. Release Notes: - Improved GPU memory usage. --------- Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
d08d4174a5
commit
c906fd232d
3 changed files with 24 additions and 13 deletions
|
@ -459,6 +459,7 @@ impl MacWindow {
|
|||
handle: AnyWindowHandle,
|
||||
options: WindowOptions,
|
||||
executor: ForegroundExecutor,
|
||||
instance_buffer_pool: Arc<Mutex<Vec<metal::Buffer>>>,
|
||||
) -> Self {
|
||||
unsafe {
|
||||
let pool = NSAutoreleasePool::new(nil);
|
||||
|
@ -535,7 +536,7 @@ impl MacWindow {
|
|||
native_window,
|
||||
native_view: NonNull::new_unchecked(native_view as *mut _),
|
||||
display_link,
|
||||
renderer: MetalRenderer::new(true),
|
||||
renderer: MetalRenderer::new(instance_buffer_pool),
|
||||
kind: options.kind,
|
||||
request_frame_callback: None,
|
||||
event_callback: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue