Jump to content
  • Advertisement
Sign in to follow this  
Alundra

Rendering threading (texture,buffer ...)

This topic is 1420 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,

Loading using threading is the modern way but that needs to be executed on a correct way.

Is it better to use uint32 handle for rendering resource (texture, buffer ....) or a better way exists ?

Thanks for the help

Share this post


Link to post
Share on other sites
Advertisement

So you need a pointer to a mapped buffer (because rendering API handles are often not valid in a different thread) and a "task description" (a structure that contains information about what asset the worker thread is to load, like a filename or such), and an eventcount or similar thing (condvar, semaphore, whatever) that allows signaling the main thread once the work is done.

 

Instead of a condvar or such, you can in the easiest case use a boolean flag that you poll once at the end of the frame, too (not the most posh way, but unless you have hundreds of things to watch or busy-wait poll all the time, that's OK).

 

That, and a job scheduler with a work queue.

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!