We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bevy_gaussian_splatting/src/gaussian/f16.rs
Line 165 in eb0fcc3
} #[derive( Clone, Debug, Default, Copy, PartialEq, Reflect, ShaderType, Pod, Zeroable, Serialize, Deserialize, )] #[repr(C)] pub struct Covariance3dOpacityPacked128 { #[reflect(ignore)] pub cov3d: [u32; 3], pub opacity: u32, } impl Covariance3dOpacityPacked128 { pub fn from_gaussian(gaussian: &Gaussian) -> Self { let cov3d: Covariance3dOpacity = gaussian.into(); let cov3d = cov3d.cov3d; let opacity = gaussian.scale_opacity.opacity; Self { cov3d: [ pack_f32s_to_u32(cov3d[0], cov3d[1]), pack_f32s_to_u32(cov3d[2], cov3d[3]), pack_f32s_to_u32(cov3d[4], cov3d[5]), ], opacity: pack_f32s_to_u32(opacity, opacity), // TODO: benefit from 32-bit opacity } } pub fn covariance_3d_opacity(&self) -> Covariance3dOpacity { let (c0, c1) = unpack_u32_to_f32s(self.cov3d[0]); let (c2, c3) = unpack_u32_to_f32s(self.cov3d[1]); let (c4, c5) = unpack_u32_to_f32s(self.cov3d[2]); let (opacity, _) = unpack_u32_to_f32s(self.opacity); let cov3d: [f32; 6] = [c0, c1, c2, c3, c4, c5]; Covariance3dOpacity { cov3d, opacity, pad: 0.0, } } } impl From<[u32; 4]> for Covariance3dOpacityPacked128 { fn from(cov3d_opacity: [u32; 4]) -> Self { Self { cov3d: [ cov3d_opacity[0], cov3d_opacity[1], cov3d_opacity[2], ], opacity: cov3d_opacity[3], } } } pub fn pack_f32s_to_u32(upper: f32, lower: f32) -> u32 { pack_f16s_to_u32( f16::from_f32(upper),
The text was updated successfully, but these errors were encountered:
mosure
No branches or pull requests
bevy_gaussian_splatting/src/gaussian/f16.rs
Line 165 in eb0fcc3
The text was updated successfully, but these errors were encountered: