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

Does wgpu_hal::dx12 properly recognize added and removed adapters? #6038

Open
jimblandy opened this issue Jul 24, 2024 · 0 comments
Open

Does wgpu_hal::dx12 properly recognize added and removed adapters? #6038

jimblandy opened this issue Jul 24, 2024 · 0 comments
Labels
api: dx12 Issues with DX12 or DXGI

Comments

@jimblandy
Copy link
Member

In Direct3D 12, it seems that the system is scanned for available adapters only when you create an IDXGIFactory (docs):

When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the IDXGIFactory object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.

wgpu_hal::dx12::Instance::factory is the IDXGIFactory that we use for all enumeration. This implies that if wgpu_core wants to see new devices or be informed of devices going away, it needs to create an entirely new Api::Instance, which is not generally the way we expect to use the wgpu_hal API.

I'm not a Windows dev, but it seems to me that we should probably be creating a fresh IDXGIFactory every time we call wgpu_hal::Instance::enumerate_adaptors.

@jimblandy jimblandy added the api: dx12 Issues with DX12 or DXGI label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dx12 Issues with DX12 or DXGI
Projects
Status: Todo
Development

No branches or pull requests

1 participant