-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Vulkan AS rebuild-on-replay: Serialise and Replay #3451
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baldurk
requested changes
Oct 7, 2024
baldurk
reviewed
Oct 7, 2024
The VkAccelerationStructureInfo structure is serialised followed by the unified geometry readback buffer. When the initial state Apply() is called the ASes are built from the input data one at a time so that a single scratch buffer can be built (enlarging when needed) and re-used. Although this is slower it is necessary on Mali as it has poor space efficiency for the scratch buffer and so can easily OOM a device if all the ASes are built in a single command buffer submission.
Rather than have a buffer per geometry, allocate a single block to carry all the input geometry. Change-Id: Ibc6f221ba0a317e8006ccf4a252da71c0aefe7dc drbrdt Change-Id: Ia41dd97fec4f7a2b78fc505dacc0304bbc818789
If an initial content AS was destroyed during active capture then resetting before serialisation meant that VkInitialContents::Free() was called, deref-ing the AS info and causing it to be deleted. So VkInitialContents is now reset after serialisation to ensure its lifetime. Change-Id: I6a296bd96dd5b639f68347073298e5545e8f980d
cmannett85-arm
force-pushed
the
replay
branch
from
October 11, 2024 15:39
78476e1
to
0d103df
Compare
I've rebased to pick up the mutable |
Then clone to captured AS. This is much faster than building on each Apply().
cmannett85-arm
force-pushed
the
replay
branch
from
October 13, 2024 14:51
0d103df
to
e2342e8
Compare
baldurk
reviewed
Oct 14, 2024
baldurk
reviewed
Oct 14, 2024
baldurk
reviewed
Oct 14, 2024
baldurk
reviewed
Oct 14, 2024
baldurk
reviewed
Oct 14, 2024
baldurk
reviewed
Oct 14, 2024
cmannett85-arm
force-pushed
the
replay
branch
2 times, most recently
from
October 18, 2024 13:45
a84d6b7
to
f4ede57
Compare
cmannett85-arm
force-pushed
the
replay
branch
from
October 19, 2024 14:37
f4ede57
to
210e16a
Compare
cmannett85-arm
commented
Oct 19, 2024
baldurk
requested changes
Oct 21, 2024
Also: * Use GPUBuffer instead of own radback memory mechanism, but mark as internal * Use GPU local buffer for AS builds instead of upload memory to improve performance
cmannett85-arm
force-pushed
the
replay
branch
from
October 21, 2024 12:38
210e16a
to
d63eb59
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
VkAccelerationStructureInfo
structure is serialised followed by the unified geometry readback buffer. On replay the upload buffer is populated from the capture and then copied to GPU local mem, at which point the upload mem is freed as replay cannot modify the AS input data.When the initial state Apply() is called the ASes are built from the input data one at a time so that a single scratch buffer can be built (enlarging when needed) and re-used. Although this is slower it is necessary on Mali as it has poor space efficiency for the scratch buffer and so can easily OOM a device if all the ASes are built in a single command buffer submission.
Tested on: