Gfx: [D3D12] E_ACCESSDENIED on CreateSwapChainForHwnd

Created on 26 Feb 2019  Â·  10Comments  Â·  Source: gfx-rs/gfx

Short info header:

  • GFX version: 38c6a9cf3fec8fe78193b27792145245c086ca6e (somewhat recent master)
  • OS: Windows 10
  • GPU: Intel® UHD Graphics 620

When resizing the window the swapchain fails to be recreated with an E_ACCESSDENIED on CreateSwapChainForHwnd
error on swapchain creation 0x80070005

This seems to only happen on Intel GPUs.

DirectX-12 request Windows bug high

Most helpful comment

Crudly hacked in support for ResizeBuffers and the crash disappeared

All 10 comments

I'm the one experiencing this bug, so let me know if I can do anything to help!

Thanks for filing the issue! Does it happen for you with the quad example?
If not:

  • are you initializing from winit or something else?
  • based on a similar thread it could be that the HWND handle dies. We don't retain it after a surface is created with it.
  • could you provide a test case (figuring out the differences with the example would help)?

I didn't try fully investigating this yet, but this seems to be related to Game Capture (maybe also other forms of capture) of OBS. Then it also happens on NVidia GPUs and probably every other GPU too, so this isn't specifically an Intel problem.

Could you clarify what "Game Capture" and "OBS" mean here? @CryZe

OBS is Open Broadcast Software, which is used for doing livestreams. https://obsproject.com/
So if you use it for capturing the game using gfx-hal (and the D3D12 backend) (it probably needs to be specifically the "Game Capture" option), then resizing the window crashes it with the error in the opening post.

@CryZe could you try a simple workaround like this - https://github.com/gfx-rs/wgpu/commit/ecaacfa20e0a4f4de6802303ec6b529d822a30bd#diff-85d17e36ebfabf7f5c8cd58cae20a156R1528

I could try this, but probably not till Thursday or Friday.

On Mar 5, 2019, at 9:26 PM, Dzmitry Malyshau notifications@github.com wrote:

@CryZe could you try a simple workaround like this - gfx-rs/wgpu@ecaacfa#diff-85d17e36ebfabf7f5c8cd58cae20a156R1528

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

I already have a wait_idle() there, so that doesn't seem to help.

Skimming a bit through OBS source, I would say this is rather an issue on their side than ours. Nothing stops us from recreating swapchains on the fly but OBS doesn't seem to handle that case. Recreation is currently what's happening in the resize code. Friction between gfx's dx12 backend and OBS will be reduced once we implement support for a ResizeBuffers variant, which is the preferred but more limited way of resizing. In 95% of the cases ResizeBuffers would be fine but doesn't provide full functionality of Vulkans swapchain handling.

Crudly hacked in support for ResizeBuffers and the crash disappeared

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kvark picture kvark  Â·  4Comments

seivan picture seivan  Â·  4Comments

kvark picture kvark  Â·  3Comments

kvark picture kvark  Â·  3Comments

kvark picture kvark  Â·  4Comments