baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
9.11k stars 1.36k forks source link

Can't make a capture on CryEngine 3.7 #131

Closed WoodyPWX closed 9 years ago

WoodyPWX commented 9 years ago

Hello,

First I have to say the RenderDoc is a great tool! It became my main tool for debugging of rendering issues in our game/editor. We recently merged with the latest CryE 3.7, but I can no longer make a capture. I tried only the editor yet, but the same issue is with the vanilla Sandbox 3.7. There is a message in the top left corner "Inactive swapchain. F11 to cycle between swapchains", but F11 doesn't do anything and triggering capture from the RenderDoc hang the editor.

Regards, Tomas

koalefant commented 9 years ago

That is an Editor bug and will be fixed in then next point release of CE.

WoodyPWX commented 9 years ago

Could we have a patch or a hint how to fix that ourselves? Especially after the merge we have many issues in the rendering and shaders because of all that improvements and refactor of both the source code and shaders in 3.7 that collided with our own modifications

koalefant commented 9 years ago

Could you create a ticket in CE Jira? You should get a patch there.

WoodyPWX commented 9 years ago

I did that, thank you.

baldurk commented 9 years ago

What is/was the bug exactly? I know that CryEngine makes an 'invisible' swapchain in the editor, that then becomes the default and you have to toggle away from it. I fixed it at some point but I don't think that code ever went back to the main branch.

But it should work to cycle through with F11 and eventually get to the swapchain you want - if you can't ever select the active swapchain, that is a RenderDoc bug still, so I'd like to fix it.

WoodyPWX commented 9 years ago

Added a test "if (x.window && x.window != m_renderer->GetCurrentContextHWND())" to the CRenderViewport::RestorePreviousContext(const SPreviousContext&).

Unfortunately, although I'm able to make a capture and its structure look fine at first look, there are error messages like this one: "26 Incorrect use of API High Setting 0 Invalid output merger - Depth target is different size or MS count to render target(s)" and I don't see the render targets properly. Only the depth buffer is visible during the Z Pass draw calls and even that is not correctly shown. I can see just the current DP and not all DPs until the selected one. I can attach a test .rdc file for you if you can describe how ;) I have reported it on Jira, but no one replayed yet.

baldurk commented 9 years ago

The first part I don't know about, as I haven't been at Crytek since last year so I don't have the code to refer to.

The errors and the render targets being messed up sounds like it could be to do with this fix I made, where renderdoc wasn't correctly handling depth buffers that are larger than the render targets. This is something again that I know cryengine used to do - it would create a depth buffer the size of the desktop, and only use a subset of it per-window.

Are you able to try with a recent nightly build? You might have to re-capture rather than replay the existing .rdc file.

WoodyPWX commented 9 years ago

yep, the nightly build works fine in that regard. The only problem I discovered is the thumbnail of the first capture in the "Captures collected:" empty. Others were fine though. Thanks for the fix anyway!