Skip to content

sampler2Ds must be uniform #496

@laurentlb

Description

@laurentlb

This is valid GLSL:

uniform sampler2D samp;
vec3 dof(sampler2D tex) {
    return texture(tex,vec2(0)).rgb;
}

// ...
dof(samp);

This is not valid:

uniform sampler2D samp;
vec3 dof() {
    sampler2D tex = samp;
    return texture(tex,vec2(0)).rgb;
}

When inlining function parameters, Shader Minifier might introduce a sampler2D variable which is not allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions