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

[3.x] Mesh merging - refactor to be backward compatible for CPU / GPU storage #92105

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented May 19, 2024

Allows the old merge_meshes() function to work from the editor.

Fixes #91988

Most of the lines changed here are just moving the implementation functions to a new location. The bug fix is allowing them to be called choosing storage CPU or GPU etc, and defaulting the old function to store in GPU (which is the old way in 3.5).

So the PR is actually very simple and doesn't require in depth review or specialist knowledge (it just looks more complex because of moving a bit of code).

Notes

  • MergeGroups totally changed the backend for merging, which inadvertently broke the old merge_meshes() function in MeshInstance when used from the editor.
  • The breakage was simply because the new method defaulted to creating the result mesh on the CPU only (as this is significantly faster, as it removes a round trip to the GPU + drivers for any geometry processing).
  • This PR moves the wrappers for the MeshInstance merging functions to the MergingTool, and converts the results from the wrappers to GPU meshes, so they are suitable for use in the editor and rendering.

Allows the old `merge_meshes()` function to work from the editor.
@lawnjelly lawnjelly added this to the 3.6 milestone May 19, 2024
@lawnjelly lawnjelly requested a review from a team as a code owner May 19, 2024 06:58
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Yolo.

@lawnjelly lawnjelly merged commit f137eb3 into godotengine:3.x Jul 1, 2024
21 checks passed
@lawnjelly lawnjelly deleted the merging_storage_refactor branch July 1, 2024 11:21
@lawnjelly
Copy link
Member Author

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.

2 participants