Skip to content

Possible incorrect handling of texture arrays in GLSL #4537

Open
@spencerkohan

Description

@spencerkohan

I'm using naga to create a module out of the following frgment shader:

            #version 450

            layout(location=2) in  vec2 uv;

            layout(set = 0, binding = 0) uniform texture2D glyphTextures[256];
            layout(set = 0, binding = 1) uniform sampler glyphSampler;

            void main() {
                vec4 tex = texture(
                    sampler2D(glyphTextures[0], glyphSampler),
                    uv
                );

                f_color = tex;
            }

If I inspect the resulting module, the type of the global variable named "glyphTexutures" is:

Type {
    name: None,
    inner: Array {
        base: [4],
        size: Constant(
            [5],
        ),
        stride: 0,
    },
}

According to the documentation, it looks like my type inner should be TypeInner::BindingArray rather than Array, right?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions