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

Update OpenXRAPI memory management #101294

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

devloglogan
Copy link
Contributor

It was mentioned here that OpenXRAPI could use some updates to its memory management. I've updated it to use Vector/LocalVector where possible!

@devloglogan devloglogan added this to the 4.x milestone Jan 8, 2025
@devloglogan devloglogan requested a review from a team as a code owner January 8, 2025 15:48
Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Thanks! This will be a very welcome change :-)

I haven't tested with this PR, but reading through the diff, it looks good to me

However, I think there may be a couple more places where we could use Vector/LocalVector, for example, in OpenXRAPI::RenderState with the views. Also, in openxr_opengl_extension.cpp and openxr_vulkan_extension.cpp.

Any reason why you skipped those? It would be nice to knock them all out at once.

@devloglogan
Copy link
Contributor Author

@dsnopek Thanks for pointing those out, I will take a look and update them soon!

@devloglogan devloglogan force-pushed the openxr-api-update branch 2 times, most recently from 5769096 to 6d36699 Compare January 12, 2025 17:42
@devloglogan
Copy link
Contributor Author

@dsnopek Alright, I believe I've updated the other instances you were referring to.

Copy link
Contributor

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

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

The code change looks good!

@akien-mga akien-mga requested a review from dsnopek January 13, 2025 07:02
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Jan 13, 2025
@devloglogan
Copy link
Contributor Author

@m4gr3d applied your error nit and discovered I could remove the intermediary pointers to the render_state vectors, so I did that too.

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Looks good! I only have some nitpicks about doing unnecessary if-statements before .clear()ing the vectors.

I also did a quick smoke test with Quest 3 and everything seems to be working fine

modules/openxr/openxr_api.cpp Outdated Show resolved Hide resolved
modules/openxr/openxr_api.cpp Outdated Show resolved Hide resolved
@devloglogan
Copy link
Contributor Author

@dsnopek addressed your comments, thanks!

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Thanks!

@akien-mga akien-mga merged commit 73f4ef5 into godotengine:master Jan 13, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants