Problem when resizing Render Targets

Started by
2 comments, last by karnaltaB 7 years, 10 months ago

Hi,

When I resize my render frame, I resize the swap chain and recreate all my render targets. But as soon as I do it, my render did work anymore, I just got my clear color displayed.

I can't really provide code sample because this is part of a larger project, but here is how I proceed :

- Resize the swapchain

- Recreate the viewport

- For each render targets :

+ Dispose the Texture2D and recreate it with the new size.

+ Dispose and recreate the ShaderResourceView from the Texture2D

+ Dispose and recreate the RenderTargetView from the Texture2D

- For each depth stencil :

+ Dispose the Texture2D and recreate it with the new size.

+ Dispose and recreate the ShaderResourceView from the Texture2D

+ Dispose and recreate the DepthStencilTargetView from the Texture2D

As soon as I do that, my draw aren't displayed anymore.

If I debug the frame, I can't see that all my draw calls correctly occur and pass throught the vertex shader but stop there, pixel shader is not executed (but one is bind correctly). In the pixel history, I just seen :

- Initial

- ClearTargetView

- Final

No Pixel shader stage or depth test stage... I am probably missing something simple but I don't know what..

Thank if someone can help me.

Advertisement

Have you tried to create the device with the D3D11_CREATE_DEVICE_DEBUG flag? The debug layer usually tends to scream loudly what the errors are in these kinds of scenarios. (At least in my experience, when I encountered these kinds of problems, the cause was usually something like I forgot to release something, or I did something in the wrong order, both of which can be seen from the debug layers messages.)

Yes debug layer is activated. There is no messages.

I have partially identified the problem.

It look like a far clip plane problem, if I zoom in on my scene, I can see it rendered correctly. It's like there is a clip plane at a few unit of the camera.

But I am on DirectX 11 and I have not set any clip plane, if I am right, in DX11 this not automatic ? You have to setup the clip plane via shader ?

EDIT :

Ok it's solved, it was a far clip plane problem, it's still automatic in DX11, my fault. I was using a 10000 unit far plane in engine initialisation but after a resize I was using a 500 unit far place, I was setting at another place of my code..

This topic is closed to new replies.

Advertisement