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

Initializing a const vec2[] in a shader's global scope gives error Expected initialization of constant #49867

Closed
ErnestoBorio opened this issue Jun 23, 2021 · 3 comments

Comments

@ErnestoBorio
Copy link

ErnestoBorio commented Jun 23, 2021

Godot version

3.2.3.stable

System information

MacOS 10.15.7 build 19H1217, AMD Radeon Pro 5300M, GLES3

Issue description

When I try to declare a global const array in a shader whose elements are vec2 or vec3, I get the error Expected initialization of constant.
It does work inside of a function, though. But not globally.

The Docs don't say anything about global const vec2[] or other types not being supported.

Steps to reproduce

Create a shader with the following content:

shader_type canvas_item; 
const vec2 a[] = {
    vec2(-1, 0),
    vec2(1, 0)
};

Minimal reproduction project

No need of a project, just using that code in a shader will do.

@Calinou
Copy link
Member

Calinou commented Jun 23, 2021

cc @Chaosus

@Chaosus
Copy link
Member

Chaosus commented Jun 24, 2021

Yeah, #32751 should be ported to 3.x.

@akien-mga
Copy link
Member

Fixed by #50889.

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

5 participants