Skip to content

Fragment shader can be silently compiled out #284

Open
@LegNeato

Description

@LegNeato

This works fine:

#[spirv(fragment)]
pub fn main_fs(
    in_color: Vec3,
    out_frag_color: &mut Vec4,
) {
    *out_frag_color = vec4(in_color.x, in_color.y, in_color.z, 1.0);
}

This silently does not output a fragment shader:

#[spirv(fragment)]
pub fn main_fs(
    in_color: Vec3,
    out_frag_color: &mut Vec4,
) {
    out_frag_color.x = in_color.x;
    out_frag_color.y = in_color.y;
    out_frag_color.z = in_color.z;
}

Rather than failing silently, it should probably be an error when an entire shader is dead code / compiled out and does not produce an artifact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions