Skip to content

Conversation

@toji
Copy link
Member

@toji toji commented Aug 11, 2022

Fixes #3279.

Uses the suggested limit of 640, with an annotation to help out those who don't
get where that value comes from. Also took the opportunity to update the
timeline style of the affected algortihm, which I'll probably be doing for most
of my future PRs.

spec/index.bs Outdated
- Let |limits| be |this|.{{GPUObjectBase/[[device]]}}.{{device/[[limits]]}}.
- The {{GPUBindGroupLayoutEntry/binding}} of each entry in |descriptor| is unique.
- The {{GPUBindGroupLayoutEntry/binding}} of each entry in |descriptor| must be <
|limits|.{{supported limits/maxBindingIndex}}.
Copy link
Contributor

@kainino0x kainino0x Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name maxBindingIndex makes it sound like it should be a "≤". "≤" is probably fine, I don't have a good alternative name suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a great name suggestion either that would allow it to continue being a "<". It's a little weird for it to be a "≤", since that means technically we would allow 641 unique binding indices, but given that it's something of an in-joke anyway I don't think that matters. In the future if we have a "real" limit it won't look that weird to have some square number-1, as most devs will recognize where that comes from. (Plus we use similar verbiage for things like maxComputeWorkgroupSize* so it's not completely without precedent.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really wanted it to be 640 we could maybe name it maxBindingsPerBindGroup, it would just be slightly misleading because you can never actually have that many bindings per bind group (other limits are the limiting factor). I'm fine with 641. shrug

@toji toji force-pushed the max-binding-index branch 2 times, most recently from 7079e8d to ed2972c Compare August 15, 2022 16:26
@github-actions
Copy link
Contributor

Previews, as seen when this build job started (ed2972c):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@kainino0x kainino0x added the tacit resolution queue Editors have agreed and intend to land if no feedback is given label Aug 15, 2022
@kainino0x kainino0x added this to the V1.0 milestone Aug 15, 2022
@kainino0x
Copy link
Contributor

Realized one thing we're missing from the last meeting notes:

CW: OK. And spec should guarantee it's more than this plus this plus that?

We should guarantee this as well.

@toji
Copy link
Member Author

toji commented Aug 16, 2022

I don't remember from that conversation and the meeting notes aren't enlightening. What is this1, this2, and that in this context?

@kainino0x
Copy link
Contributor

kainino0x commented Aug 16, 2022

Basically I think we want to say, for the limit values exposed on an adapter, it must be the case that sum(max*PerShaderStage) < maxBindingIndex

@toji
Copy link
Member Author

toji commented Aug 17, 2022

Ah, that makes sense. I've updated the PR to apply what I think is the right logic there. PTAL.

readonly attribute unsigned long maxBindGroups;
readonly attribute unsigned long maxBindingsPerBindGroup;
readonly attribute unsigned long maxDynamicUniformBuffersPerPipelineLayout;
readonly attribute unsigned long maxDynamicStorageBuffersPerPipelineLayout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated aside, I guess these should be ≤ (the corresponding per shader stage limits * 2)?

@github-actions
Copy link
Contributor

Previews, as seen when this build job started (e920880):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@kainino0x
Copy link
Contributor

Meeting: No concerns surfaced with name, will land Monday if no further input.

@kainino0x kainino0x added the needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet label Aug 24, 2022
toji and others added 6 commits August 29, 2022 11:11
Fixes #3279.

Uses the suggested limit of 640. Also took the opportunity to update the
timeline style of the affected algortihm, which I'll probably be doing for most
of my future PRs.
Co-authored-by: Kai Ninomiya <kainino@chromium.org>
@toji toji force-pushed the max-binding-index branch from 51d5d4f to 0641500 Compare August 29, 2022 18:12
@github-actions
Copy link
Contributor

Previews, as seen when this build job started (0641500):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@toji
Copy link
Member Author

toji commented Aug 29, 2022

It's Monday and no new comments have been made, so landing.

@toji toji merged commit f43a763 into main Aug 29, 2022
@toji toji deleted the max-binding-index branch August 29, 2022 18:30
@kainino0x kainino0x removed the tacit resolution queue Editors have agreed and intend to land if no feedback is given label Aug 30, 2022
juj added a commit to juj/wasm_webgpu that referenced this pull request Aug 31, 2022
@lokokung
Copy link
Contributor

Removing 'needs-cts-label' as this is updated as a part of the draft CTS named val: capability_checks,limits

@lokokung lokokung removed the needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet label Nov 30, 2022
@kainino0x
Copy link
Contributor

@lokokung fyi generally speaking for changes like this there could be other tests that need updating too, but in this case looks like we already updated them. (There's one MAINTENANCE_TODO to move a constant into kLimits.)

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.

Lower the max binding index in createBindGroupLayout

4 participants