Jump to content
  • Advertisement
Sign in to follow this  
Gibber99

[.net] Fast volume texture load

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

Hi All, I was wondering if anyone had ideas about the fastest way to load a volume texture into the GPU. With 2D textures, I believe using a Marshall.copy is the fastest, but I don't think this is possible with 3D volumes. The data will be coming from a linear (1D) ushort array. Any comments welcome, Thanks, Gibber99

Share this post


Link to post
Share on other sites
Advertisement
Marshall.Copy cannot copy directly to the GPU. You have to lock the texture resource, copy data to it, then unlock the resource, at which point (or sometime after that point) the texture will be uploaded to the GPU. You don't really have a lot of control over it (especially from managed code, where APIs such as MDX expose specialized interfaces from their locking methods, such as GraphicsStream, which define how you copy data to the locked region of memory, and don't give you a lot of room to do things substantially differently).

If you need to do the copy/upload efficiently because you'll be doing it often, as opposed to once, you need to look into the various flags you can set during creation of the texture resource that are designed to optimize for particular usages of the resource (for example, dynamic).

3D textures are linearized data just like 2D textures. There's just more data.

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!