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 buffer_copy method to RenderingDevice #80424

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

DarioSamo
Copy link
Contributor

Includes a Vulkan implementation.

Direct buffer copies are required to perform certain operations more efficiently, as the only current alternative is to download the buffer to the CPU and upload it again.

As mentioned in #80414, the only alternative was to download the buffer to the CPU, which induces an extremely inefficient stall when all that is needed is to just copy the buffer directly on the GPU.

This PR should have no current effect in any rendering code whatsoever as nothing calls it yet. Once it is merged I can provide an implementation for multimesh that takes advantage of this new function to handle the resize path more efficiently.

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

The implementation looks fine to me.

Let's wait to merge until we actually have something to test this with though so we can confirm that it is working

…tion for the Vulkan driver.

Direct buffer copies are required to perform certain operations more efficiently, as the only current alternative is to download the buffer to the CPU and upload it again. As the first use case, the new function is used when enabling motion vectors on multimeshes.
@DarioSamo
Copy link
Contributor Author

As #80414 has been merged, I've now added a change to the affected function in this PR to avoid having to do GPU readback.

Verifying if this works should just involve testing the MRP again on the issue #67287.

@akien-mga akien-mga changed the title Add buffer_copy method to RenderingDevice Add buffer_copy method to RenderingDevice Aug 14, 2023
@clayjohn clayjohn modified the milestones: 4.x, 4.2 Aug 15, 2023
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Code looks good to me and I tested locally and it works fine.

Since this is a new-ish feature, no need to cherrypick

@akien-mga akien-mga merged commit 04c2bc5 into godotengine:master Aug 16, 2023
@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