Sign in to follow this  

direct3d 10 question

This topic is 1592 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 have this

 

ID3D10ShaderResourceView*                       myTexture = NULL;

ID3D10EffectShaderResourceVariable*        g_pTextureReader = NULL;

 

ID3D10EffectTechnique*                   g_pTechnique1  = NULL;
ID3D10EffectTechnique*                   g_pTechnique2 = NULL;
 
now I do this
 
g_pTextureReader ->SetResource( myTexture );
 
g_pTechnique1->GetPassByIndex( 0 )->Apply( 0 );
g_pd3dDevice->Draw(1, 0);
 
g_pTechnique2->GetPassByIndex( 0 )->Apply( 0 );
g_pd3dDevice->Draw(1, 0);
 
then I want to render to "myTexture" renderTarget, so I need to unbound "myTexture" , to do that I do this
 
g_pTextureReader ->SetResource( NULL );
g_pTechnique1->GetPassByIndex( 0 )->Apply( 0 );
g_pTechnique2->GetPassByIndex( 0 )->Apply( 0 );
 
Is this last thing the way it is done normally?
 
 
 
Edited by lomateron

Share this post


Link to post
Share on other sites

don't know very well how the bound and unbound works, it looks like if I don't unbound them on every technique it has been bound to, the bound will be still there, so every time you want to render to a bound thing you have to remember in which technique it was bounded, and the only method I know to unbound texture is the "apply(0)" thing

 

anyone knows more?

Share this post


Link to post
Share on other sites

I know one method .when you have changed the render target ,then do this

 

    ID3D10ShaderResourceView* pSRV[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
    pDev->PSSetShaderResources( 0, _countof(pSRV), pSRV );

Edited by LPVOID

Share this post


Link to post
Share on other sites
Sign in to follow this