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

Add Vulkan/Metal rendering support #683

Open
kblaschke opened this issue Jan 7, 2023 · 6 comments
Open

Add Vulkan/Metal rendering support #683

kblaschke opened this issue Jan 7, 2023 · 6 comments
Milestone

Comments

@kblaschke
Copy link
Member

kblaschke commented Jan 7, 2023

Currently, libprojectM only supports rendering using OpenGL 3 and GLES 2. Since OpenGL is generally considered a deprecated API and Vulkan/Metal has a better API to perform multi-threaded rendering and shader compilation, it will be a good step forward to add support for these next-gen rendering APIs.

Any API-specific initialization calls, e.g. providing the required Vulkan structs, should be implemented in a specific header, e.g. libprojectM/renderer_vulkan.h. Adding support for multiple rendering backends will also require a major refactoring of the library, abstracting rendering-related calls. projectM only renders a few primitives (triangle fans/strips, line strips and points) and uses vertex and fragment shader programs, so there's not much to implement.

Line rendering should be improved beforehand, as covered by issue #682.

Vulkan support should be introduced together with the EGL migration covered by issue #681.

@olilarkin
Copy link

You could also consider sticking to GLES and using libangle to translate it to Metal (could even be used on windows so it works on top of direct 3D etc)

@olilarkin
Copy link

Just thought I'd mention it since I've had some recent success with the metal port of angle

@kblaschke
Copy link
Member Author

GLES is very limited, and also doesn't allow proper multithreading. Using Vulkan/Metal directly would give some performance improvements, especially when switching presets, as shaders and other resources could be set up in a dedicated parallel thread instead of the render thread, which currently causes hiccups.

@kblaschke kblaschke added this to the 5.0 milestone Feb 16, 2023
@jherico
Copy link

jherico commented Mar 11, 2024

is any work being done on this currently or is it up for grabs?

@revmischa
Copy link
Collaborator

is any work being done on this currently or is it up for grabs?

No work is being done, please feel free!

@kblaschke
Copy link
Member Author

kblaschke commented Mar 14, 2024

is any work being done on this currently or is it up for grabs?

Anyone who wants to do this, please go ahead!

If you're implementing it, please keep OpenGL/GLES support in projectM. While OpenGL is deprecated, it's still the only way to get projectM running on some devices and systems, one of them being WebGL/Emscripten.

Also note libprojectM is a library, so all render system initialization should not be part of the library, but done in the outside application. Whatever is needed to render output (e.g. the Vulkan device & swapchain information) needs to be passed in via the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants