Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Outputting integral type from fragment shader causes Vulkan validation error #2270

Closed
@Wumpf

Description

@Wumpf

Validation layer trips off since Naga emits flat qualifier for integer outputs of fragment shader.
Note that wgpu correctly forces output to be an integer type when writing to a "true" (non-snorm/unorm) target.

Happens with a shader like this:

@fragment
fn fs_main_outline_mask(in: VertexOut) -> @location(0) vec2<u32> {
    return batch.outline_mask;
}

image
More details in this comment rerun-io/rerun#1532 (comment)

Not familiar with Naga's code, but it looks like there's a check missing here for fragment outputs https://github.com/gfx-rs/naga/blob/master/src/back/spv/writer.rs#L1415

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: back-endOutputs of shader conversionkind: bugSomething isn't workinglang: SPIR-VBinary SPIR-V input and output

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions