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

Allow declare the shader arrays with a size defined before identifier #53527

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Oct 7, 2021

This is mostly syntax sugar, but it's possible (in GLSL) to declare an array with the size defined before identifier eg:
int[2] arr; instead of int arr[2]; This PR makes it possible. To decrease code repetition - I've pushed the index parsing to a separate function.

Note: It's already possible to do for varying/uniform arrays, this PR is for local arrays in functions and struct members.

@Chaosus Chaosus requested a review from a team as a code owner October 7, 2021 13:54
@Chaosus Chaosus added this to the 4.0 milestone Oct 7, 2021
@Chaosus Chaosus force-pushed the shader_array branch 8 times, most recently from acb0694 to 852e445 Compare October 8, 2021 07:15
@akien-mga akien-mga merged commit 96767c1 into godotengine:master Oct 8, 2021
@akien-mga
Copy link
Member

Thanks!

@Chaosus Chaosus deleted the shader_array branch October 8, 2021 11:15
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