simias / rustation

Playstation emulator in the Rust programing language
Other
552 stars 21 forks source link

OpenGL ES 2.0 (and GLSL ES) support #25

Open Hedda opened 8 years ago

Hedda commented 8 years ago

Any plans for Rustation (and rustation-libretro) renderer to support OpenGL ES 2.0 graphics rendering pipeline (and the GLSL ES shading language?)?

OpenGL ES (OpenGL for Embedded System) instead of the full OpenGL architecture is used by the hardware GPU on most embedded computers and mobile devices these days, including popular single-board-computers such as the Raspberry Pi (2) as well as most mobile phones, tablets, and Linux based Android based game consoles or media players / streamers.

http://en.wikipedia.org/wiki/OpenGL_ES

Most comming support version being the OpenGL ES 2.0 specification which was the first to feature GLSL ES 1.0 (GLSL ES shading language) support and is roughly based on OpenGL 2.0, but it eliminates most of the fixed-function rendering pipeline in favor of a programmable one in a move similar to transition from OpenGL 3.0 to 3.1

https://en.wikipedia.org/wiki/OpenGL_ES#OpenGL_ES_2.0

The OpenGL ES 3.0 specification, which was first publicly released in August 2012, is also backwards compatible with OpenGL ES 2.0 which means that any devices which state that their GPU supports the OpenGL ES 3.0 specification should also be compatible with all applications designed for OpenGL ES 2.0

simias commented 8 years ago

I can't really think of any platform that would be able to run a PSX emulator without dynarec and require OpenGL ES. Even some of the latest ARM SoCs start to support full blown OpenGL. I don't know if it's really worth investing time adding GLES compatibility.

I'm not against it either if somebody wants to add it in (having a modular architecture would be useful for adding OpenGL4/Vulkan support later, probably) but it's far away on my todo list...

ADormant commented 8 years ago

The best option in my opinion would be skipping OpenGL ES and even OpenGL4 and concentrating on Vulkan, since rustation has limited manpower. Base Vulkan API without extensions requires OpenGL4.1/ OpenGL 3.1 ES but it'll have the same API for all platforms unlike OpenGL not to mention is supposed to be much faster than opengl. Compiler is already available.

https://github.com/KhronosGroup/SPIRV-Tools https://github.com/KhronosGroup/glslang/tree/master/SPIRV https://github.com/SaschaWillems/Vulkan

https://www.khronos.org/news/archives https://www.phoronix.com/scan.php?page=search&q=SPIR-V https://www.khronos.org/registry/spir-v/papers/WhitePaper.pdf https://www.khronos.org/registry/spir-v/

Hedda commented 8 years ago

@simias Raspberry Pi 2 is very popular dispite being only OpenGL ES and it is in fact just fast enough to emulate PS1 smoothly, , at least with the pcsx_reARMed emulator ( which is an ARM optimized PCSX fork based on the PCSX-Reloaded project), see:

https://github.com/notaz/pcsx_rearmed

PCSX ReARMed is yet another PCSX fork based on the PCSX-Reloaded project, which itself contains code from PCSX, PCSX-df and PCSX-Revolution. This version is ARM architecture oriented and features MIPS->ARM recompiler by Ari64, NEON GTE code and more performance improvements. It was created for Pandora handheld, but should be usable on other devices after some code adjustments (N900, GPH Wiz/Caanoo, PlayBook versions are also available).

PCSX ReARMed features ARM NEON GPU by Exophase, that in many cases produces pixel perfect graphics at very high performance. There is also Una-i's GPU plugin from PCSX4ALL project, and traditional P.E.Op.S. one.

http://lifehacker.com/get-a-ps1-emulator-up-and-running-on-a-raspberry-pi-2-1689869367

@ADormant There are hardly any real hardware (embedded) devices out there that supports Vulkan so with only it being support you would signifigantly decrease your user-base, and less users / less popular hardware normally also means fewer interested developers. Regardless, please create a seperate issue for tracking Vulkan and dicussion.

ADormant commented 8 years ago

Rearmed uses software rendering nothing to do with opengl es.

Hedda commented 8 years ago

I just meant that Raspberry Pi 2 is fast enough to emulate PS1.

simias commented 8 years ago

I don't think the RPi is fast enough to run a PS1 without dynarec though, so I still think having a dynarec would be a necessary step before attempting to target OpenGL ES.

Maybe very high end ARM SoCs like the Tegra X1 could run a PS1 interpreter but those support the "full" OpenGL anyway.