Nach längerem probieren und suchen möchte ich mein Problem mal hier anbringen. Ich blick da nicht ganz durch, wozu brauch ich eigentlich PSSetShaderResources, wenn ich alles über die Effektschnittstelle setzen kann?
Kann ich über die Effektschnittstelle mittels SetResource(NULL) ein gesetztes Render-Target unbinden?
Ausserdem krieg ich folgende Warnungen nicht weg:
- D3D10: INFO: ID3D10Device::DrawIndexed: The Pixel Shader unit expects a Shader Resource View at Slot 1, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here. [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
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 1 to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ]
D3D10: WARNING: ID3D10Device::PSSetShaderResources: Resource being set to PS shader resource slot 1 is still bound on output! Forcing to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ]
Code: Alles auswählen
GetVariableByName("g_TexReflection")->AsShaderResource()->SetResource(NULL) // für RT-SRV
...
m_pD3DDevice->OMSetRenderTargets(1, pRTViews, pDSView); // View für RT-ArraySlice 0
RenderScene()
...
m_pD3DDevice->OMSetRenderTargets(1, pRTViews, pDSView); // View für RT-ArraySlice 1
RenderScene()
...
SetBackBuffer()
GetVariableByName("g_TexReflection")->AsShaderResource()->SetResource(kcResourceManager::GetRenderTargetSRV())
...
RenderScene()