-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use argument buffers on Metal #4491
Comments
Some updates on this one:
Some notes (for my reference, or for anyone who wants to pick this up should I get hit by a bus):
|
Some considerations:
|
@kanerogers The "Without argument buffers" example in the top comment seems mangled - is that valid MSL? |
Ah, good pick up! 😅 No, it's not valid MSL. This was just a rough sketch I wrote, mostly for myself, when I was first looking into the project. |
Closing as this is redundant to #3334, now that the repos are merged. |
Currently the maxStorageBuffersPerShaderStage on Metal is limited to 31, will the using of argument buffer unlock this limitation to a very large number? I see this issue closed because of the #3334, if the #3334 get implemented, can maxStorageBuffersPerShaderStage be raised a lot? Background: I have shader that using more than 31 storage buffers so it can not run on Metal now and I'm not able to migrate my shader to using binding_array even if binding_array on Metal is supported. |
It will be a different limit (see #6738) but yes, it will be on the order of a million. |
So I suppose you mean the maxStorageBuffersPerShaderStage will not be raised, but there will be another new millions level limit for bind_array, which means I still need to somehow migrate my code using bindless resource to use so much binging in metal? |
Correct! |
Background
This is a companion to the wgpu issue #3334
Using argument buffers would simplify the Metal shaders emitted by naga. Instead of having to pass each binding to the shader function as an argument, each binding group can be bundled into a struct which can then be used throughout the shader. For example:
Input wgsl
Without argument buffers
With argument buffers
The text was updated successfully, but these errors were encountered: