renderling icon indicating copy to clipboard operation
renderling copied to clipboard

Examples don't build on Windows, more examples are needed

Open madmaxio opened this issue 2 years ago • 9 comments

Tried to run example crate, getting build error. Any plans to fix it and probably add more examples?

madmaxio avatar Dec 06 '23 14:12 madmaxio

Yes! Perchance would you be willing to paste the build error you're getting, along with your setup (OS, etc)?

schell avatar Dec 07 '23 00:12 schell

let uv_color: Vec4 = texture.sample(*sampler, in_uv); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4

And so on.

Just noticed glam default features message at the start.

madmaxio avatar Dec 07 '23 05:12 madmaxio

I'm on windows 11 with stable rust.

madmaxio avatar Dec 07 '23 10:12 madmaxio

Even after nuking my Cargo.lock file I can't reproduce that error when I run the example. Of course it could be just a Windows issue, as I'm on mac/Linux. Could you paste/link your full terminal output?

schell avatar Dec 07 '23 18:12 schell

Also, this project is still in a very early stage of development and I don't expect the API to be stable, so I've been hesitant to write extensive documentation/examples/tutorials - but the unit tests are pretty explanatory. Most of them create a full renderer and render a frame to an image, so with them you can see how the system works.

schell avatar Dec 08 '23 01:12 schell

PS C:\src.external\renderling\crates\example> cargo run warning: C:\src.external\renderling\crates\renderling-gpui\Cargo.toml: default-features is ignored for glam, since default-features was not specified for workspace.dependencies.glam, this could become a hard error in the future warning: C:\src.external\renderling\crates\renderling\Cargo.toml: default-features is ignored for glam, since default-features was not specified for workspace.dependencies.glam, this could become a hard error in the future Compiling wgpu-core v0.17.1 Compiling renderling-shader v0.1.0 (C:\src.external\renderling\crates\renderling-shader) Compiling gltf v1.3.0 (https://github.com/gltf-rs/gltf.git#6b9a7dfa) Compiling icosahedron v0.1.1 error[E0277]: the trait bound glam::Vec3: Vector<_, 3> is not satisfied --> crates\renderling-shader\src\convolution.rs:195:42 | 195 | .sample_by_lod(*sampler, l, mip_level) | ------------- ^ the trait Vector<_, 3> is not implemented for glam::Vec3 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec3 to implement ImageCoordinate<_, 3, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\convolution.rs:196:18 | 194 | prefiltered_color += environment_cubemap | __________________________________- 195 | | .sample_by_lod(*sampler, l, mip_level) 196 | | .xyz() | | -^^^ method not found in Vec4 | |_________________| | | ::: C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\swizzles\vec_traits.rs:365:8 | 365 | fn xyz(self) -> Self::Vec3; | --- the method is available for spirv_std::glam::Vec4 here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 4 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\convolution.rs:245:44 | 245 | *frag_color = texture.sample(*sampler, in_uv); | ------ ^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0308]: mismatched types --> crates\renderling-shader\src\convolution.rs:245:19 | 245 | *frag_color = texture.sample(*sampler, in_uv); | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to the type of this binding | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\convolution.rs:260:47 | 260 | let mut result = texture.sample(*sampler, in_uv).xyz() * weight[0]; | ------ ^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\convolution.rs:260:54 | 260 | let mut result = texture.sample(*sampler, in_uv).xyz() * weight[0]; | ^^^ method not found in Vec4 | ::: C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\swizzles\vec_traits.rs:365:8 | 365 | fn xyz(self) -> Self::Vec3; | --- the method is available for spirv_std::glam::Vec4 here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 4 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\convolution.rs:270:51 | 270 | result += texture.sample_by_lod(*sampler, in_uv + offset, 0.0).xyz() * weight[i]; | ------------- ^^^^^^^^^^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\convolution.rs:270:72 | 270 | result += texture.sample_by_lod(*sampler, in_uv + offset, 0.0).xyz() * weight[i]; | ^^^ method not found in Vec4 | ::: C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\swizzles\vec_traits.rs:365:8 | 365 | fn xyz(self) -> Self::Vec3; | --- the method is available for spirv_std::glam::Vec4 here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 4 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\convolution.rs:271:51 | 271 | result += texture.sample_by_lod(*sampler, in_uv - offset, 0.0).xyz() * weight[i]; | ------------- ^^^^^^^^^^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\convolution.rs:271:72 | 271 | result += texture.sample_by_lod(*sampler, in_uv - offset, 0.0).xyz() * weight[i]; | ^^^ method not found in Vec4 | ::: C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\swizzles\vec_traits.rs:365:8 | 365 | fn xyz(self) -> Self::Vec3; | --- the method is available for spirv_std::glam::Vec4 here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 4 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec3: Vector<_, 3> is not satisfied --> crates\renderling-shader\src\pbr.rs:182:51 | 182 | irradiance.sample_by_lod(*irradiance_sampler, n, 0.0).xyz() | ------------- ^ the trait Vector<_, 3> is not implemented for glam::Vec3 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec3 to implement ImageCoordinate<_, 3, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\pbr.rs:182:59 | 182 | irradiance.sample_by_lod(*irradiance_sampler, n, 0.0).xyz() | ^^^ method not found in Vec4 | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 7 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec3: Vector<_, 3> is not satisfied --> crates\renderling-shader\src\pbr.rs:199:46 | 199 | .sample_by_lod(*prefiltered_sampler, reflect_dir, roughness * 4.0) | ------------- ^^^^^^^^^^^ the trait Vector<_, 3> is not implemented for glam::Vec3 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec3 to implement ImageCoordinate<_, 3, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\pbr.rs:200:10 | 198 | / prefiltered 199 | | .sample_by_lod(*prefiltered_sampler, reflect_dir, roughness * 4.0) 200 | | .xyz() | | -^^^ method not found in Vec4 | |_________| | | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 7 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\pbr.rs:215:39 | 215 | brdf.sample_by_lod(*brdf_sampler, Vec2::new(n.dot(v).max(0.0), roughness), 0.0) | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0599]: no method named xy found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\pbr.rs:216:10 | 215 | / brdf.sample_by_lod(*brdf_sampler, Vec2::new(n.dot(v).max(0.0), roughness), 0.0) 216 | | .xy() | | -^^ method not found in Vec4 | |_________| | | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 7 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec3: Vector<_, 3> is not satisfied --> crates\renderling-shader\src\skybox.rs:72:52 | 72 | let env_color: Vec3 = texture.sample(*sampler, local_pos.alt_norm_or_zero()).xyz(); | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Vector<_, 3> is not implemented for glam::Vec3 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec3 to implement ImageCoordinate<_, 3, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\skybox.rs:72:82 | 72 | let env_color: Vec3 = texture.sample(*sampler, local_pos.alt_norm_or_zero()).xyz(); | ^^^ method not found in Vec4 | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 3 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec3: Vector<_, 3> is not satisfied --> crates\renderling-shader\src\skybox.rs:84:52 | 84 | let env_color: Vec3 = texture.sample(*sampler, local_pos.alt_norm_or_zero()).xyz(); | ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Vector<_, 3> is not implemented for glam::Vec3 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec3 to implement ImageCoordinate<_, 3, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\skybox.rs:84:82 | 84 | let env_color: Vec3 = texture.sample(*sampler, local_pos.alt_norm_or_zero()).xyz(); | ^^^ method not found in Vec4 | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 3 + use spirv_std::glam::Vec4Swizzles; |

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\skybox.rs:112:52 | 112 | let env_color: Vec3 = texture.sample(*sampler, uv).xyz(); | ------ ^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0599]: no method named xyz found for struct spirv_std::glam::Vec4 in the current scope --> crates\renderling-shader\src\skybox.rs:112:56 | 112 | let env_color: Vec3 = texture.sample(*sampler, uv).xyz(); | ^^^ method not found in Vec4 | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a use for it: | 3 + use spirv_std::glam::Vec4Swizzles; |

error[E0769]: tuple variant Self written as struct variant --> crates\renderling-shader\src\slab.rs:237:13 | 237 | let Self { x, y, z, w } = self; | ^^^^^^^^^^^^^^^^^^^ | help: use the tuple variant pattern syntax instead | 237 | let Self(_) = self; | ~~~

error[E0769]: tuple variant Self written as struct variant --> crates\renderling-shader\src\slab.rs:251:13 | 251 | let Self { x, y, z, w } = self; | ^^^^^^^^^^^^^^^^^^^ | help: use the tuple variant pattern syntax instead | 251 | let Self(_) = self; | ~~~

error[E0769]: tuple variant Self written as struct variant --> crates\renderling-shader\src\slab.rs:259:13 | 259 | let Self { x, y, z, w } = self; | ^^^^^^^^^^^^^^^^^^^ | help: use the tuple variant pattern syntax instead | 259 | let Self(_) = self; | ~~~

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\stage.rs:522:57 | 522 | let mut color: Vec4 = atlas.sample_by_lod(*sampler, uv, 0.0); | ------------- ^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0308]: mismatched types --> crates\renderling-shader\src\stage.rs:522:27 | 522 | let mut color: Vec4 = atlas.sample_by_lod(*sampler, uv, 0.0); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to this | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\stage.rs:539:57 | 539 | let mut color: Vec4 = atlas.sample_by_lod(*sampler, uv, 0.0); | ------------- ^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:289:26 | 286 | pub fn sample_by_lod<F>( | ------------- required by a bound in this associated function ... 289 | coordinate: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample_by_lod

error[E0308]: mismatched types --> crates\renderling-shader\src\stage.rs:539:27 | 539 | let mut color: Vec4 = atlas.sample_by_lod(*sampler, uv, 0.0); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to this | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\tonemapping.rs:154:48 | 154 | let color: Vec4 = texture.sample(*sampler, in_uv); | ------ ^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0308]: mismatched types --> crates\renderling-shader\src\tonemapping.rs:154:23 | 154 | let color: Vec4 = texture.sample(*sampler, in_uv); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to this | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\tonemapping.rs:155:60 | 155 | let bloom: Vec4 = bloom_texture.sample(*bloom_sampler, in_uv); | ------ ^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0308]: mismatched types --> crates\renderling-shader\src\tonemapping.rs:155:23 | 155 | let bloom: Vec4 = bloom_texture.sample(*bloom_sampler, in_uv); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to this | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

error[E0277]: the trait bound glam::Vec2: Vector<_, 2> is not satisfied --> crates\renderling-shader\src\ui.rs:129:51 | 129 | let uv_color: Vec4 = texture.sample(*sampler, in_uv); | ------ ^^^^^ the trait Vector<_, 2> is not implemented for glam::Vec2 | | | required by a bound introduced by this call | = help: the following other types implement trait Vector<T, N>: <spirv_std::glam::Vec2 as Vector<f32, 2>> <spirv_std::glam::Vec3 as Vector<f32, 3>> <spirv_std::glam::Vec3A as Vector<f32, 3>> <spirv_std::glam::Vec4 as Vector<f32, 4>> <spirv_std::glam::DVec2 as Vector<f64, 2>> <spirv_std::glam::DVec3 as Vector<f64, 3>> <spirv_std::glam::DVec4 as Vector<f64, 4>> <spirv_std::glam::IVec2 as Vector<i32, 2>> and 5 others = note: required for glam::Vec2 to implement ImageCoordinate<_, 1, 0> note: required by a bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\spirv-std-0.9.0\src\image.rs:225:21 | 222 | pub fn sample<F>( | ------ required by a bound in this associated function ... 225 | coord: impl ImageCoordinate<F, DIM, ARRAYED>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::sample

error[E0308]: mismatched types --> crates\renderling-shader\src\ui.rs:129:26 | 129 | let uv_color: Vec4 = texture.sample(*sampler, in_uv); | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected glam::Vec4, found spirv_std::glam::Vec4 | | | expected due to this | = note: spirv_std::glam::Vec4 and glam::Vec4 have similar names, but are actually distinct types note: spirv_std::glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.22.0\src\f32\sse2\vec4.rs:35:1 | 35 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ note: glam::Vec4 is defined in crate glam --> C:\Users\maxim.cargo\registry\src\index.crates.io-6f17d22bba15001f\glam-0.24.2\src\f32\sse2\vec4.rs:34:1 | 34 | pub struct Vec4(pub(crate) __m128); | ^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate glam are being used?

warning: unused import: Vec4Swizzles --> crates\renderling-shader\src\convolution.rs:4:37 | 4 | use glam::{UVec2, Vec2, Vec3, Vec4, Vec4Swizzles}; | ^^^^^^^^^^^^ | = note: #[warn(unused_imports)] on by default

Some errors have detailed explanations: E0277, E0308, E0599, E0769. For more information about an error, try rustc --explain E0277. warning: renderling-shader (lib) generated 1 warning error: could not compile renderling-shader (lib) due to 35 previous errors; 1 warning emitted warning: build failed, waiting for other jobs to finish...

madmaxio avatar Dec 08 '23 06:12 madmaxio

Thanks - I'm thinking it's caused by a mismatch between versions of glam? We'll see.

schell avatar Dec 08 '23 19:12 schell

Are you on the same branch? I just do simple steps:

  1. clone repository
  2. go to crates/example
  3. cargo run

Does this build for you?

madmaxio avatar Dec 09 '23 10:12 madmaxio

Following those steps it does indeed build for me. I'm not sure what the issue is but I'll try to recreate it on a Windows machine as soon as I can.

schell avatar Dec 10 '23 20:12 schell

@madmaxio windows support is now included in the CI builds, this should be fixed. Feel free to reopen this if you have any further problems :)

schell avatar May 25 '24 22:05 schell