Add maxInterStageShaderVariables and inter-stage limit validation#2857
Add maxInterStageShaderVariables and inter-stage limit validation#2857kainino0x merged 9 commits intogpuweb:mainfrom
Conversation
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
Kangz
left a comment
There was a problem hiding this comment.
LGTM, the previous version was also fine FWIW.
Editors WDYT?
|
|
kainino0x
left a comment
There was a problem hiding this comment.
about the title: this is is more than a clarification - it redefines what maxInterStageShaderComponents means (from just user-defined variables, to all variables).
The changes seem fine, but I don't feel I understand the underlying constraints enough yet - this is much deeper than editorial. Let's discuss on #1962.
|
Hi @kainino0x I've updated this PR based on #1962 (comment). For the details about how to compute both limits on each backend, I suggest we add them in another PR. PTAL, thanks! |
) SHA: b487c44 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
) SHA: b487c44 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
) SHA: b487c44 Reason: push, by @kainino0x Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This patch intends to clarify all the validations with
maxInterStageShaderComponents in WebGPU SPEC.
components should be no more than
maxInterStageShaderComponents.point-list, the The total amount ofboth user-defined and built-in vertex output components should
be no more than (
maxInterStageShaderComponents - 1) as onVulkan
PointSizeshould always be declared and consume 1vertex output component.
components should be no more than
maxInterStageShaderComponents.locationof each vertex output and fragment input variablesmust be less than
maxInterStageShaderComponents / 4as is requiredby Vulkan SPEC.
You can read the discussions in #1962 for more details.
Fixes #1962
Fixes #2400
Closes #2763
Preview | Diff