D3DPOOL_SCRATCH and threading

Started by
2 comments, last by miloszmaki 11 years ago

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.

Advertisement

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.

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...

Any ideas?

This topic is closed to new replies.

Advertisement