Skip to content
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 #2547

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

kanerogers
Copy link

Overview

This PR attempts to close gfx-rs/wgpu#4491

Progress

In its current state, this PR can parse WGSL and generate Metal shaders that, when run with the corresponding PR of wgpu, work correctly in most use cases, with two known exceptions:

  • Writable textures on devices below tier 1
  • Usage of buffers with dynamic offsets

When complete, this work should simplify the Metal backend significantly as it allows the binding layout to be driven by the shader itself, obviating the need for hacks like fake_missing_bindings. In addition, it enables "bindless" features such as non-uniform indexing of very large arrays of textures.

Further work required

While I believe the bulk of the work has been done, I have sadly run out of available time to fully test and resolve all the edge cases required to finish this issue.

In particular, the use cases of writable textures on devices below tier 1, buffers with dynamic offsets and other potential use cases that have not yet been discovered, will require falling back to the existing binding model. This should be possible by simply checking for the presence of these, or any other necessary conditions and emitting a member of the function argument table, as per the existing architecture.

@kanerogers kanerogers marked this pull request as draft October 9, 2023 06:45
@cwfitzgerald
Copy link
Member

Hello, thank you for your PR against Naga!

As part of gfx-rs/wgpu#4231, we have moved development of Naga into the wgpu repository in the Naga subfolder. We have transferred all issues, but we are unable to automatically transfer PRs.

As such, please recreate your PR against the wgpu repository. We apologize for the inconvenience this causes, but will make contributing to both projects more streamlined going forward.

We are leaving PRs open, but once they are transferred, please close the original Naga PR.

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.

Use argument buffers on Metal
2 participants