Welcome! Log In Create A New Profile

Advanced

Help with double GP FIFO buffers

Posted by TheCodingBrony 
Help with double GP FIFO buffers
October 25, 2014 10:07AM
I'm working on a in-house graphics library as none of the existing libraries suit my needs and I want it to be highly optimized so I can get the most out of what the Wii can handle for my future projects.

Currently, its stuck with the standard 'Immediate-mode' FIFO protocol when sending commands to the GP and I believe that I could get some performance boost by having 2 FIFO buffers instead of 1 when pushing the GP to its peak as the CPU can continue to fill one buffer while the GP processes the other instead of having the CPU wait for the GP to finish.

Basically, I wanted to send commands to the GP like this:
1. Allocate 2 FIFO buffers on init with FIFO[0] attached to the CPU and FIFO[1] attached to the GP.
2. Fill FIFO[0] with GP commands (while GP is idle or is processing FIFO[1]).
3. Wait for GP to finish processing commands in FIFO[1].
4. Switch framebuffers.
5. Attach FIFO[0] to GP and FIFO[1] to CPU.
6. Fill FIFO[1] with GP commands (while GP is processing FIFO[0]).
7. Wait for GP to finish processing commands in FIFO[0].
8. Switch framebuffers.
9. Attach FIFO[1] to GP and FIFO[0] to CPU.
10. Repeat step 2.

According to the libogc docs, its possible to setup a multi-buffered GP FIFO protocol but I don't know where to start due to how vague and discrete the documentation is... Example code or any helpful advice would be greatly appreciated.
Re: Help with double GP FIFO buffers
October 26, 2014 12:09PM
I wouldn't recommend it, the relevant functions in libogc are a bit broken (nobody noticed because nobody uses them).
Re: Help with double GP FIFO buffers
October 27, 2014 01:06AM
Really? If that's the case, well... crap.

I don't think that will ever be fixed as WinterMute (and possibly everyone else) doesn't seem to give a crap about devKitPPC anymore judging from what I've read and seen so far... What a pity and I have a feeling that I'm probably the only one here who still wants to make homebrew games for the Wii regardless of the issues and limitations of the sdk. Though that won't stop me from pushing out something impressive soon despite the community being pretty much dead nowadays.
Re: Help with double GP FIFO buffers
October 28, 2014 04:59AM
Using multiple FIFOs isn't really necessary anyway, doubling the size of your primary FIFO would achieve more-or-less the same thing (if you were actually getting stalls due to FIFO overflow, which is unlikely in the first place).
Re: Help with double GP FIFO buffers
October 30, 2014 03:41AM
Well I'm still here somewhat. I don't mess around with the internals of the wii but you can email me regarding the stuff have already done. [www.wiibrew.org] I have yet to make a 8 player game but I will do it at some point!
Sorry, only registered users may post in this forum.

Click here to login