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

Can't combinate different SLANG shaders with same name of parameter. #10985

Open
ofry opened this issue Jul 8, 2020 · 3 comments
Open

Can't combinate different SLANG shaders with same name of parameter. #10985

ofry opened this issue Jul 8, 2020 · 3 comments

Comments

@ofry
Copy link

ofry commented Jul 8, 2020

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

Can't combinate different SLANG shaders with same name of parameter.

Expected behavior

Shader preset should create. And Retroarch should know which parameter goes to which shader.

Actual behavior

Failed to save such shader preset.

Steps to reproduce the bug

Described in libretro/slang-shaders#142

Bisect Results

[Try to bisect and tell us when this started happening]

Version/Commit

You can find this information under Information/System Information

Environment information

  • OS: [The operating system you're running]
  • Compiler: [In case you are running local builds]
@ofry
Copy link
Author

ofry commented Jul 8, 2020

Maybe it's related feature request: #9115

so each parameters can be applied to one shader instead of all.

@hizzlekizzle
Copy link
Contributor

This is expected behavior and not easily fixed, or in fact desirable, since it's very useful to be able to set a single parameter value that propagates throughout the shader passes.

It's good practice (but rarely actually done) for shaders to name their parameter variables something unique, like image adjustment's "ia_contrast" instead of just "contrast", since that's very likely to conflict with other shaders. OTOH, multipass shaders are not typically designed around the idea of their individual passes being mix-and-match building blocks, though many people use them that way.

@HyperspaceMadness
Copy link
Contributor

I agree with @hizzlekizzle it's often important to reuse the same parameter within multiple passes, to the proper solution to this in my opinion is to use prefixes like "ia_contrast" instead of just "contrast".

Initially I had the same thought as you @ofry but after using the system for a little bit and understanding how the parameter binding works, it seems best that it works the way it currently does especially because of reuse between passes and because the parameter list is global to the entire preset.

This also avoids the same name appearing in the parameter list for two different things which would make it unclear which is which.

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