Skip to content

Conversation

@litherum
Copy link
Contributor

Fixes #2749

On an implementation on top of Metal that chooses to use argument buffers, bind groups and vertex buffers use the same metal resource (vertex buffer slots). This limit allows the site to trade-off bind groups and vertex buffers themselves, as long as the total sum of them don't exceed a limit.

This will be a bit tricky to implement on Metal if it's possible to unbind vertex buffers or bind groups (see
#3787) but I think it's possible and worth the tradeoff to not expose the complexity to the web, but to instead just handle it in the browser.

Fixes gpuweb#2749

On an implementation on top of Metal that chooses to use argument buffers,
bind groups and vertex buffers use the same metal resource (vertex buffer
slots). This limit allows the site to trade-off bind groups and vertex
buffers themselves, as long as the total sum of them don't exceed a limit.

This will be a bit tricky to implement on Metal if it's possible to unbind
vertex buffers or bind groups (see
gpuweb#3787) but I think it's possible and
worth the tradeoff to not expose the complexity to the web, but to instead
just handle it in the browser.
@litherum litherum requested review from kainino0x and toji January 29, 2023 02:02
@github-actions
Copy link
Contributor

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

@litherum
Copy link
Contributor Author

litherum commented Jan 30, 2023

I think this actually has to be more complicated, because the site is allowed to bind more bind groups than the pipeline requires.

E.g:

setPipeline(...);
for i in 0 ..< 10:
    setBindGroup(i, ...);
for i in 0 ..< 10:
    setVertexBuffer(i, ...);
setBindGroup(28, ...); // Whoops! This should be an error.
draw();

@kainino0x
Copy link
Contributor

FTR: Let's centralize the discussion on the parent issue, #2749

@kainino0x
Copy link
Contributor

Closing this draft in favor of #3938

@kainino0x kainino0x closed this Mar 13, 2023
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.

Combined limit for max vertex stage bind groups + vertex buffer bindings

2 participants