Sign in to follow this  
Endemoniada

Unbind Render Target ?

Recommended Posts

Endemoniada    430

Hi guys,

 

I don't really understand what is going on here:

// this is simplified for clarity
 
// set render target to rt0
d3d_context->OMSetRenderTargets(1, &d3d_rt0_view, nullptr);
 
d3d_context->Draw(...);
 
// now use rt0 as shader input
 
// set render target to rt1 (shouldn't this unbind rt0 ?)
d3d_context->OMSetRenderTargets(1, &d3d_rt1_view, nullptr);
 
// this breaks my ssao and causes debug errors
d3d_context->PSSetShaderResources(0, 1, &d3d_rt0_shader_view);
 
d3d_context->Draw(...);

I'm basically rendering to textures then using them in a shader (for SSAO, etc.)

 

Thanks.

 

 

*SOLVED*

 

I have to unbind it explicitly like this:

 

ID3D11ShaderResourceView* srvs[1] = { nullptr };

d3d_context->PSSetShaderResources(0, 1, srvs);

 

Edited by Endemoniada

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this