   [DirectX10] My texture views get set to NULL
  I am writing a bloom post processing shader at the moment, and I got a problem.DirectX sets my textures views to NULL, because it thinks that they are bound as output already. But that is not true (Or it is?)! Here is my code:void PP_EngineEffect::OnRender(Mesh* PlaneMesh){//RenderQuad(PlaneMesh,SimpleShader);if(!PongTex || !PingTex){return; //Those textures didn't get created}//------------------------//Begin rendering the bloom. I use 2 textures (Ping and pong) to switch between them//for doing such things like downscaleing and blurring.//------------------------//Downscale the rendertarget and apply brightpassSetRenderTexture(PingTex->RenderTargetView); //Set the new backbufferBrightPass->SetBackBufferVar(NULL); //Set the texture, where the world is rendered to, to the shader (NULL uses the default backbuffer)RenderQuadSized(PlaneMesh,BrightPass,0.25,0.25,  0.25,0.25); //Draw quad at size 0.25,0.25 and set the scissoring rect to 0.25,0.25 as well//horizontaly blur the rendertargetSetRenderTexture(PongTex->RenderTargetView);HBlur->SetBackBufferVar(PingTex->ShaderResView);RenderQuadSized(PlaneMesh,HBlur,1,1,  0.25,0.25);HBlur->SetBackBufferVar(NULL);//Verticaly blur the rendertarget SetRenderTexture(PingTex->RenderTargetView);VBlur->SetBackBufferVar(PongTex->ShaderResView);RenderQuadSized(PlaneMesh,VBlur,1,1,  0.25,0.25);VBlur->SetBackBufferVar(NULL);//Upscale the blurSetRenderTexture(PongTex->RenderTargetView);SimpleShader->SetBackBufferVar(PingTex->ShaderResView);RenderQuadSized(PlaneMesh,SimpleShader,4,4,  1,1);SimpleShader->SetBackBufferVar(NULL);//Apply the blooming to the rendertargetSetRenderTexture(PingTex->RenderTargetView);Combiner->SetBackBufferVar(NULL); //Original sceneif(Combiner->CustomTextureVariable){Combiner->CustomTextureVariable->SetResource(PongTex->ShaderResView); //Blurred and brightpassed scene} RenderQuadSized(PlaneMesh,Combiner,1,1,  1,1);if(Combiner->CustomTextureVariable){Combiner->CustomTextureVariable->SetResource(NULL); //Need to NULL (default backbuffer) this (Do I?)} Combiner->SetBackBufferVar(NULL);//And at least, copy the scene back to the backbufferSetRenderTexture(StartRenderTarget);SimpleShader->SetBackBufferVar(PingTex->ShaderResView); //Original sceneRenderQuadSized(PlaneMesh,SimpleShader,1,1,  1,1);SimpleShader->SetBackBufferVar(NULL);}The CustomTextureVariable of the Combiner-shader is a special variable for coders to do something with it, without hurting the users freedom of using other textures.SetRenderTexture() sets the current backbufferAnd here is what directX says: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 ]These warnings cause that the whole downscale/blurring/etc stuff doesn't run. (It works, I tested it in a simple test)So, how to fix it=   
  I doubt that the device is mistaken about which resources are set as render target views and shader resource views. You can find out yourself pretty easily by using PIX: find the draw call, look at the device state, and see which resources are bound.   ;  Somehow, PIX crashes everytime I want to use it with my engine. But only if I do the "Press F12 to log everything" option. Every other works. It gives an assert that my backbuffer is not at the same size as my window. I'll try a release build now...EDIT: And the releas build doesn't starts, because of a side-by-side config problem. ???   ;Quote:Original post by mind in a boxIt gives an assert that my backbuffer is not at the same size as my window. Well, is it?;  Without PIX, it is...EDIT: Do I have to validate the new setting of the Rendertarget first? If yes: How?[Edited by - mind in a box on April 30, 2010 2:37:14 PM];  What is, when it IS bound? How can I unbind them? You see, I set a new ShaderResource and a new Rendertarget before I switch them. Do I need to do something to validate the new settings (Like with a draw call)?   