dracc / NevolutionX

Original Xbox dashboard created with nxdk
MIT License
123 stars 21 forks source link

rendering: Adds SDL_gpu based rendering. #133

Open abaire opened 3 years ago

abaire commented 3 years ago

Fixes #110

This leverages fgsfdsfgs/pbgl and grimfang4/sdl-gpu to add HW acceleration to SDL (at least the parts that are used by NevolutionX).

Both projects needed some patching:

At the moment I've forked both and added dependencies on my forks. If this PR looks good I can try to get them upstreamed (I think the pbgl change is just a bugfix, but I suspect we'd need to maintain a fork of SDL_gpu).

I've also made it disable-able via FC_USE_SDL_GPU #ifdefs, but if this approach looks good I'd suggest removing them, particularly as I think SDL_gpu should work natively on Linux so we could add it to the CMake target and be accelerated everywhere.

I think this will also unblock more asynchronous tasks (e.g., the threaded XBE scanning) since the CPU usage should be dramatically lower (it's consistently at 60fps on my XBOX).

dracc commented 3 years ago

Interesting stuff! There's also XboxDev/nxdk-sdl#37 for a less "intrusive" fix, not sure if we're interested? Less dependencies feels like a good thing IMO.

abaire commented 3 years ago

Definitely agree that less deps would be better; I saw that PR when I was initially looking for the most straightforward solution and decided it looked like it was not going to be merged (given that it's nearly a year old with the last comment 6 months ago). The comment in XboxDev/nxdk/issues/480 reinforces my assumption that it's not likely to be merged.

My gut sense is that it'd be easier to maintain a ~permanent fork of SDL_gpu/pbgl (where NeX probably won't need further changes) than to depend on a patched version of the nxdk (which hopefully will be updated more often, e.g., with improvements to the persistent framebuffer and XLaunchXBE) where someone would likely have to continually rebase the patch.

In any case, if we do need to depend on forked deps, it might be worth creating an organization for the project as well so they can all be grouped in one place.