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

uint64_t not supported as array index type in GLSL #3777

Open
buzmeg opened this issue Oct 28, 2024 · 1 comment
Open

uint64_t not supported as array index type in GLSL #3777

buzmeg opened this issue Oct 28, 2024 · 1 comment

Comments

@buzmeg
Copy link

buzmeg commented Oct 28, 2024

This seems like it may be a specification issue more than anything else.

Currently, only uint/uint32_t is supported for array indexing.

uint64_t or uint16_t throw a "p.glsl:73: error: '[]' : scalar integer expression required" error (which, to be fair, is kind of a crummy error message and doesn't explain what is going on).

@jeremy-lunarg
Copy link
Contributor

jeremy-lunarg commented Jan 7, 2025

Currently, only uint/uint32_t is supported for array indexing.

Array indices start at zero. Array elements are accessed using an expression whose type is int or
uint.

This would have to be addressed in the GLSL specification before any changes could be made here.

FWIW, you can explicitly cast the index.

    int64_t i = 0;
    values[int(i)] = 1.0f;

I'll label this issue with enhancement regarding the "crummy error message."

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

2 participants