-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Remove unnecessary Option wrapper from PreviousGlobalTransform in meshlet extraction #20306
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
base: main
Are you sure you want to change the base?
Remove unnecessary Option wrapper from PreviousGlobalTransform in meshlet extraction #20306
Conversation
the test file in examples/ should not be merged but leaving it for now for others to test during review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me (assuming the test example is removed for merge)
@@ -101,7 +101,7 @@ impl InstanceManager { | |||
) { | |||
// Build a MeshUniform for the instance | |||
let transform = transform.affine(); | |||
let previous_transform = previous_transform.map(|t| t.0).unwrap_or(transform); | |||
let previous_transform = previous_transform.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let previous_transform = previous_transform.0; |
Imo remove this line, just use previous_transform.0 later on directly.
I don't think this fix is correct.
|
Objective
Option<>
wrapper in meshlet extraction forPreviousGlobalTransform
PreviousGlobalTransform
is always present, making theOption
wrapper misleadingSolution
extract_meshlet_mesh_entities
query fromOption<&PreviousGlobalTransform>
to&PreviousGlobalTransform
add_instance
function parameter fromOption<&PreviousGlobalTransform>
to&PreviousGlobalTransform
previous_transform.map(|t| t.0).unwrap_or(transform)
toprevious_transform.0
update_mesh_previous_global_transforms
functionThe initialization logic was already working correctly - the prepass system ensures
PreviousGlobalTransform
equalsGlobalTransform
on the first frame for new entities.Testing
PreviousGlobalTransform
is correctly initialized to matchGlobalTransform
on the first frameReviewers can test by:
cargo run --example test_previous_transform
to verify initialization works correctly