Fix crashes with Vulkan sparse bindings#1966
Merged
qining merged 1 commit intogoogle:masterfrom Jun 8, 2018
Merged
Conversation
Three issues fixed: 1) The opaque sparse memory binding info cached in Buffer and Image object should not be fed to MustUnpackReadMap(), as they are actually mapping from offsets to info, not a list of info. 2) IsFullyBound() does not work correctly. 3) Since the creation of ImageLevel.Data() slice has been moved from vkCreateImage to vkBindImageMemory, for sparse binding images, the Data slice is empty. For now we just check the size of the Data slice for each time a sparse binding is to be submitted and if the Data slice is empty, create the shadow memory Data slice for each image level.
Contributor
Author
|
@iburinoc Please take a look, hope this fixes the issue with sparse bindings for now. |
Contributor
AWoloszyn
reviewed
Jun 8, 2018
| as!u32(1) | ||
| } | ||
| size := widthInBlocks * heightInBlocks * level.Depth * elementSize | ||
| level.Data = make!u8(size) |
Contributor
There was a problem hiding this comment.
We will have to see what this looks like if/when we actually switch our pools over to actual byte slices. This will likely not be what we want.
Contributor
Author
There was a problem hiding this comment.
I think we need to 2 steps
- Get the texture data from replay side, so that nothing rely on the image level data pool any more
- Move to use the device memory data pool.
Or as you said, we can move to the pool first, for the cases that the calculated size is smaller than the required size.
AWoloszyn
approved these changes
Jun 8, 2018
This file contains hidden or 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
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.
Three issues fixed:
The opaque sparse memory binding info cached in Buffer and Image
object should not be fed to MustUnpackReadMap(), as they are actually
mapping from offsets to info, not a list of info.
IsFullyBound() does not work correctly.
Since the creation of ImageLevel.Data() slice has been moved from
vkCreateImage to vkBindImageMemory, for sparse binding images, the Data
slice is empty. For now we just check the size of the Data slice for
each time a sparse binding is to be submitted and if the Data slice is
empty, create the shadow memory Data slice for each image level.