citro3d icon indicating copy to clipboard operation
citro3d copied to clipboard

[Hardware Quirk] GPU hangs if one shader program has a geo component and the other doesn't

Open TheGag96 opened this issue 4 years ago • 3 comments

In working this demo using two different shader programs to draw a scene, I was getting a hard GPU hang on real hardware (and not on Citra). I narrowed the cause down to one shader I was using having a geo part as well as a vertex part and the other one just having a vertex part. If you flip-flopped which shader you used every frame, there'd be no issue.

Here's a demonstration based on the composite_scene example. This exhibits the same behavior I was running into. However, I just went and made another one based on the lenny example and this one doesn't seem to hang. Is something done in citro2d the culprit? Or is the lenny-based example not hanging because the shader programs are basically the same aside from the geo part?

I was told to submit an issue here. Hopefully this helps out!

TheGag96 avatar Oct 14 '21 03:10 TheGag96

Edit: turns out I had the same exact issue. My workaround was to give dummy geo components to all shaders; even if they didn't need one. This not only boosted performance, but prevented those pesky hangs.

carrotcreamsoup avatar Feb 01 '22 04:02 carrotcreamsoup

Yeah, I ended up doing the same thing... And wow, boosted performance? How's that?

TheGag96 avatar Feb 02 '22 23:02 TheGag96

Looks like switching between shaders with and without geo components really put a strain on my system. The same code with the dummy geo shader for triangles had a big improvement in performance, but that might be because of the insane amount of shader changes I am doing!

carrotcreamsoup avatar Feb 03 '22 18:02 carrotcreamsoup