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

Update gdshader syntax #397

Merged
merged 2 commits into from
Aug 6, 2022

Conversation

DaelonSuzuka
Copy link
Collaborator

@DaelonSuzuka DaelonSuzuka commented Jul 22, 2022

Pull additional gdshader syntax improvements from @AlfishSoftware's work

The shader syntax looks good to me, but I'm currently trying to solicit feedback on the gdshader example file.

@Calinou
Copy link
Member

Calinou commented Jul 22, 2022

but I'm currently trying to solicit feedback on the gdshader example file.

I think it's pretty complete now. That reminds me, I should figure out adding .gdshader syntax highlighting on GitHub (and updating the GDScript syntax highlighter used on GitHub too).

@DaelonSuzuka
Copy link
Collaborator Author

DaelonSuzuka commented Jul 22, 2022

That reminds me, I should figure out adding .gdshader syntax highlighting on GitHub (and updating the GDScript syntax highlighter used on GitHub too).

Wait, we can do that?

@DaelonSuzuka DaelonSuzuka reopened this Jul 22, 2022
@DaelonSuzuka DaelonSuzuka marked this pull request as ready for review July 22, 2022 22:37
@Calinou
Copy link
Member

Calinou commented Jul 23, 2022

Wait, we can do that?

Yes, GitHub uses a public repository as a base for its syntax highlighting: https://github.com/github/linguist/blob/master/CONTRIBUTING.md

@AlfishSoftware
Copy link

AlfishSoftware commented Jul 25, 2022

I'm currently trying to solicit feedback on the gdshader example file

I don't know if the purpose of that file is to be more like an "exhaustive" syntax test, but ...
in case it is, taking a look I didn't find tests involving:

  • arrays (e.g. array constructors, array fields in structs (A[2] b; A b[2];), etc), both declaration and initialization
  • precision modifiers (including in array initialization and struct fields)
  • in, out modifiers
  • const definitions
  • swizzling (e.g. .argb, .stpq, .wzy, etc); methods (I think .length() is the only one?)
  • some constructs, like switch case/default, break/continue, do while, discard
  • many syntax variations for numeric literals (uint, float)
  • all possible operators (e.g. && -=, etc)

I have already tested these things, so maybe my files are pointless, but, if you want, you can check one of my test files with things from the docs, to catch some you might be missing. Like I said before, I lost my other test file, which started here. There's also one with some variations of float literal syntax in this issue.

If the purpose of the file is something else, just ignore what I said.

@DaelonSuzuka
Copy link
Collaborator Author

DaelonSuzuka commented Aug 5, 2022

I don't know if the purpose of that file is to be more like an "exhaustive" syntax test, but ...
in case it is, taking a look I didn't find tests involving:

Yeah, that's exactly what it is.

All fantastic suggestions, thanks for the write-up. I'll have to study your test files a bit and come back to updating mine.

@Calinou I'll expand the gdshader test file later, so this PR is ready as far as I'm concerned.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton!

@Calinou Calinou merged commit 6dc5a82 into godotengine:master Aug 6, 2022
@DaelonSuzuka DaelonSuzuka deleted the gdshader-syntax-update branch August 22, 2022 22:14
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.

3 participants