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

Fearless object creation #1034

Merged
merged 8 commits into from
Nov 23, 2020
Merged

Fearless object creation #1034

merged 8 commits into from
Nov 23, 2020

Conversation

kvark
Copy link
Member

@kvark kvark commented Nov 20, 2020

Connections
Fixes #977
Fixes #1032

Description
Requiring a separate xxx_error() is very convenient for wgpu-core, but getting repetitive and complicated for all the users of the API. This PR changes it so we return an object ID unconditionally, and sometimes it's an error. The actual error is passed on the side.

Testing
Tested on gfx-rs/wgpu-rs#633

Copy link
Contributor

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

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

This is an autogenerated code review.

Checker summary (by rust_clippy):
The tool has found 76 warnings, 1 errors.

@kvark
Copy link
Member Author

kvark commented Nov 23, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 23, 2020

@bors bors bot merged commit 385ee9f into gfx-rs:master Nov 23, 2020
@kvark kvark deleted the error branch November 23, 2020 17:16
bors bot added a commit to gfx-rs/wgpu-rs that referenced this pull request Nov 23, 2020
633: Port to the updated wgpu error model r=scoopr a=kvark

Depends on gfx-rs/wgpu#1034

I removed most of the helping sugar we had before, in exchange for simple `match` and a `handle_error` function.
I believe this way it's easier to maintain and debug (stepping through closures is a pain today).

Co-authored-by: Dzmitry Malyshau <[email protected]>
bors bot added a commit that referenced this pull request Nov 26, 2020
1050: player: use the wgpu-cores's gfx-select macro r=kvark a=kvark

**Connections**
Looks like I broke the player in #1034, surprised we didn't notice, and that `cargo test` still passed. The problem was having the `Empty` backend for the device.

**Description**
Fixes the `device` backend in the player, switches the backend set to be `PRIMARY`, and re-uses the `wgc::gfx-select`.

**Testing**
Replaying a trace from #1049

Co-authored-by: Dzmitry Malyshau <[email protected]>
bors bot added a commit that referenced this pull request Nov 26, 2020
1050: player: use the wgpu-cores's gfx-select macro r=kvark a=kvark

**Connections**
Looks like I broke the player in #1034, surprised we didn't notice, and that `cargo test` still passed. The problem was having the `Empty` backend for the device.

**Description**
Fixes the `device` backend in the player, switches the backend set to be `PRIMARY`, and re-uses the `wgc::gfx-select`.

**Testing**
Replaying a trace from #1049

Co-authored-by: Dzmitry Malyshau <[email protected]>
bors bot added a commit to gfx-rs/wgpu-native that referenced this pull request Dec 13, 2020
61: Update to latest wgpu-core r=kvark a=DevOrc

Updates wgpu-core to [69196d8](gfx-rs/wgpu@69196d8)

Notes:
- Currently blocked by wgpu-core (see gfx-rs/wgpu#1077)
- Updates the error handling as a result of (gfx-rs/wgpu#1034)
- set_index_buffer requires an IndexFormat

Co-authored-by: Noah Charlton <[email protected]>
bors bot added a commit that referenced this pull request Mar 23, 2021
1276: Align create_swap_chain function signature r=cwfitzgerald a=kvark

**Connections**
Follow-up to #1034

**Description**
Swapchains are a bit special. Browsers don't use wgpu-core's swapchains, so we never bothered to convert them into the error model. But we still need this for Deno and webgpu-headers.

**Testing**
Untested, but also harmless

Co-authored-by: Dzmitry Malyshau <[email protected]>
bors bot added a commit that referenced this pull request Mar 23, 2021
1276: Align create_swap_chain function signature r=cwfitzgerald a=kvark

**Connections**
Follow-up to #1034

**Description**
Swapchains are a bit special. Browsers don't use wgpu-core's swapchains, so we never bothered to convert them into the error model. But we still need this for Deno and webgpu-headers.

**Testing**
Untested, but also harmless

Co-authored-by: Dzmitry Malyshau <[email protected]>
kvark added a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
633: Port to the updated wgpu error model r=scoopr a=kvark

Depends on gfx-rs#1034

I removed most of the helping sugar we had before, in exchange for simple `match` and a `handle_error` function.
I believe this way it's easier to maintain and debug (stepping through closures is a pain today).

Co-authored-by: Dzmitry Malyshau <[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.

Merge error ID generation into object creation Shader module descriptor
1 participant