🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DX 12 Command Queue Signal problem

Started by
1 comment, last by Flone 3 years, 9 months ago

I started learning DX 12 recently and now finished making my first lighting shader. Unfortunately, I've noticed some strange things happening. So, when I close the app window the msg proc quits and in the end I set the fence point to wait for all GPU work to end before releasing stuff. And now, after making the lighting shader my last Signal function call never gets executed. In the end of every draw() function I use ID3D12CommandQueue::Signal() with new fence value. In the app destructor I set another new fence point and wait for it to fire using the WaitForSingleObject(), but the ID3D12Fence::GetCompletedValue() always returns ‘CurrentFenceValue minus 2’ value no matter how long I wait, thus, the app window closes but the process is still running.

I'm working on a cheap laptop that gives me like 14 fps in debug mode. Sometimes I compile shaders in release mode (D3DCOMPILE_OPTIMIZATION_LEVEL3) to get more fps (around 90) and when I get more fps this fence issue never occurs. I'm confused, how can I investigate this issue? Any tips?

Advertisement

I hate to answer my own questions but I guess I found the issue. Setting the fence point and waiting for the GPU to finish its work right before I call the PostQuitMessage solves the issue. I guess the GPU just can't draw on the window that does not exist and just… waits... Strangely the d3d debug layer was silent and the output window did not tell of any issues.

Well, I hope that this at least will help someone someday. ?

This topic is closed to new replies.

Advertisement