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

Uniform block array size limitations #1978

Open
Lucky4Luuk opened this issue Dec 24, 2021 · 2 comments
Open

Uniform block array size limitations #1978

Lucky4Luuk opened this issue Dec 24, 2021 · 2 comments

Comments

@Lucky4Luuk
Copy link

Hey everyone, I was looking into using large arrays in a uniform block (for some voxel data), but I'm running into an issue.
I'm trying to implement a block containing an array [u8; 64 * 64 * 64], but this is not yet implemented as a trait.
Is it possible for the UniformBlock trait to be implemented for arbitrary array sizes, or is this not feasible?

@fayalalebrun
Copy link
Contributor

Have you considered using a 3d texture instead? I believe that would be much more performant, since pushing uniforms is not the fastest operation. And you would need to push a huge uniform with every draw call.

@avl
Copy link
Contributor

avl commented May 7, 2024

You can use a UniformBuffer instead. I'm not sure you can use datatype u8, but you could use a u32, and then, if needed, unpack the u32's into u8s in the glsl-shader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants