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

Require a compatible surface for request_adapter() on WebGL2 #5901

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Jul 3, 2024

When targeting WebGL2, it was always the case that a surface had to be created first before calling request_adapter(). This PR makes it explicit that the adapter returned is compatible with the surface.

Fixes #5190.
Adds validation to prevent #2343 (comment).

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

This definitely needs a changelog entry, but woah does this mean multiple surfaces will work now?

@cwfitzgerald
Copy link
Member

Should this close #2343?

@teoxoy
Copy link
Member Author

teoxoy commented Jul 3, 2024

Multiple surfaces will work more predictably but you still can't present to multiple surfaces via a single device (which I thought what #2343 was asking for, hence I renamed it).

teoxoy added 2 commits July 4, 2024 10:01
…apters()` on WebGL2

Also makes wgpu's `enumerate_adapters()` native only.
…Surface` and the `Adapter` don't share the same WebGL2 context
@teoxoy teoxoy merged commit 9f34acd into gfx-rs:trunk Jul 4, 2024
27 checks passed
@teoxoy teoxoy deleted the hal-surface branch July 4, 2024 08:17
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.

request_adapter requires specific configuration to succeed with webgl feature enabled
2 participants