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

Make initialize_adapter_from_env take a compatible surface #3905

Merged
merged 4 commits into from
Jul 10, 2023
Merged

Make initialize_adapter_from_env take a compatible surface #3905

merged 4 commits into from
Jul 10, 2023

Conversation

fornwall
Copy link
Contributor

@fornwall fornwall commented Jul 3, 2023

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Similar issue as in #3792, initialize_adapter_from_env_or_default ignores backend_bits if WGPU_ADAPTER_NAME is not set

Description
The initialize_adapter_from_env_or_default function currently does not respect the compatible_surface parameter if WGPU_ADAPTER_NAME is set, and initialize_adapter_from_env cannot be used with a compatible surface requirement.

Let's modify initialize_adapter_from_env to take a compatible_surface: Option<&Surface> parameter, and make initialize_adapter_from_env_or_default use that.

Testing
Manual testing in separate project.

Add a compatible surface parameter to initialize_adapter_from_env, and
use that to make initialize_adapter_from_env_or_default always respect
its compatible_surface parameter.
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.

Looks good after this one nit.

CHANGELOG.md Show resolved Hide resolved
@Wumpf Wumpf requested a review from cwfitzgerald July 10, 2023 07:26
@Wumpf Wumpf dismissed cwfitzgerald’s stale review July 10, 2023 07:26

was addressed, resolved conflict

@Wumpf Wumpf merged commit 89f721f into gfx-rs:trunk Jul 10, 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.

3 participants