libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.34k stars 1.84k forks source link

[Vita][Feature Request] Deprecate Piglet builds in favour of PVR_PSP2, bringing GLSL shaders support #14760

Open swosho opened 1 year ago

swosho commented 1 year ago

While Pigs In A Blanket works, CG shaders have to be manually adapted to even make them useable (#12414). In comparison, PVR_PSP2 natively supports GLSL shaders, and it's potentially a better performing solution as well.

doctor-amaton commented 1 month ago

This would be the best approach. Recently some of the already adapted shaders are non-functional and I'm investigating why. I'll start working on a PR that will essentially be the same as https://github.com/libretro/RetroArch/pull/11837 but for PVR_PSP2

swosho commented 1 month ago

Since opening this request, vitaGL got a runtime GLSL to CG translator, too. PVR_PSP2 should theoretically have an edge in performance, but there are two options for GLSL support now just in case.

doctor-amaton commented 1 month ago

Compilation and linking is working now, I removed all the VITA2D, VitaGL and VITAGLES defines and checks... I'm assuming this will be the "default" build and I don't think people will miss the previous non-gl version? I had to make a change to eglplatform.h to define SceUID to uint32_t, so that'll have to be it's own PR for their project...

They used Visual Studio solution files for compiling over at PVR_PSP2, which I'll have to either translate to Makefile or use the same approach we use for building let's say Xbox builds, in order to keep everything source-code only.

I was surprised building and linking worked! Right now the app crashes when I try to open it, and I'm not familiar with psp2dump files to figure out what's wrong (but I'm trying to learn as I go) if you guys want a single-core (nestopia) build I have one available for anyone to try it out. Also I should probably clean my git history and make a branch (or fork?) to show my changes.

Thanks!

doctor-amaton commented 1 month ago

I submitted a preliminary PR available on my fork repo: https://github.com/doctor-amaton/RetroArch/pull/1

This should enable everything, and it does work to a degree (the libraries are loaded) but I'm not sure what's wrong. The Vita crashes with a coredump file generated, and Vita3K shows no indication of what's wrong. Maybe I'm just not following the build process correctly to keep the VPK ready for deployment? Either way, if anyone has a properly configured Vita debugger, your help would be very much welcome!

I need to take a break from this so I can think about it for a while, I'll be back if there's any news!

doctor-amaton commented 1 month ago

I did it.

It was incredibly difficult, but I got it working! Granted, the speed is a little low, I can't disable bilinear filtering without it crashing, XMB doesn't work either yet but yeah, most of the stuff is done! image

If anyone wants to take over from here I'm cool guys like for real this has taken a toll on me

hizzlekizzle commented 1 month ago

That's great progress! Unfortunately, we won't be able adopt this upstream, due to copyrights on the files.

doctor-amaton commented 1 month ago

Do you mean the include files, or the binary libraries? Because we could compile the libraries in compile time like we do for PigsInABlanket, but for the include files we'd have to fetch the entire PVR_PSP2 project within libreto-super? I just wanted to have a working PR that people could clone and test locally 😳