Sign in to follow this  

Rendering threading (texture,buffer ...)

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

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

This topic is 1108 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this