Skip to content

Fix uniform names on struct arrays #9

@ThomasMiz

Description

@ThomasMiz

The name of the uniforms isn't properly cut.

This is because of the code at the constructor of ShaderUniform:

internal ShaderUniform(ShaderProgram owner, int uniformLoc, string name, int size, UniformType type)
{
OwnerProgram = owner;
UniformLocation = uniformLoc;
Size = size;
UniformType = type;
// The name might come as array name for array uniforms.
// We need to turn the name "arrayUniform[0]" into just "arrayUniform"
int nameIndexOfThing = name.LastIndexOf('[');
Name = nameIndexOfThing > 0 ? name.Substring(0, nameIndexOfThing) : name;

From the relevant discord conversation:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions