Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Arrays in shaders #56

Closed
SjorsVanGelderen opened this issue Aug 15, 2018 · 3 comments
Closed

Arrays in shaders #56

SjorsVanGelderen opened this issue Aug 15, 2018 · 3 comments

Comments

@SjorsVanGelderen
Copy link

The type of an array in a shader is incorrectly inferred as just the primitive type.
Example:

uniform int  palette[64];

yields

But the definition (shown above) is a:

    Shader
        {}
        { palette : Int }
        {}

Where palette should probably have been inferred as Array Int.

Combined with the inability to generate textures at runtime, this is a real obstruction when for example creating a graphics editing application.

@SjorsVanGelderen
Copy link
Author

I think the createUniformSetter function should check the size of the incoming uniform, and use the appropriate type accordingly. The biggest hurdle probably is that the GLSL parser that is being used doesn't infer the types correctly.

@w0rm
Copy link
Member

w0rm commented Aug 17, 2018

@SjorsVanGelderen Hi, this is a known limitation #36

What kind of graphics editing application do you have in mind? It would be better first to know more about the use case.

The current plan is to rewrite the glsl parser, integrate it with the Elm compiler, and only after we can think about supporting more types in shaders.

@w0rm
Copy link
Member

w0rm commented Aug 19, 2018

Closing because this is tracked in #36

@w0rm w0rm closed this as completed Aug 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants