-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RFC: Retroarch preset inject #16279
RFC: Retroarch preset inject #16279
Conversation
When the frontend preprocessor finds "#pragma inject_preset_code" it will search for a file named, and in the same path, as the loaded preset, but with the extension ".inc", and, if found, will "include" in the shader its content. The use case is to allow presets to change "static" shader features. This commit does not change the default behaviour of the existing shaders or presets; if a shader wants to take advantage of the feature it has to use "#pragma inject_preset_code" directive.
Hi @HyperspaceMadness , when you have some time, could you give this a quick look? Thanks. |
I think this will cause problems with the simple presets. If the user saved a new simple preset based on a preset like this, when this simple preset is loaded it would no longer do this include the .inc file it was before , because the new preset saved would have a different name and location than the original. So after saving the new simple preset and reloading it you would not get the same result as you had before you saved the new preset |
There were some dicsussion on the programming-shader discord channel.
By now I think we all agree that "Injection Syntax:2" is better |
With the new commit, the injection format is *KEY=VALUE (no more wild code injection) and it is read from the preset and from the .inc file if present. |
When the frontend preprocessor finds "#pragma inject_preset_code" it will search for a file named, and in the same path, as the loaded preset, but with the extension ".inc", and, if found, will "include" in the shader its content.
The use case is to allow presets to change "static" shader features.
This commit does not change the default behaviour of the existing shaders or presets; if a shader wants to take advantage of the feature it has to use "#pragma inject_preset_code" directive.
@hizzlekizzle @HyperspaceMadness