Sign in to follow this  
miloszmaki

D3DPOOL_SCRATCH and threading

Recommended Posts

Hi,

 

I know it's not safe to create/lock D3D resources on a different thread. But I'm just curious if it's ok to do so with resources in D3DPOOL_SCRATCH ? It seems to work from what I've tested so far...

 

Example: I'm creating a texture in D3DPOOL_SCRATCH on a separate thread and locking it. Then I'm using the pixel data to perform some calculations and finally unlock and release the texture. I'm using D3DXCreateTextureFromFileEx for convenience and I'm not sure if it's safe here.

 

Any help of an expert would be really appreciated.

Share this post


Link to post
Share on other sites

If I had a lot of things to load, I would rather make a safe single threaded scheduler that load one resource per render and use placeholders until they are loaded. The threadsafe optimizations in Visual C++ are quite good anyway and can give more speed gain with functional programming.

Share this post


Link to post
Share on other sites

single threaded scheduler that load one resource per render

What do you mean? One resource per frame on the main thread ? I think it would cause long pauses which is unacceptable.

Anyway, the topic's question is still open...

Share this post


Link to post
Share on other sites

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