Skip to content

Replace backends! Macro with CFG Aliases#910

Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom
katharostech:cfg-aliases
Aug 31, 2020
Merged

Replace backends! Macro with CFG Aliases#910
bors[bot] merged 1 commit intogfx-rs:masterfrom
katharostech:cfg-aliases

Conversation

@zicklag
Copy link
Copy Markdown
Contributor

@zicklag zicklag commented Aug 30, 2020

Connections
Needs to be merged before: #907

Description
This change makes it easier to conditionally compile code based on graphics backends by adding #[cfg] aliases for the backends such as vulkan, metal, etc. This makes the code easier to read and maintain.

Testing
Tested the WGPU-rs cube and boids examples and they work as normal on a Linux machine with Vulkan.

Copy link
Copy Markdown
Contributor Author

@zicklag zicklag left a comment

Choose a reason for hiding this comment

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

One oddity with one of the macros that needs review.

Copy link
Copy Markdown
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.New suggestions: 5

Checker summary (by rust_clippy):
The tool has found 0 warnings, 2 errors.

@zicklag
Copy link
Copy Markdown
Contributor Author

zicklag commented Aug 30, 2020

It seems that windows nightly is failing, but I don't know that that is because of my changes. It's failing to compile another crate.

Edit: Yep, it's failing the same on the other PRs, too.

Uses the `cfg_aliases` crate to replace the `backends!` macro and
provide a more natural way to gate backend specific code.
Copy link
Copy Markdown
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!
bors r+

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Aug 31, 2020

@bors bors bot merged commit ca7f6ae into gfx-rs:master Aug 31, 2020
@zicklag zicklag deleted the cfg-aliases branch August 31, 2020 14:08
bors bot added a commit that referenced this pull request Nov 5, 2020
907: Implement OpenGL Backend For Unix Platforms r=kvark a=zicklag

**Connections**
Requires: gfx-rs/gfx#3340 ( merged )
Should be merged first: #910
Works towards: #450

**Description**
Integrates the GFX GL backend for Unix platforms

**Testing**
Runs the basic cube and triangle examples  for wgpu-rs, but not without rendering artifacts on the cube.
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See #666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Zicklag <zicklag@katharostech.com>
bors bot added a commit that referenced this pull request Nov 5, 2020
907: Implement OpenGL Backend For Unix Platforms r=kvark a=zicklag

**Connections**
Requires: gfx-rs/gfx#3340 ( merged )
Should be merged first: #910
Works towards: #450

**Description**
Integrates the GFX GL backend for Unix platforms

**Testing**
Runs the basic cube and triangle examples  for wgpu-rs, but not without rendering artifacts on the cube.
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See #666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Zicklag <zicklag@katharostech.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.

2 participants