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

Started by
1 comment, last by Hodgman 8 years, 2 months ago

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?

Advertisement

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

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.

This topic is closed to new replies.

Advertisement