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

Return custom AdapterInfo that contains backend. #475

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Return custom AdapterInfo that contains backend. #475

merged 2 commits into from
Jan 28, 2020

Conversation

daxpedda
Copy link
Contributor

When requesting an Adapter in combination with BackendBit::all(), there was no way to determine what backend was ultimately chosen.

This change implements a custom AdapterInfo that contains a field with Backend, it does otherwise not differ from gfx_hal::adapter::AdapterInfo.

The only question I have is about serde implementation, currently I can't derive de/serialization from it because of DeviceType. This could be fixed by activating the serde feature in gfx-hal, which isn't possible (as far as i know) without renaming our current serde feature.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
I think we should try to completely remove gfx-hal types from the API surface and therefore have our own enum DeviceType that we return in that struct.

@daxpedda
Copy link
Contributor Author

Done.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Thank you!

@kvark
Copy link
Member

kvark commented Jan 28, 2020

bors r+

bors bot added a commit that referenced this pull request Jan 28, 2020
475: Return custom `AdapterInfo` that contains backend. r=kvark a=daxpedda

When requesting an `Adapter` in combination with `BackendBit::all()`, there was no way to determine what backend was ultimately chosen.

This change implements a custom `AdapterInfo` that contains a field with `Backend`, it does otherwise not differ from `gfx_hal::adapter::AdapterInfo`.

The only question I have is about `serde` implementation, currently I can't derive de/serialization from it because of `DeviceType`. This could be fixed by activating the `serde` feature in `gfx-hal`, which isn't possible (as far as i know) without renaming our current `serde` feature.

Co-authored-by: daxpedda <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 28, 2020

Build succeeded

@bors bors bot merged commit cd8e2a3 into gfx-rs:master Jan 28, 2020
@daxpedda daxpedda deleted the adapter-backend branch January 28, 2020 12:05
kvark pushed a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
475: Made RenderBundleEncoder derive Debug r=kvark a=Andful

This is a continuation of the pull request gfx-rs#466 and should resolve the issue gfx-rs#458.

Co-authored-by: Andrea Nardi <[email protected]>
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.

2 participants