sergi.gonzalez
Newcomer
Hi all,
I've recently added multithreading rendering support to my engine (W32,D3D9). The tasks are organized in 3 threads (logic, load, render).
The logic thread is the main thread (this thread creates the window and the device) and runs the mainloop (and the windows procedure events).
All rendering calls are done only from the rendering thread (VSYNC is enabled).
The performance is really good in windowed modes (logic runs 15000-20000 times per second in a small scene), but when I switch to fullscreen, the logic thread greatly reduces the performance (between 30 and 120 times per second) and I don't understand why.
Should I run the rendering in the main thread and the logic in a specific thread? Before running a profile application, I would like to ask you if there is any conceptual error in this architecture
I know windows changes the execution of the threads between the available processors and I've read somewhere that the main thread should be executed in the same processor for all the execution (SetAffinityMask).
I know there are some calls that should be only done from the logic thread (as for example QueryPerformanceCounter) in order to avoid timing problems (negative delta times). Any other hint?
Thanks a lot for your time and happy coding,
s.
I've recently added multithreading rendering support to my engine (W32,D3D9). The tasks are organized in 3 threads (logic, load, render).
The logic thread is the main thread (this thread creates the window and the device) and runs the mainloop (and the windows procedure events).
All rendering calls are done only from the rendering thread (VSYNC is enabled).
The performance is really good in windowed modes (logic runs 15000-20000 times per second in a small scene), but when I switch to fullscreen, the logic thread greatly reduces the performance (between 30 and 120 times per second) and I don't understand why.
Should I run the rendering in the main thread and the logic in a specific thread? Before running a profile application, I would like to ask you if there is any conceptual error in this architecture
I know windows changes the execution of the threads between the available processors and I've read somewhere that the main thread should be executed in the same processor for all the execution (SetAffinityMask).
I know there are some calls that should be only done from the logic thread (as for example QueryPerformanceCounter) in order to avoid timing problems (negative delta times). Any other hint?
Thanks a lot for your time and happy coding,
s.