Uniform migration

More
1 year 4 months ago - 1 year 4 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: 1 year 4 months ago by seri14.

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

More
1 year 4 months ago - 1 year 4 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: 1 year 4 months ago by seri14.

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