rrath / Wire3D

3D engine for Wii and PC (C++)
GNU Lesser General Public License v3.0
40 stars 6 forks source link

Wii hangs when attempting to finish render cycle #3

Open MyloWhylo opened 2 years ago

MyloWhylo commented 2 years ago

I'm new to this, so I've based my code off of Demo.cpp. I managed to make something that almost works, but my Wii always hard freezes at the last steps in the render loop (GetRenderer()->PostDraw(); and GetRenderer()->DisplayBackBuffer();). Additionally, when I try to run it in Dolphin, it spits out a "GFX FIFO: UNKNOWN OPCODE (0x07)" error, but actually seems to work if I dismiss it. When building through Visual Studio, it also works perfectly fine in DirectX under Windows. If there's anything that you can do to point me in the correct direction, that'd be great. Thanks!

rrath commented 2 years ago

Sorry, I have never used the Dolphin emulator. Are you sure that you are not running out of memory on the Wii? (Because with its limited amount of memory, this is a problem that people run into often.)

MyloWhylo commented 2 years ago

I don't think it's running out of memory, the overlay on windows says it's using ~4M ish of VRAM. I'll try building a debug release here and seeing if that makes any difference. Lastly, could triangle count be a problem? It's about 67k triangles all told I think.

MyloWhylo commented 2 years ago

Here's what the statistics look like under windows, I don't see any problems with memory that would stop it from running on the Wii. I could be missing something though.

image

I added some print statements to the wii debug version, and it appears to be hanging sometime in the DisplayBackBuffer(); function.

MyloWhylo commented 2 years ago

After doing some more testing, it stalls at the GXDrawDone(); command in WireGXRenderer.cpp like it should, but either the GX isn't doing anything or something's messed up with it, because it never un-stalls (?). Any ideas would be appreciated.

rrath commented 2 years ago

Sorry, I have been out of touch with Wii development for years, so neither GX documentation nor the toolchain is at my disposal anymore. I am also not aware of how the devkitpro environment as changed over the years. Do all the samples (including Demo and Game) work for you on the Wii hardware?

Maybe the display list for the mesh is ill-formed somehow, causing the pipeline to stall. The only thing I can recommend is to revert to a working state, then add changes step by step to isolate the trigger for the stall, then deconstruct the code and submitted data of that trigger.

h3xstream commented 2 years ago

@rrath All samples run on hardware and Dolphin emulator except Demo and Sample. I installed devkit pro with the installer version 3.0.3. And I tested the compiled DOL with Dolphin 5.0-16322.

Anybody as a "stable" version of devkitpro known to compile all Wire3d samples?

rrath commented 2 years ago

@h3xstream Demo and Game are different from the other Samples because they load data at runtime and silently fail if the data is not at the expected location.