Jump to content
  • Advertisement
Sign in to follow this  

Creating 2D texture array

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

Simple question.  I need to create a 2D array texture with mipmaps.  I'd like it to be immutable.  I'm not sure how to set up my D3D11_SUBRESOURCE_DATA structures.  How many do I need and in what order?

Share this post


Link to post
Share on other sites
Advertisement
You need one per subresource in your texture, which means you will have ArraySize * MipLevels subresources. For the ordering you pass the data for Mip 0 of Index 0, then Mip 1 of Index 0, and so on for all Mip levels. Then you go to Mip 0 of Index 1, then Mip 1, and so on for all array slices. You can calculate the subresource index by doing ArrayIndex * NumMips + MipLevel.

Also just so you know, the DirectXTex package has a command-line tool called Texassembler that can pack a bunch of textures into a texture array and save it as DDS format, which can be convenient.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!