mirror of
https://github.com/bevyengine/bevy
synced 2024-12-19 01:23:09 +00:00
Document why MAX_JOINTS
and MAX_MORPH_WEIGHTS
are set (#16324)
# Objective Fixes #15974 ## Solution Add the comment from @mockersf, adapted to fix in-context.
This commit is contained in:
parent
fcaa271693
commit
b744fb486b
2 changed files with 12 additions and 0 deletions
|
@ -8,6 +8,12 @@ use bevy_render::{
|
|||
use crate::render::skin::MAX_JOINTS;
|
||||
|
||||
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.
|
||||
pub const MORPH_BUFFER_SIZE: usize = MAX_MORPH_WEIGHTS * MORPH_WEIGHT_SIZE;
|
||||
|
||||
const JOINT_SIZE: usize = size_of::<Mat4>();
|
||||
|
|
|
@ -15,6 +15,12 @@ use bevy_render::{
|
|||
use bevy_transform::prelude::GlobalTransform;
|
||||
|
||||
/// Maximum number of joints supported for skinned meshes.
|
||||
///
|
||||
/// It 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.
|
||||
pub const MAX_JOINTS: usize = 256;
|
||||
|
||||
#[derive(Component)]
|
||||
|
|
Loading…
Reference in a new issue