# Improve GPU selection on Windows \(\#39264\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a78b560b8b569b76aa02d13179846e00f26ce452)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a78b560b8b569b76aa02d13179846e00f26ce452

Requested commit: a78b560b8b569b76aa02d13179846e00f26ce452

Commit: a78b560b8b569b76aa02d13179846e00f26ce452

Tree: 0f084cff2c3c8d78f89eb7c83dfbf8c4d65ef71b

Author: Cave Bats Of Ware

Committer: GitHub

## Message

````
Improve GPU selection on Windows (#39264)

Closes #39263

Release Notes:
- N/A 

from
https://github.com/zed-industries/zed/issues/39263#issuecomment-3358220988

> 
> > If you replace that code with
> > 
> > let adapter: IDXGIAdapter1 = unsafe { 
> >    dxgi_factory.EnumAdapters(adapter_index) 
> > }?.cast()?; 
> > 
> > does it not select the right GPU?
>  
> @reflectronic That does seem to select the active gpu for me, meaning
whichever GPU is currently connected. This is a much simpler solution
than the one I have here
(https://github.com/zed-industries/zed/pull/39264 - updated) and while
I'm sure I could imagine someone wanting to choose their GPU to render
Zed on, that may not be something that the application really needs to
support.
> 
> I have a branch with just this as the only change that I can push to
that PR if the simpler solution is preferred.
> 
> ```rust
>         let adapter: IDXGIAdapter1 = unsafe {
>             dxgi_factory.EnumAdapters(adapter_index)?.cast()?
>         };
> ```
````

## Parents

- [b9a6660b93fe7294ca83336516d7ca9fe0507515](https://git.cafe/gitcafe/zed/commit/b9a6660b93fe7294ca83336516d7ca9fe0507515?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a78b560b8b569b76aa02d13179846e00f26ce452?format=markdown)
