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

Separate Native from the Core #381

Merged
merged 1 commit into from
Nov 16, 2019
Merged

Separate Native from the Core #381

merged 1 commit into from
Nov 16, 2019

Conversation

kvark
Copy link
Member

@kvark kvark commented Nov 16, 2019

Fixes #379 (haven't figured out how to build remote static lib to test the example, but that's not as important at this stage, since we have Gecko).
Fixes #168
Related to #2 and #8

This is a major refactor that moves out the core Rust API into a separate crate. It also changes the export semantics of wgpu-core in a way that the modules are exposed, and all the functionality is now represented as methods of Global. The "local" feature is transformed into a type system as a generic parameter <F> on the hubs.

Pros:

  • "local" feature is gone
  • we can change the core API more often, this doesn't necessarily require the native breaking version bump, and it would be very handy when adding Gecko-related changes
  • Gecko needs less stuff to compile (remote + core)
  • no collision of library names (native with or without the local feature)
  • less problem with crate types
  • cleaner semantics: each crate is either C or Rust, but not both

Cons:

  • more generics, I wouldn't be surprised this regresses the build times visibly

@kvark kvark requested a review from grovesNL November 16, 2019 02:54
Copy link
Collaborator

@grovesNL grovesNL 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 to me 👍 This gives us a good path forward for sharing the types too

@kvark
Copy link
Member Author

kvark commented Nov 16, 2019 via email

bors bot added a commit that referenced this pull request Nov 16, 2019
381: Separate Native from the Core r=grovesNL a=kvark

Fixes #379 (haven't figured out how to build remote static lib to test the example, but that's not as important at this stage, since we have Gecko).
Fixes #168 
Related to #2 and #8

This is a major refactor that moves out the core Rust API into a separate crate. It also changes the export semantics of wgpu-core in a way that the modules are exposed, and all the functionality is now represented as methods of `Global`. The "local" feature is transformed into a type system as a generic parameter `<F>` on the hubs.

Pros:
  - "local" feature is gone
  - we can change the core API more often, this doesn't necessarily require the `native` breaking version bump, and it would be very handy when adding Gecko-related changes
  - Gecko needs less stuff to compile (remote + core)
  - no collision of library names (native with or without the local feature)
  - less problem with crate types
  - cleaner semantics: each crate is either C or Rust, but not both

Cons:
  - more generics, I wouldn't be surprised this regresses the build times visibly

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 16, 2019

Build succeeded

@bors bors bot merged commit 6c632d1 into gfx-rs:master Nov 16, 2019
@kvark kvark deleted the core branch November 16, 2019 23:56
@kvark kvark mentioned this pull request Nov 19, 2019
bors bot added a commit that referenced this pull request Nov 20, 2019
382: Cleanup exports r=grovesNL a=kvark

This is a follow-up to #381 that cleans up the exports, such that `wgpu-core` doesn't deal with any raw C things.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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.

Unlock the crate types Building wgpu-remote makes wgpu-native dynamic library unusable
2 participants