Skip to content

Investigate clippy failure on example-shader with glam #186

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

Closed
repi opened this issue Oct 30, 2020 · 3 comments
Closed

Investigate clippy failure on example-shader with glam #186

repi opened this issue Oct 30, 2020 · 3 comments
Labels
a: examples Issues specific to the examples in the repository. t: bug Something isn't working

Comments

@repi
Copy link
Contributor

repi commented Oct 30, 2020

Running clippy on example-shader after the glam conversion in #149 results in:

     Compiling example-shader v0.1.0 (/home/runner/work/rust-gpu/rust-gpu/examples/example-shader)
  error: constant runtime array value

https://github.com/EmbarkStudios/rust-gpu/pull/149/checks?check_run_id=1326417262

it is from our codegen but not sure how we are getting it and needs further investigation

@repi repi added the t: bug Something isn't working label Oct 30, 2020
repi added a commit that referenced this issue Oct 30, 2020
Jasper-Bekkers pushed a commit that referenced this issue Oct 30, 2020
* [spirv-std] Remove math types

* Temp implementation of copysign

#148

* Convert shader to use glam

* Rustfmt

* Fix wgpu-example-shader to use glam

* [spirv-std] Disable clippy::use_self

* Upgrade to latest glam branch

* Use latest glam fork

* Remove incorrect assert_uninit

After discussions with @khyperia

* Update lockfile

* Update to latest glam fork with fixes

* Use real copysign intrinsic

* Disable clippy on example-shader for now

Tracked in #186
@khyperia
Copy link
Contributor

khyperia commented Nov 2, 2020

The actual failure is due to panicking with a string, and strings are not supported yet. I added a quick ignored test as a reminder to implement it eventually.

// TODO: Implement strings to make this compile
#[test]
#[ignore]
fn panic() {
val(r#"
#[allow(unused_attributes)]
#[spirv(fragment)]
pub fn main() {
panic!("aaa");
}
"#);
}

But for why clippy generates code that panics with a string, but normal builds don't, that I have no idea on. I tried investigating for a few hours, and came up with nothing.

@repi
Copy link
Contributor Author

repi commented Nov 2, 2020

I think I managed to get this problem also when building the shader in debug (so not using --release), which likely introduces debug asserts with strings also

@XAMPPRocky XAMPPRocky added the a: examples Issues specific to the examples in the repository. label Nov 2, 2020
@XAMPPRocky XAMPPRocky mentioned this issue Nov 6, 2020
18 tasks
@khyperia
Copy link
Contributor

khyperia commented Apr 1, 2021

I think this is probably fixed with eddyb's work

@khyperia khyperia closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: examples Issues specific to the examples in the repository. t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants