• Advertisement
Sign in to follow this  

[dx9] Multi-threaded mesh loading

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

Im trying to implement chuncked level scene for my 3d level where nodes are loaded on a background process, but i cannot seem to make this work because
the backgroun thread (the one that loads the mesh) cannot load the mesh using D3DXLoadMeshFromX and texture for the mesh was load using D3DXCreateTextureFromFile.

the application freeze up.

ive search all over the inter net and found suggestions from other people to use D3DCREATE_MULTITHREADED, but i also found somebody that said it does not work
with the d3dx library and its slows down the application. Some tells that loading of the texture is the main cause of the problem.

so how do I proceed with this? What is the correct way of doing this?
Is there any sample source or resource for this?

Thanks,
Ruell

Share this post


Link to post
Share on other sites
Advertisement
Page the file into memory using ReadFile or what-have-you, then use D3DXCreateTextureFromMemory and friends on the main thread before you draw your scene. You'll obviously need to hand offthe data pointer, and for that I'd suggest something like Boost's circular_buffer protected by a CRITICAL_SECTION for thread safety purposes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement