Extracting ID3D11Resource from a ID3D11ShaderResourceView

Started by
1 comment, last by pseudomarvin 8 years, 11 months ago

I am rendering scene into a multisampled texture and want to resolve it using ID3D11DeviceContext::ResolveSubresource metod which requires ID3D11Resource* as parameters while I am just storing the textures used as ID3D11RenderTargetView for rendering into and as ID3D11ShaderResourceView for sampling and only use a temporary ID3D11Texture2D when creating the texture. Is it possible to somehow get the ID3D11Resource* out of the views? (I suspect that I can't and will have to store the texture itself since D3D11View does not inherit from ID3D11Resource) Thanks.

Advertisement
ID3D11ShaderResourceView inherits from ID3D11View which has a method called GetResource(). You can use that to get the resource accessed through that view.

Here's the documentation:
https://msdn.microsoft.com/en-us/library/windows/desktop/ff476642(v=vs.85).aspx

Thanks, I will do that.

This topic is closed to new replies.

Advertisement