Jump to content
  • Advertisement
Sign in to follow this  
jbizzler

Resource being set to OM RenderTarget slot 0 is still bound on input!

This topic is 2171 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 implement shadow mapping into DX10, and have run into a problem. First, I generate the shadow map, and then I send its shader resource to the effect for comparing. One pass works great. But when I have to set the shadow map to the render target again, I recieve the following warning: D3D10: WARNING: ID3D10Device::OMSetRenderTargets: Resource being set to OM RenderTarget slot 0 is still bound on input! [ STATE_SETTING WARNING #9: DEVICE_OMSETRENDERTARGETS_HAZARD ] D3D10: WARNING: ID3D10Device::OMSetRenderTargets: Forcing PS shader resource slot 0 to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ] Now, normally I'd keep looking for the answer alone until weeks later I cry at how simple the solution was, but I'm not going to do that this time, especially since the only other post I can find about it is two weeks old, inconclusive, and from Wolfang Engel himself, the very man who's ShaderX 5 article I'm trying to implement. I get the gist. Since the shadow map is bound to the effect, it can't be the render target of it. So what do I do? P.S. What are this forum's code tags again?

Share this post


Link to post
Share on other sites
Advertisement
Actually I have tried. I've tried both setting it to NULL as well as creating a blank texture and setting it to that, but it still says it's bound to input.

Share this post


Link to post
Share on other sites
Okay, Instead of setting the variable to NULL directly, I did this after rendering the scene:


ID3D10ShaderResourceView *const pSRV[1] = {NULL};
pDevice->PSSetShaderResources(0, 1, pSRV);
[\CODE]

And the warning is gone, but now when I try and sample it between rendering it and setting it null, it always samples 0s. If I get stumped by this as well, I'll make another post.

Share this post


Link to post
Share on other sites
This is a very common mistake(and this must be the most watched problem without solution when searched in google).
so the solution is this, set the texture variable to null AND!! refresh the technique by writing something like this
g_pTechnique->GetPassByIndex( 0 )->Apply( 0 ); Edited by lomateron

Share this post


Link to post
Share on other sites

And the warning is gone, but now when I try and sample it between rendering it and setting it null, it always samples 0s. If I get stumped by this as well, I'll make another post.

If you need to sample from it, you are going to have to add it back via another call to PSSetShaderResources().
If you think you need to read from it and write to it at the same time, you are wrong. You can’t do it, so find another way (write to a copy while reading from the source).


L. Spiro

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!