devkitPro/citro3d

Missing triangles when using the renderqueue system

RSDuck opened this issue · 2 comments

I experienced a problem with the render queue system, a few triangles won't render(only a two or three), which one depend on the view angle.
By flushing the whole linear heap it reduced the artefact. When 3D is disabled it reduces the artefact, so it has something with the amount of draw calls and/or the amount triangles(Also when 3D is enabled the triangles flicker, because won't get drawn in only one frame).

Finally by moving from the render queue system to manually using render buffers everything worked as it should.

You can find the relevant code here: https://github.com/RSDuck/Craftus3DS/blob/master/source/craftus/render/render.c(look at the history to see how it was before)

fincs commented

In theory it shouldn't be necessary to call GX_FlushCacheRegions manually, since citro3d by default flushes the entire linear heap before issuing the render command. It would be good if you could join us at EFnet #3dsdev to discuss and debug this. I'm very interested in finding and debugging issues in the renderqueue system.

EDIT: Can you try printing the value of C3D_GetCmdBufUsage with and without renderqueue?

Ok, lesson learned: only modify vertex data within C3D_FrameBegin and C3D_FrameEnd