Skip to content

Conversation

@litherum
Copy link
Contributor

@litherum litherum commented Apr 15, 2022

This is a stop-gap measure until #2749
is resolved. According to the Metal feature set tables, Macs limit the number
of inter-stage inputs to 32 and the number of inter-stage components to 124
If we limit the number of components to anything higher than 32, then a program
which uses single-component values will be able to exceed the limit on Macs.


Preview | Diff

This is a stop-gap measure until gpuweb#2749
is resolved. According to the Metal feature set tables, Macs limit the number
of inter-stage inputs to 32 and the number of inter-stage components to 124
If we limit the number of components to anything higher than 32, then a program
which uses single-component values will be able to exceed the limit on Macs.
@litherum litherum requested review from Kangz and kainino0x April 15, 2022 09:09
@github-actions
Copy link
Contributor

Previews, as seen when this build job started (276dcdd):
WebGPU | IDL
WGSL
Explainer

@Kangz
Copy link
Contributor

Kangz commented Apr 15, 2022

Instead of this I think we should add a maxInterStageVectors that's 15. It is an actual constraint in Vulkan, see #2400 and #1962 WDYT?

@litherum
Copy link
Contributor Author

That sounds fine to me, as long as we add rules about how to count them.

Jiawei-Shao added a commit to Jiawei-Shao/gpuweb that referenced this pull request May 10, 2022
This patch intends to clarify all the validations with
maxInterStageShaderComponents in WebGPU SPEC.
- The total amount of both user-defined and built-in vertex output
  components should be no more than `maxInterStageShaderComponents`.
  - If the primitive type is `point-list`, the The total amount of
    both user-defined and built-in vertex output components should
    be no more than (`maxInterStageShaderComponents - 1`) as on
    Vulkan `PointSize` should always be declared and consume 1
    component.
- The total amount of both user-defined and built-in fragment input
  components should be no more than `maxInterStageShaderComponents`.
- The default value of `maxInterStageShaderComponents` should be 64.
- The `location` of each vertex output and fragment input variables
  must be less than `maxInterStageShaderComponents / 4` as is required
  by Vulkan SPEC.

You can read the discussions in gpuweb#1962 for more details.

fixes: gpuweb#1962, gpuweb#2763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants