-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Add renderer state defines to shader preprocessor #98549
Conversation
2a697ec
to
c061093
Compare
c061093
to
e021076
Compare
Could this perhaps be extended to include a couple of renderer feature support flags based on current renderer (see godotengine/godot-proposals#6207) and not just current renderer? For me instance uniform support The use case would be similar to the idea behind this PR as I understand it, as well as the logic and place to add it I think. But such feature flags would allow shaders to adapt and start using features as support is added in the engine without the developer needing to keep track of what is supported in each renderer/shader type and change their shader code. |
I think that's an interesting idea, but is way out of scope for this PR. As for instance uniforms, they are fully supported in all rendering backends now. So there should be no need for a flag |
Looks good, we should make a corresponding docs PR before merging. |
I created the docs PR: godotengine/godot-docs#10231. |
Thanks! |
Closes godotengine/godot-proposals#10764
implements 4 built-in defines to shader preprocessor:
CURRENT_RENDERER
is either0
,1
,2
(depends on current renderer)RENDERER_COMPATIBILITY
is0
RENDERER_MOBILE
is1
RENDERER_FORWARD_PLUS
is2
Using it is simple: