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

[Merged by Bors] - Updated glam to 0.21. #5142

Closed
wants to merge 23 commits into from

Conversation

CGMossa
Copy link
Contributor

@CGMossa CGMossa commented Jun 29, 2022

Removed const_vec2/const_vec3
and replaced with equivalent .from_array.

Objective

Fixes #5112

Solution

Removed `const_vec2`/`const_vec3`
and replaced with equivalent `.from_array`.
@CGMossa
Copy link
Contributor Author

CGMossa commented Jun 29, 2022

This is a PR for doing the update in #5115.

@alice-i-cecile alice-i-cecile added C-Dependencies A change to the crates that Bevy depends on A-Math Fundamental domain-agnostic mathematical operations labels Jun 29, 2022
@james7132
Copy link
Member

Please fix the PR title: the wrong version is in there.

benches/Cargo.toml Outdated Show resolved Hide resolved
crates/bevy_math/Cargo.toml Outdated Show resolved Hide resolved
crates/bevy_mikktspace/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@irate-devil irate-devil left a comment

Choose a reason for hiding this comment

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

As James said above, the title of this PR has a typo.

crates/bevy_pbr/src/render/light.rs Outdated Show resolved Hide resolved
@CGMossa CGMossa changed the title Updated glam to 0.2.1. Updated glam to 0.21. Jun 30, 2022
and changed to constants..
@CGMossa
Copy link
Contributor Author

CGMossa commented Jun 30, 2022

Could someone review my last commit? Is this too much? Should this be reverted?

Also encase has updated their glam.. So this is soon going to be relevant.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 1, 2022

Last thing needed is that encase publishes a new version. I'll then change the version name for it, and make this PR ready.

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

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

Other than encase and the other comments, LGTM.

@teoxoy
Copy link
Contributor

teoxoy commented Jul 3, 2022

I just released encase v0.3 (which includes the bump to glam 0.21)

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

I'm hitting some issues:

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:84:17
   |
84 | #[derive(Clone, ShaderType)]
   |                 ^^^^^^^^^^
   |                 |
   |                 could not find `Size` in `private`
   |                 in this derive macro expansion
   |
  ::: C:\Users\angus\.cargo\registry\src\github.com-1ecc6299db9ec823\encase_derive_impl-0.2.0\src\lib.rs:18:9   
   |
18 |         pub fn derive_shader_type(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
   |         ------------------------------------------------------------------------------------ in this expansion of `#[derive(ShaderType)]`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:87:5
   |
87 |     view: Mat4,
   |     ^^^^ could not find `Size` in `private`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:88:5
   |
88 |     inverse_view: Mat4,
   |     ^^^^^^^^^^^^ could not find `Size` in `private`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:89:5
   |
89 |     projection: Mat4,
   |     ^^^^^^^^^^ could not find `Size` in `private`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:90:5
   |
90 |     world_position: Vec3,
   |     ^^^^^^^^^^^^^^ could not find `Size` in `private`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:91:5
   |
91 |     width: f32,
   |     ^^^^^ could not find `Size` in `private`

error[E0433]: failed to resolve: could not find `Size` in `private`
  --> crates\bevy_render\src\view\mod.rs:92:5
   |
92 |     height: f32,
   |     ^^^^^^ could not find `Size` in `private`

error[E0405]: cannot find trait `Size` in module `encase::private`
  --> crates\bevy_render\src\view\mod.rs:84:17
   |
84 | #[derive(Clone, ShaderType)]
   |                 ^^^^^^^^^^
   |                 |
   |                 not found in `encase::private`
   |                 in this derive macro expansion
   |
  ::: C:\Users\angus\.cargo\registry\src\github.com-1ecc6299db9ec823\encase_derive_impl-0.2.0\src\lib.rs:18:9   
   |
18 |         pub fn derive_shader_type(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
   |         ------------------------------------------------------------------------------------ in this expansion of `#[derive(ShaderType)]`

Right now, I'm trying to figure out what to do with this...

@teoxoy
Copy link
Contributor

teoxoy commented Jul 3, 2022

Bevy has it's own version of encase's derive macro which has to be updated as well.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

I'm utterly confused as to how to rebase this PR to main. So I resolved the conflicts by hand on github. I've no idea what the result of this is. I've no clue why the rebase is incredibly annoying. I cannot do it. I've tried 4 times already.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

Serialisation tests are failing.

left: `"{\"type\":\"glam::f32::vec3::Vec3\",\"struct\":{\"x\":{\"type\":\"f32\",\"value\":12.0},\"y\":{\"type\":\"f32\",\"value\":3.0},\"z\":{\"type\":\"f32\",\"value\":-6.9}}}"`,

In the test code it is written as:

            assert_eq!(
                result,
                r#"{"type":"glam::vec3::Vec3","struct":{"x":{"type":"f32","value":12.0},"y":{"type":"f32","value":3.0},"z":{"type":"f32","value":-6.9}}}"#
            );

Uhm.. what is the right decision here?

@irate-devil
Copy link
Contributor

irate-devil commented Jul 3, 2022

Looks like the location of the type changed.
Change that part of the test assert from glam::vec3::Vec3 to glam::f32::vec3::Vec3.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

Next issue is rounding of the number 12.

---- tests::glam::vec3_serialization stdout ----
thread 'tests::glam::vec3_serialization' panicked at 'assertion failed: `(left == right)`
  left: `"{\"type\":\"glam::f32::vec3::Vec3\",\"struct\":{\"x\":{\"type\":\"f32\",\"value\":12},\"y\":{\"type\":\"f32\",\"value\":3},\"z\":{\"type\":\"f32\",\"value\":-6.9}}}"`,
 right: `"{\"type\":\"glam::f32::vec3::Vec3\",\"struct\":{\"x\":{\"type\":\"f32\",\"value\":12.0},\"y\":{\"type\":\"f32\",\"value\":3.0},\"z\":{\"type\":\"f32\",\"value\":-6.9}}}"`', crates\bevy_reflect\src\lib.rs:923:13note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and also the rounding of `12.0`, and `6.0`.
@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

While James did say it first, I didn't notice it until now: We need a new version of hexasphere, specifically OptimisticPeach/hexasphere#12.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 3, 2022

The rounding seems to be one thing locally and another thing on CI.
No idea how to deal with this.
It uses serialisation and I don't know if I can change it..

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 3, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jul 3, 2022
Removed `const_vec2`/`const_vec3`
and replaced with equivalent `.from_array`.

# Objective

Fixes #5112 

## Solution

- `encase` needs to update to `glam` as well. See teoxoy/encase#4 on progress on that. 
- `hexasphere` also needs to be updated, see OptimisticPeach/hexasphere#12.
@bors bors bot changed the title Updated glam to 0.21. [Merged by Bors] - Updated glam to 0.21. Jul 3, 2022
@bors bors bot closed this Jul 3, 2022
@CGMossa CGMossa deleted the update_glam branch July 3, 2022 20:19
inodentry pushed a commit to IyesGames/bevy that referenced this pull request Aug 8, 2022
Removed `const_vec2`/`const_vec3`
and replaced with equivalent `.from_array`.

# Objective

Fixes bevyengine#5112 

## Solution

- `encase` needs to update to `glam` as well. See teoxoy/encase#4 on progress on that. 
- `hexasphere` also needs to be updated, see OptimisticPeach/hexasphere#12.
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
Removed `const_vec2`/`const_vec3`
and replaced with equivalent `.from_array`.

# Objective

Fixes bevyengine#5112 

## Solution

- `encase` needs to update to `glam` as well. See teoxoy/encase#4 on progress on that. 
- `hexasphere` also needs to be updated, see OptimisticPeach/hexasphere#12.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
Removed `const_vec2`/`const_vec3`
and replaced with equivalent `.from_array`.

# Objective

Fixes bevyengine#5112 

## Solution

- `encase` needs to update to `glam` as well. See teoxoy/encase#4 on progress on that. 
- `hexasphere` also needs to be updated, see OptimisticPeach/hexasphere#12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Dependencies A change to the crates that Bevy depends on S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants