How to create a Texture2DArray from files in DX11?

Started by
12 comments, last by pnt1614 11 years, 3 months ago

I'm a bit suspicious about "I released the texArray because we only need the shader resource view.". As far as I understand, you'll need the texture object, even if you don't use it for other things than just creating SRVs.

SRV is just an object for the shader to interpret the texture contents. You may even have several SRVs per texture and they both point to the same data.

Actually, it could be that the texture isn't released because creating a SRV may increase the texture's reference count and for that reason the texture isn't released before you release the SRV. Perhaps someone can confirm this.

Do you release your SRV when the program finishes?

Cheers!

Advertisement

thank kauna, let me check it.

It's safe to release a texture if you only need the SRV. The SRV will increment the internal refcount of the texture resource, so it will stay alive until you release the SRV. Same goes for RTV's and UAV's.

Thank for helping me, guys. But the error is still there, although I release the SRV at the end of program. Is there any way to check which one increases the internal refcount?

This topic is closed to new replies.

Advertisement