Posts: 17
Threads: 0
Joined: Dec 2013
Reputation:
1
This might seem like a dumb question since I haven't look at the code (I wouldn't know where to begin), so please bare with me
Isn't it really inefficient to have that interdependency between the EE/Core thread and the GS thread? Almost completely defeats the purpose of multi-threading
Why does the EE thread need to wait for the GS thread? Couldn't the EE thread continue to just stream data without needing a response from the GS? If the GS thread is out of sync with the EE, the worst that could happen is that you lose a few frames right? Seems like a small price for a potentially huge performance improvement
Posts: 20.318
Threads: 405
Joined: Aug 2005
Reputation:
551
Location: England
You wouldnt just lose frames, youd get black frames. Also the ee core writes and reads gs registers, if the information is wrong you could get bad graphics or games freezing completely depending on direction.
Posts: 17
Threads: 0
Joined: Dec 2013
Reputation:
1
Why write directly to/from the registers though? In what situation would the "information" be wrong? I figured you could have something like this:
Have 3 blocks of shared memory
EE thread:
1. Do its stuff
2. Write data to block 1 (with timestamp at end of block)
3. Do its stuff
4. Write new data to block 2 (with timestamp at end of block)
5. Do its stuff
6. Write new data to block 3 (with timestamp at end of block)
7. Return to step 1
GS thread:
1. Load data from block 1 into registers
2. Render all the data/ all the other functionality
3. Check timestamp on each block/verify contents of block
4. Begin from step 1 with the block that has the soonest timestamp after the last one rendered (or re-render the same block if there is no new block)
This would mean that EE thread can continue to work without being interrupted by the GS thread, and the GS thread will always have something to render (sometimes will be the same data) so instead of getting black screens, you just get the same frame again. Even if this whole process is significantly less streamlined, I still feel that it would offer better performance than having thread interdependency
Posts: 157
Threads: 8
Joined: Oct 2012
12-19-2013, 08:22 PM
(This post was last modified: 12-19-2013, 08:23 PM by darkwraith007.)
If anyone is a wizard enough to rewrite the GSDX plugin to fix long-standing bugs/glitches/issues with it, we would all love you forever <3
That would do way more than rewriting the multithreading for the main PCSX2 program.
Posts: 17
Threads: 0
Joined: Dec 2013
Reputation:
1
12-23-2013, 07:53 AM
(This post was last modified: 12-23-2013, 07:55 AM by HTB123.)
actually that's something I wanted to look into as well >_>
specifically, the extreme slow down that occurs when rendering 2d stuff in hardware mode - what exactly causes those issues?
happens a lot in game menus as well as in games like DMC and Shadow Hearts where there's 2d backgrounds and stuff