Jump to content
  • Advertisement
Sign in to follow this  

DX11 Acces violation on IDXGIKeyedMutex::ReleaseSync()

This topic is 2350 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm trying to do DX11/D2D interop trough DX 10.1 and shared texture resources, as described in the links below:


So, basically I am doing the following:

- Create the DX11 device with BGRA support
- Create the DX10.1 device with the same adapter as the DX11 one, also with BGRA support
- Create a Texture2D resource in DX11 with render target, shader resource and keyedmutex flags
- Create mutexes for the texture resource for both DX11 and DX10.1
- Create the D2D factory and render target objects, and bind the render target to the texture above

During one frame I want to do this:

- Lock the DX10.1 mutex with AcquireSync with key 0
- Draw the D2D content into the texture
- Unlock the DX10.1 mutex with ReleaseSync with key 1
- Lock the DX11 mutex with AcquireSync with key 1
- Draw the DX11 content to the screen (the shared texture as a 2D overlay)
- Unlock the DX11 mutex with ReleaseSync with key 0

The problem is that unlocking the DX10.1 mutex with ReleaseSync, key 1, causes an access violation. I have tried with different keys, but none have worked. Not locking the mutex before calling ReleaseSync gives me a different error, namely DXGI_ERROR_INVALID_CALL. Not using mutexes at all, gives me a black texture on the screen. Do you see any problems with the system described? Any potential problems that could cause an access violation when releasing a keyed mutex?


Share this post

Link to post
Share on other sites
Also, if it helps, this is what I get in the output:

First-chance exception at 0x5cd009b8 in NF3.exe: 0xC0000005: Access violation reading location 0x00000014.
Unhandled exception at 0x777d15de in NF3.exe: 0xC0000005: Access violation reading location 0x00000014.

Share this post

Link to post
Share on other sites
Some more info, in case it helps. The callstack at the time of the crash, ie. when running ReleaseSync().

[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> Basis_d.dll!Basis::D2DRenderTarget::renderD2D() Line 99 + 0x1a bytes C++
Basis_d.dll!Basis::D2DManager::render() Line 136 + 0x8 bytes C++
Basis_d.dll!Basis::GraphicsEngine::render() Line 144 C++
Basis_d.dll!Basis::Client::render() Line 274 C++
NF3.exe!NF3::NF3App::run() Line 99 + 0x1f bytes C++
NF3.exe!WinMain(HINSTANCE__ * hInst, HINSTANCE__ * __formal, char * strCmdLine, int nCmdShow) Line 35 C++
NF3.exe!__tmainCRTStartup() Line 547 + 0x2c bytes C
NF3.exe!WinMainCRTStartup() Line 371 C

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!