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

[wgpu-hal] #5956 windows-rs migration followups and cleanups #6173

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

MarijnS95
Copy link
Contributor

@MarijnS95 MarijnS95 commented Aug 27, 2024

PR #5956 wasn't fully complete and still had some outstanding minor issues and cleanups to be done, as well as hidden semantic changes. This addresses a bunch of them:

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Description
Describe what problem this is solving, and how it's solved.

Testing
Explain how this change is tested.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@MarijnS95 MarijnS95 requested a review from a team as a code owner August 27, 2024 20:51
ErichDonGubler

This comment was marked as resolved.

@MarijnS95 MarijnS95 force-pushed the windows-rs-clean branch 2 times, most recently from e6fcdad to 40ec498 Compare August 28, 2024 07:43
@teoxoy
Copy link
Member

teoxoy commented Aug 28, 2024

The last remaining item seems to be #5956 (comment).

@MarijnS95
Copy link
Contributor Author

@teoxoy the last I remember is that that was hard to do as HSTRING couldn't be updated/reallocated internally, while the preallocated Vec could (and was used for exactly that purpose).

Let me re-check what's possible nowadays.

@MarijnS95
Copy link
Contributor Author

@teoxoy HSTRING does too many internal things and doesn't support reallocations which is what this Vec mainly seems to be reused for. I've removed the comment.

@MarijnS95 MarijnS95 requested a review from teoxoy August 29, 2024 20:33
PR gfx-rs#5956 wasn't fully complete and still had some outstanding minor
issues and cleanups to be done, as well as hidden semantic changes.
This addresses a bunch of them:

- Remove unnecessary `Error` mapping to `String` as `windows-rs`'s
  `Error` has a more complete `Display` representation by itself.
- Remove `into_result()` as every call could have formatted the
  `windows-rs` `Error` in a log call directly.
- Pass `None` instead of a pointer to an empty slice wherever possible
  (waiting for microsoft/win32metadata#1971 to
  trickle down into `windows-rs`).
- Remove `.clone()` on COM objects (temporarily increasing the refcount)
  when it can be avoided by inverting the order of operations on `raw`
  variables.
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@teoxoy teoxoy merged commit 4454cbf into gfx-rs:trunk Aug 30, 2024
25 checks passed
@MarijnS95 MarijnS95 deleted the windows-rs-clean branch August 30, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

DX12 backend no longer works after #5956
3 participants