Hello, I've made a particle system that's running 500k+ particles at 30 fps using geometry instancing. I want to get as much particles as possible running on CPU, so I thought maybe I would multi thread it. I'm using DirectX 9 and I know it's a little iffy with multi-threading, that's why I'm asking before I even try it.
Will I benefit from multithreading particles with geometry instancing in D3D9? I know it has the multi-threaded flag... but it's known to cause problems.
Multithreading Particles with Geometry Instancing
With the multithreaded flag in D3D9 the device will just lock every time you access it, which means if multiple threads are trying to use it they will serialize. However if you have lots and lots of particles, you could so something like this:
- lock buffers on main thread
- on multiple threads, simulate particles and write updated vertex data to the pointer from the locked buffer
- unlock on main thread and issue draw call
This may give you some gains if you're spending a lot of time simulating the particles and writing the data into the vertex buffer.
- lock buffers on main thread
- on multiple threads, simulate particles and write updated vertex data to the pointer from the locked buffer
- unlock on main thread and issue draw call
This may give you some gains if you're spending a lot of time simulating the particles and writing the data into the vertex buffer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement