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

Use "literal" term where appropriate in shader language internals and in error messages. #101974

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxpiepenbrink
Copy link

@maxpiepenbrink maxpiepenbrink commented Jan 24, 2025

Previously we were using "constant" to describe all instances of immutable declarations, whether that was an inline literal or an actual declared constant variable. This lack of disambiguation also resulted in some misleading error messages, ie: "expected integer constant" where only a literal is actually valid (and passing an actual constant like PI would fail with that exact error message).

This also improves a few error messages that only stated the expectation of an integer constant when it was more appropriate to say an integer OR float literal. This was originally brought up here: #101926

If this gets a green light I'll also take a stab at shoring up the docs to see if there's improvements to be made around "constant" vs "literal".

Before:
Godot_v4 4-beta1_win64_Cq0W3xbX6Z

After:
godot windows editor dev x86_64_MLxbNq5qr4

Previously we were using "constant" to describe all
instances of immutable declarations, whether that was
an inline literal or an actual declared constant variable.

This lack of disambiguation also resulted in some misleading
error messages, ie: "expected integer constant" where only
a literal is actually valid (and passing an actual constant
like PI would fail with that exact error message).

This also improves a few error messages that only stated
the expectation of an integer literal when it was more appropriate
to say an integer OR float literal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants