-
Notifications
You must be signed in to change notification settings - Fork 326
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
Create aligned pool for image and recover/prime layer by layer #1644
Conversation
{0, 0, 0}, | ||
{e.width, e.height, e.depth}}); | ||
offset += (e.aligned_level_size * range.mlayerCount); | ||
for (size_t j = 0; j < range.mlayerCount; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real changes here.
}) | ||
for l := rng.BaseArrayLayer; l < rng.LayerCount; l++ { | ||
data := img.Layers.Get(l).Levels.Get(mipLevel).Data.MustRead(sb.ctx, nil, sb.oldState, nil) | ||
for j := uint32(0); j < rng.LayerCount; j++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real changes here.
This is to unify all the cases. When recovering the image data from trace side and priming the data to rebuild the state, we calculate the staging buffer offset by the aligned size. So the pools must be created with the aligned size. Also when recover/prime the image data, create image buffer copy layer by layer so that we don't need to assume the boundaries of multiple layers in one copy are aligned.
1d03917
to
3cd4a7a
Compare
@@ -4130,7 +4130,8 @@ cmd VkResult vkCreateImage( | |||
// Roundup the width and height in the number of blocks. | |||
widthInBlocks := roundUpTo(width, elementAndTexelBlockSize.TexelBlockSize.Width) | |||
heightInBlocks := roundUpTo(height, elementAndTexelBlockSize.TexelBlockSize.Height) | |||
size := widthInBlocks * heightInBlocks * depth * elementAndTexelBlockSize.ElementSize | |||
// Align to the next multiple times of 8 | |||
size := ((widthInBlocks * heightInBlocks * depth * elementAndTexelBlockSize.ElementSize) + 7) & (0xFFFFFFF8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real changes here.
All other changes are from clang-format. |
This is to unify all the cases.
When recovering the image data from trace side and priming the data to
rebuild the state, we calculate the staging buffer offset by the aligned
size. So the pools must be created with the aligned size.
Also when recover/prime the image data, create image buffer copy layer
by layer so that we don't need to assume the boundaries of multiple layers
in one copy are aligned.