Jump to content
  • Advertisement
Sign in to follow this  
Happy SDE

Is there a need to store Texture2D object for render targets?

This topic is 889 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

In my current GBuffer implementation, for each render targets, I store 3 objects as class members:

 

Microsoft::WRL::ComPtr<ID3D11Texture2D> m_t0; //Normal

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_rtv0;

Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_srv0;

 

?

I found that I don’t use ID3D11Texture2D object in my code after RTV and SRV initialization.

I am thinking on releasing the texture object right after RTV and SRV creation.

 

But I am not sure about usage of the texture object in other use cases.

Anyone has an idea, when keeping texture object for render target is useful?

Edited by Happy SDE

Share this post


Link to post
Share on other sites
Advertisement

You can drop it.
It is reobtainable(if there is such a word) via the RTV or the SRV.

Edited by imoogiBG

Share this post


Link to post
Share on other sites

Anyone has an idea, when keeping texture object for render target is useful?

If you want to call Context::CopyResource / CopySubresourceRegion then you'll need the resource pointer.

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!