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

Try out libniceshade as a replacement for hlslparser #761

Open
kblaschke opened this issue Jan 31, 2024 · 0 comments
Open

Try out libniceshade as a replacement for hlslparser #761

kblaschke opened this issue Jan 31, 2024 · 0 comments
Milestone

Comments

@kblaschke
Copy link
Member

kblaschke commented Jan 31, 2024

Currently, libprojectM uses the "hlslparser" library from the game Natural Selection 2 to convert the HLSL warp and composite shader code in presets to GLSL. While this parser works well in most cases, it has not been maintained for ten years now, and thus doesn't support any modern versions of both HLSL and GLSL, which currently limits us to PS 2.0 and GLSL 3.30 syntax.

There is a recent and still-maintained library called libniceshade, which is a convenience wrapper around Microsoft DirectXShaderCompiler and SPIRV-Cross. This library supports converting shaders for use in modern 3D APIs, including OpenGL 4.3, Vulkan and Metal, and also supports modern HLSL versions as well.

We should try to integrate this library into libprojectM and use it instead of hlslparser in the MilkdropShader class. Switching to this library would also mean that we have to increase the required OpenGL version to 4.3 on desktop platforms and change the shader language verions and syntax of our built-in shaders accordingly. Mobile/embedded builds can still use OpenGL ES 3.1.

This library also requires C++17, which will make libprojectM incompatible with older systems, e.g. macOS 10.15 and earlier and some old Linux distros. At the time we will potentially release this change, these operating system versions will most probably no longer be relevant.

@kblaschke kblaschke added this to the 5.0 milestone Jan 31, 2024
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

1 participant