Uniform migration

More
3 years 5 months ago - 3 years 5 months ago #1 by seri14 Uniform migration was created by seri14
I do not know if it is possible.
This idea is make backward compatibility for effect/preset files.
Add some features to ReShade core.
  1. Add loaded value to constants if uniform value is obsoleted or it has readonly annotation.
    (Maybe it requires to everytime reload the effects if a preset has obsoleted values.)
  2. Use migrate_from annotation when load value if expression has an obsoleted uniform and it loaded from a preset.
  3. Delete obsoleted value from preset's key/value pairs after loading effects.
// Suggestion 1
uniform int OldName <
    ui_min = 1; ui_max = 8;
    readonly = true;
> = 1;
// Suggestion 2
obsoleted uniform int OldName <
    ui_min = 1; ui_max = 8;
> = 1;
uniform float NewName <
    ui_min = 0.125; ui_max = 1.0;
#ifdef OldName
    migrate_from = (float(OldName) / 8);
#endif
> = 0.125;
Last edit: 3 years 5 months ago by seri14.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #2 by seri14 Replied by seri14 on topic Uniform migration
Partially implemented this feature.
github.com/seri14/reshade/commit/cb0eac7...37fa102ce59623fd1bb7

Maybe it is not required big changes.

After this commit, I will committing to experimental-uniformmigration branch.
github.com/seri14/reshade/tree/experimental-uniformmigration
Last edit: 3 years 5 months ago by seri14.

Please Log in or Create an account to join the conversation.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.