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

fix(ext/webgpu): fix GPUAdapter#info fails and add GPUDevice#adapterInfo #26844

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

petamoriken
Copy link
Contributor

@petamoriken petamoriken commented Nov 12, 2024

Fix #25874
Fix #26760

GPUAdapter cannot be destroyed manually, so this PR adds FinalizationRegistry to release its resource when GC'd.

And, this PR adds GPUDevice#adapterInfo.
gpuweb/gpuweb#4809
https://groups.google.com/a/chromium.org/g/blink-dev/c/q4tpIeEydRI

@petamoriken
Copy link
Contributor Author

@crowlKats Please take a look!

ext/webgpu/02_surface.js Show resolved Hide resolved
tests/unit/webgpu_test.ts Show resolved Hide resolved
@petamoriken
Copy link
Contributor Author

petamoriken commented Nov 14, 2024

By initializing GPUAdapterInfo at the same time as GPUAdapter, we can release resources when GPUDevice is requested, so that implementation might be better 🤔

@crowlKats
Copy link
Member

FYI @petamoriken i will be reviewing this alongside all other webgpu and graphics related PRs throughout the day today

Copy link
Member

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

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

A problem with this is having to disable sanitizeResources. GPUAdapter as far as i know has no plans to be destroyable, which is the reason why we used take. I will have to bring this up in the next wgpu meeting to get a clearer idea of whats going on, so will have to wait until next week.

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.

Logging out webgpu adapater causes an assertion error WebGPU adapter.info call fails after device creation
3 participants