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

chore: Switch out winapi to windows-rs #298

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

dklassic
Copy link
Contributor

Closes #292.

I'm still validating the change so I'll put it as a draft for now.

@mrobinson mrobinson force-pushed the switch-out-winapi branch from 37e446d to e286414 Compare July 17, 2024 15:03
@mrobinson
Copy link
Member

@dklassic It looks like there are still some build failures here depending on the features passed.

@dklassic
Copy link
Contributor Author

oops seems like I missed migrating winapi used in angle.

I'm out for a small trip I'll continue to cleanup the rest once I'm back.

Cargo.toml Outdated Show resolved Hide resolved
@dklassic dklassic marked this pull request as ready for review August 12, 2024 11:48
@dklassic dklassic marked this pull request as draft August 12, 2024 11:53
"winerror",
"wingdi",
"winuser",
windows = { version = "0.58", features = [
Copy link
Member

Choose a reason for hiding this comment

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

Could we use windows-sys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can tell, windows-sys does not have the feature set for manipulating DXGI so at best we would be using a mixture of both windows and windows-sys

use winapi::um::d3dcommon::{D3D_DRIVER_TYPE_UNKNOWN, D3D_DRIVER_TYPE_WARP};

const INTEL_PCI_ID: UINT = 0x8086;
const INTEL_PCI_ID: u32 = 0x8086;
Copy link
Member

Choose a reason for hiding this comment

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

I saw many number types use rust types directly.
Should they use types in std::ffi instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's pretty okay to use Rust types directly because windows-rs crate takes in Rust types directly as well.

src/platform/windows/angle/device.rs Outdated Show resolved Hide resolved
src/platform/windows/angle/surface.rs Outdated Show resolved Hide resolved
@wusyong
Copy link
Member

wusyong commented Aug 13, 2024

Just realized webxr repo also has to be tested :/

@msub2
Copy link

msub2 commented Aug 13, 2024

I have a WIP branch for updating webxr crate to windows/windows-sys, happy to assist with testing this if it's ready

@wusyong
Copy link
Member

wusyong commented Aug 14, 2024

@msub2 Do you have a branch for it? Perhaps we can open a draft in webxr repo to test in CI.

@msub2
Copy link

msub2 commented Aug 14, 2024

I can push one up soon, I'm currently using this branch of surfman on my WIP branch for webxr and just need to fix a couple more spots related to d3d11 textures

@msub2
Copy link

msub2 commented Aug 14, 2024

hrmm, I've got the webxr crate building now but trying to test in servo with updated surfman is causing an immediate crash. ill put up a draft pr for now, still needs looking into though

servo/webxr#238

@msub2
Copy link

msub2 commented Aug 14, 2024

Specifically the crash is happening in components/shared/webrenderer/rendering_context.rs in the create function in Servo

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.

Switch winapi dependency to windows/windows-sys
5 participants