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

Draft of wgpu-core bump #66

Merged
merged 4 commits into from
Feb 2, 2021
Merged

Draft of wgpu-core bump #66

merged 4 commits into from
Feb 2, 2021

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Jan 23, 2021

This is a draft PR to be merged after wgpu-core is bumped to use the latest gfx in this PR

  • Updates cbindgen instructions
  • Rebuilds wgpu/ffi.h header
  • Adds bool now to wgpu_texture_view_destroy to match other _destroy functions which take a bool
  • Renames nowwait in wgpu_texture_destroy to match other _destroy functions which take a bool

This required one hand-edit of wgpu.h (commit 8c29d4b) to fix an issue where it mis-translated an enum into a struct; not sure why this happened.

(the CI build is going to fail, because I'm waiting for the gfx PR to be merged before bumping hashes in Cargo.toml)

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 1 warnings, 1 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

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 1 warnings, 1 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

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 1 warnings, 1 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jan 23, 2021
1163: Bump gfx to latest master r=kvark a=mkeeter

**Connections**
- This bumps `gfx` to [#3610](gfx-rs/gfx#3610), and also includes [#3608](gfx-rs/gfx#3608) and [#3609](gfx-rs/gfx#3608)
- [Here](gfx-rs/wgpu-native#66) is a draft PR to `wgpu-native`
- `wgpu-rs` requires a one-line fix to the `texture_view_drop` call (which now takes a boolean); I can PR this next.

**Description**
This fixes [pathological shader complexity in SPIRV-Cross](KhronosGroup/SPIRV-Cross#1594), as well as a few other `gfx` PRs.

**Testing**
I updated `wgpu-native` to use this branch, then updated my [toy raytracer](https://github.com/mkeeter/rayray) to use the resulting `dylibs` and confirmed that it no longer takes forever to compile the pathological shader.

In addition, I updated `wgpu-rs` and went through the examples; nothing seems out of place.

Co-authored-by: Matt Keeter <[email protected]>
@kvark
Copy link
Member

kvark commented Jan 23, 2021

Thank you for an amazing work!

This required one hand-edit of wgpu.h (commit 8c29d4b) to fix an issue where it mis-translated an enum into a struct; not sure why this happened.

Let's look at this closer, we aren't expected to hand-fix anything. At first sight, it does appear like a bug in cbindgen - it confused the wgt::BindingType with the local BindingType. Can we play with it to see what's going on? What if we try to name the local type as something else, like BindingType2? We may need to file this upstream after a bit of investigation.

For the purposes of this PR though, it might be OK to merge the hand-fix, as long as it unblocks you and other users.

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 28 warnings, 0 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

@mkeeter
Copy link
Contributor Author

mkeeter commented Jan 23, 2021

Alright, I reduced it to a test case and reported upstream as cbindgen #649.

bors bot added a commit to gfx-rs/wgpu-rs that referenced this pull request Jan 23, 2021
726: Bump wgpu-core and update texture_view_drop call r=kvark a=mkeeter

This PR updates to the latest `wgpu-core` commit ([wgpu #1163](gfx-rs/wgpu#1163)), and is the counterpart to [wgpu-native #66](gfx-rs/wgpu-native#66).

I'm using `wait = false` in the `texture_view_drop` call to match `buffer_drop` and `texture_drop` elsewhere `backend/direct.rs`, though I don't quite understand the implications 😅

Co-authored-by: Matt Keeter <[email protected]>
@kvark kvark marked this pull request as ready for review January 23, 2021 21:43
@kvark
Copy link
Member

kvark commented Jan 23, 2021

bors r+

bors bot added a commit that referenced this pull request Jan 23, 2021
66: Draft of wgpu-core bump r=kvark a=mkeeter

This is a draft PR to be merged after `wgpu-core` is bumped to use the latest `gfx` in [this PR](gfx-rs/wgpu#1163)

- Updates `cbindgen` instructions
- Rebuilds `wgpu/ffi.h` header
- Adds `bool now` to `wgpu_texture_view_destroy` to match other `_destroy` functions which take a bool
- Renames `now` → `wait` in `wgpu_texture_destroy` to match other `_destroy` functions which take a bool

This required one hand-edit of `wgpu.h` (commit 8c29d4b) to fix an issue where it mis-translated an `enum` into a `struct`; not sure why this happened.

(the CI build is going to fail, because I'm waiting for the `gfx` PR to be merged before bumping hashes in `Cargo.toml`)


Co-authored-by: Matt Keeter <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 23, 2021

Build failed:

@kvark
Copy link
Member

kvark commented Jan 23, 2021

network issue
bors retry

bors bot added a commit that referenced this pull request Jan 23, 2021
66: Draft of wgpu-core bump r=kvark a=mkeeter

This is a draft PR to be merged after `wgpu-core` is bumped to use the latest `gfx` in [this PR](gfx-rs/wgpu#1163)

- Updates `cbindgen` instructions
- Rebuilds `wgpu/ffi.h` header
- Adds `bool now` to `wgpu_texture_view_destroy` to match other `_destroy` functions which take a bool
- Renames `now` → `wait` in `wgpu_texture_destroy` to match other `_destroy` functions which take a bool

This required one hand-edit of `wgpu.h` (commit 8c29d4b) to fix an issue where it mis-translated an `enum` into a `struct`; not sure why this happened.

(the CI build is going to fail, because I'm waiting for the `gfx` PR to be merged before bumping hashes in `Cargo.toml`)


Co-authored-by: Matt Keeter <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 23, 2021

Build failed:

@kvark
Copy link
Member

kvark commented Jan 23, 2021

legit error:

/home/runner/work/wgpu-native/wgpu-native/examples/compute/../../ffi/wgpu.h:2016:10: error: ‘WGPUBindingType’ defined as wrong kind of tag
struct WGPUBindingType ty;
^~~~~~~~~~~~~~~
/home/runner/work/wgpu-native/wgpu-native/examples/compute/../../ffi/wgpu.h:2016:26: error: field ‘ty’ has incomplete type
struct WGPUBindingType ty;

@mkeeter
Copy link
Contributor Author

mkeeter commented Jan 24, 2021

Oh, that's the cbindgen issue which I fixed with a hand-edit.

It looks like the Ubuntu builder re-runs cbindgen as part of the build here, which the other OS's don't do?

That makes sense in principle, just annoying in this one case 😆

Let's wait to hear what cbindgen upstream thinks of the issue – now that I've built the library locally, this isn't blocking me any more.

@mkeeter
Copy link
Contributor Author

mkeeter commented Feb 2, 2021

This issue has now been fixed in cbindgen upstream (0.17.0 release), so CI should work!

I've regenerated ffi/wgpu.h, and removed a few types from the config file – for some reason the cbindgen update removed the need to define WGPUNonZeroU64/WGPUOption_NonZeroU32/WGPUOption_NonZeroU64 ourselves 🤷🏻‍♂️

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 28 warnings, 0 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

@kvark
Copy link
Member

kvark commented Feb 2, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 2, 2021

@bors bors bot merged commit 3317a65 into gfx-rs:master Feb 2, 2021
kvark pushed a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
726: Bump wgpu-core and update texture_view_drop call r=kvark a=mkeeter

This PR updates to the latest `wgpu-core` commit ([wgpu gfx-rs#1163](gfx-rs#1163)), and is the counterpart to [wgpu-native gfx-rs#66](gfx-rs/wgpu-native#66).

I'm using `wait = false` in the `texture_view_drop` call to match `buffer_drop` and `texture_drop` elsewhere `backend/direct.rs`, though I don't quite understand the implications 😅

Co-authored-by: Matt Keeter <[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.

2 participants