devkitPro / citro3d

Homebrew PICA200 GPU wrapper library for Nintendo 3DS
zlib License
244 stars 34 forks source link

How to enable C3D_FRAME_SYNCDRAW while still keeping 60fps #59

Closed SeleDreams closed 2 years ago

SeleDreams commented 2 years ago

Hi, I am posting here because I've been maintaining the godot port for 3ds and I am right now having some issues basically whenever C3D_FRAME_SYNCDRAW is used, it becomes impossible to reach more than 30fps, even on new 3ds with osSetSpeedupEnable(true); it's a problem as technically the games can reach the 60 fps without even screen tearing on new 3ds, but I still need vsync in case an O3ds is playing

it happens even on very lightweight scenes. I also tried to set C3D_FrameRate(60); but it didn't change much

fincs commented 2 years ago

C3D_FRAME_SYNCDRAW does not mean "vsync" - in fact there is no way to disable vsync at all. This flag simply exists in order to support C3D_FrameRate, which provides throttling (i.e. changing the maximum FPS that the rendering logic is allowed to output). Even if you take this flag out, you will be bound by other things such as the speed of the CPU code, the speed of the GPU rendering, and the delay between a renderbuffer being transferred and the next vertical sync event during which the framebuffers will be swapped. I'm thinking you have either a CPU or a GPU bottleneck.