Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/bevy_mesh/src/morph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ use thiserror::Error;
pub const MAX_TEXTURE_WIDTH: u32 = 2048;

/// Max target count available for [morph targets](MorphWeights).
///
/// This value is used to allocate morph target weight buffers. The current
/// value is chosen because it is guaranteed to work everywhere. To allow for
/// larger values, the limit would need to be checked against the GPU at runtime,
/// which would mean not using a compile-time constant anymore.
pub const MAX_MORPH_WEIGHTS: usize = 256;

/// The maximum number of morph target components, if morph target textures are
Expand Down
6 changes: 1 addition & 5 deletions crates/bevy_pbr/src/render/mesh_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ use crate::{binding_arrays_are_usable, render::skin::MAX_JOINTS, skin, LightmapS

const MORPH_WEIGHT_SIZE: usize = size_of::<f32>();

/// This is used to allocate buffers.
/// The correctness of the value depends on the GPU/platform.
/// The current value is chosen because it is guaranteed to work everywhere.
/// To allow for bigger values, a check must be made for the limits
/// of the GPU at runtime, which would mean not using consts anymore.
Comment on lines -16 to -20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems odd to me to remove documentation here. Should probably be left or replaced with a doc-link to the MAX_MORPH_WEIGHTS

/// Buffer size used to store the maximum supported number of morph weights.
pub const MORPH_BUFFER_SIZE: usize = MAX_MORPH_WEIGHTS * MORPH_WEIGHT_SIZE;

const JOINT_SIZE: usize = size_of::<Mat4>();
Expand Down
Loading