Skip to content

Handling dynamic Metal maxThreadsPerThreadgroup #5315

@reeselevine

Description

@reeselevine

I believe that the maxThreadsPerThreadgroup reported by Metal backends can change based on pipeline/shader complexity.

This can cause issues where a user attempts to launch shaders based on WebGPU's reported maxComputeWorkgroupSize{XYZ} or maxComputeInvocationsPerWorkgroup limits, but the actual limit for that shader in a given context is lower.

I encountered this issue running WebGPU natively using Dawn's bindings, and it caused a silent failure which I was only able to diagnose after enabling Metal shader validation/debug mode. I'm not sure if something similar would happen in the browser.

Opening this issue to see if anyone else has encountered/thought about this issue, and to see if there are any good solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIwgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions