Skip to content

maxInterStageShaderVariables should be decremented for _each_ fragment input built-in, not just once #4538

@ErichDonGubler

Description

@ErichDonGubler

In this following inter-stage interface validation routine in the WebGPU spec. (link, emphasis mine):

validating inter-stage interfaces(device, descriptor)

Device timeline steps:

  1. If descriptor.fragment is provided:

    1. Let maxFragmentShaderInputVariables be device.limits.maxInterStageShaderVariables.

    2. For each of the Inter-Stage Builtins that are an input of descriptor.fragment:

      1. Decrement maxFragmentShaderInputVariables by 1.

I interpret this to mean: for each built-in, decrement once per built-in found. However, the webgpu:api,validation,capability_checks,limits,maxInterStageShaderVariables:createRenderPipeline,at_over:* test path in CTS only decrements the maximum once if any of them are set:

const maxFragmentInputVariables =
device.limits.maxInterStageShaderVariables -
(frontFacing || sampleIndex || sampleMaskIn ? 1 : 0);

Which interpretation is right here? EDIT: Confirmed, it should be a deduction per built-in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions