Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] GXM driver for hardware acceleration on PS Vita #9015

Open
kwyxz opened this issue Jun 24, 2019 · 27 comments

Comments

Projects
None yet
@kwyxz
Copy link
Contributor

commented Jun 24, 2019

As of today, RetroArch / Libretro on the PS Vita is using software rendering. This is preventing cores from using the full potential of the device in terms of, of course, 3D emulation, but hardware acceleration could also do wonders for 2D display.

Examples of GXM code found here : https://github.com/xerpi/gxmfun
A little bit more context here : https://www.reddit.com/r/vitahacks/comments/5pbdgo/having_fun_with_libgxm_psvitas_3d_graphics_api/

@kwyxz

This comment has been minimized.

@kwyxz kwyxz changed the title [Feature request] use GXM for hardware acceleration on PS Vita [Feature request] GXM driver for hardware acceleration on PS Vita Jun 24, 2019

@Nube79

This comment has been minimized.

Copy link

commented Jun 27, 2019

finally we will have shaders support in PS Vita with this feature?
👍

@Rinnegatamante

This comment has been minimized.

Copy link

commented Jun 30, 2019

@Nube79 if someone is willing to spend thousands of hours of work to write a runtime shader compiler (after reversing GPU ISA since it's not a "standard" well documented GPU) and then proceed to translate every single GL call in GL enabled cores to GXM relatives just for few bucks, then yep.

Spoiler: Won't happen.

@Nube79

This comment has been minimized.

Copy link

commented Jun 30, 2019

@Nube79 if someone is willing to spend thousands of hours of work to write a runtime shader compiler (after reversing GPU ISA since it's not a "standard" well documented GPU) and then proceed to translate every single GL call in GL enabled cores to GXM relatives just for few bucks, then yep.

Spoiler: Won't happen.

I think Libretro/Retroarch is a bigger project than ScummVM.
ScummVM has the shaders working for PS Vita, is GNU Open Source, it can be a reference guide to get it ready on retroarch.

@twinaphex

This comment has been minimized.

Copy link
Member

commented Jun 30, 2019

@Rinnegatamante hi there, @frangarcj will be taking on this bounty. I believe he's still orientating his way around it. I know there's some problematic things along the way, such as Cg instead of GLSL, and so on. The runtime compiler is not strictly necessary, it would be possible to just compile them beforehand, it would just be less convenient but it could be done just for the Vita port. At least there is nothing in RetroArch's source code preventing shader binaries from being loadable. I admittedly know nothing about the Vita side though.

He also will be bringing GL over to RetroArch Vita in addition to this libgxm hardware context.

@Rinnegatamante

This comment has been minimized.

Copy link

commented Jun 30, 2019

@twinaphex Runtime shader compiler not being strictly necessary means you would have to have precompiled binaries of every single possible shader a core requires (which would translate in having a mess in terms of code, for reference look at: https://github.com/Rinnegatamante/vitaGL/blob/master/source/vitaGL.c#L219-L581 (And here we're talking just about some very simple shader to emulate GL fixed function pipeline (eg: https://github.com/Rinnegatamante/vitaGL/blob/master/shaders/texture2d_v.cg +https://github.com/Rinnegatamante/vitaGL/blob/master/shaders/texture2d_f.cg ).

"Bringing GL over to RetroArch Vita". Vita has no native GL support.

@fr500

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2019

@Nube79

This comment has been minimized.

Copy link

commented Jun 30, 2019

What people are looking for are postporcessing, it is not necessary to have many shaders, with a scale2x or those that have ScummVM that are already adapted for Vita, it would be enough.

https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms#/media/File:Pixel-Art_Scaling_Comparison.png

I don't know what is the limit on vita GPU, there are many shader algorithms that are very great.

@kwyxz

This comment has been minimized.

Copy link
Contributor Author

commented Jun 30, 2019

Uh no the purpose of this issue+bounty is more about hw accelerated 3d for the cores that would benefit from it (mupen64, pcsx, etc) than merely post processing shaders...

@Nube79

This comment has been minimized.

Copy link

commented Jun 30, 2019

finally we will have shaders support in PS Vita with this feature?
👍

Sure @kwyxz , I know, but my question is about your comment:

"... but hardware acceleration could also do wonders for 2D display."

@frangarcj

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

Let's clarify things:

It's better to split the bounty in two:

  1. GXM drivers for retroarch. This will allow for a better UI, (optional runtime) shader support and hw context available for cores. Maybe this will include a native gxm driver and a VitaGL one (at least one of them).

  2. A core with 3D support. e.g. Get mupen64 or pcsx_rearmed with 3D HW acceleration.

In order to do 2, you need first to do 1.

Also for cores lilke mupen64, there's no dynarec support atm.

Would you agree to leave current money / bounty to the first one?

@twinaphex

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

@frangarcj I am fine with that proposal. Lets hear from the bounty backers if they agree so that the work for this bounty is clear.

@kwyxz

This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2019

@Defkyle

This comment has been minimized.

Copy link

commented Jul 1, 2019

1.GXM drivers for retroarch. This will allow for a better UI, (optional runtime) shader support and hw context available for cores. Maybe this will include a native gxm driver and a VitaGL one (at least one of them).

This is actually why I backed this bounty. If this can improve overall UI/ playlist performance, then count me in.

@Nube79

This comment has been minimized.

Copy link

commented Jul 1, 2019

Yeah! @Defkyle the playlist screenshot performance and the shader support for 2D cores is a great first goal.
And the hardware acceleration for the 3D cores sounds good for a second stage.

PD: When you get down on a large playlist, this comes terrible slow.

@frangarcj frangarcj self-assigned this Jul 2, 2019

@frangarcj

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

Then let's start working on that ;)

@AbFarid

This comment has been minimized.

Copy link

commented Jul 3, 2019

With my measly input of $25, I'm not sure I get a vote, but aye.
If this enables smoother scrolling through playlists, double aye.

@undeadindustries

This comment has been minimized.

Copy link

commented Jul 8, 2019

Just added $30 to the bounty.

@Cpasjuste

This comment has been minimized.

Copy link

commented Jul 9, 2019

Hi guys!

I'm not sure to understand the first part of the bounty. I did take a quick look to retroarch sources and the vita port does use hardware rendering (via vita2d). It just miss some shaders, @frangarcj already worked on that in the past, and I did implement in scummvm and pfba. But people seems to report it use software rendering, am I missing something? (Well, probably :)).

@Rinnegatamante

This comment has been minimized.

Copy link

commented Jul 10, 2019

vita2d is used only to draw the final framebuffer. This means RetroArch is indeed soft rendered.

@frangarcj

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@Cpasjuste optimized gxm driver (not based on vita2d) with shader support and runtime shader compiler. It will be also exposed to cores.

PD: Glad to hear from you

@Cpasjuste

This comment has been minimized.

Copy link

commented Jul 11, 2019

Hi @frangarcj, same here, happy to see you :)

Else, "you're lucky", i have so much projects going on, but if not (and if you were not interested), i would do it 😄 Good luck with that, i'm 100% sure you'll succeed.

See you!

@JCStrainer

This comment has been minimized.

Copy link

commented Jul 12, 2019

Let's clarify things:

It's better to split the bounty in two:

  1. GXM drivers for retroarch. This will allow for a better UI, (optional runtime) shader support and hw context available for cores. Maybe this will include a native gxm driver and a VitaGL one (at least one of them).
  2. A core with 3D support. e.g. Get mupen64 or pcsx_rearmed with 3D HW acceleration.

In order to do 2, you need first to do 1.

Also for cores lilke mupen64, there's no dynarec support atm.

Would you agree to leave current money / bounty to the first one?

As we have now doubled the amount, would it be acceptable to split the money between the two tasks? I'm also fine leaving more money for the second task and giving the current amount for the first task, it's just great that progress is being made for the Vita.

@billy-acuna

This comment has been minimized.

Copy link

commented Jul 12, 2019

@frangarcj pcsx rearmed does not feature hw rendering. Are you implying you are willing to writte one? If so that would be great as many other platforms will be benefied.

@frangarcj

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@billy-acuna I'm thinking about a gxm specific one so maybe not directly useful for other platforms

@frangarcj

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

Some status report:

  • I have made good progress and I got runtime shader compiler working. About distribution of the suprx, a tool is needed for the user to install it.
  • I have updated vita2d driver with latest one
  • I'm implementing scissor support for the menu driver
  • I'm taking a look at ozone and menu widgets (it is very uggly on vita)

I think the final driver will be based on vita2d but exposing the context to the cores. Of course I will add shader pipelines to it

@Nube79

This comment has been minimized.

Copy link

commented Jul 17, 2019

I love you @frangarcj
When will we be able to test a partial alpha on nightly compilations?
https://buildbot.libretro.com/nightly/playstation/vita/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.