Skip to content
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

Add subscript operator optimizations, remove usage #451

Merged

Conversation

kdt3rd
Copy link
Contributor

@kdt3rd kdt3rd commented Nov 3, 2024

This is not actually changing much about the vec subscript operators at this point, other than once if consteval is available, accessing with literals / compile time constants will eliminate the dynamic array usage. However, this changes many places where Imath was using subscript operators to just access the vector elements directly, which may allow optimizers to just leave things in registers more

Part of addressing optimizations suggested in #446

Adds routines to vec4 to match others
Adds a pre-defined half type for future specialization
Adds C++23 logic for known subscript values

Signed-off-by: Kimball Thurston <[email protected]>
avoid dynamic subscript usage by using x, y, z, w access directly

Signed-off-by: Kimball Thurston <[email protected]>
In preparation for changing subscript operators, change python bindings
where appropriate which get the pointers.

Signed-off-by: Kimball Thurston <[email protected]>
Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

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

All looks good to me.

@cary-ilm cary-ilm merged commit ab04691 into AcademySoftwareFoundation:main Nov 3, 2024
31 checks passed
@kdt3rd kdt3rd deleted the add_subscript_operator_opt branch November 9, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants