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

Create aligned pool for image and recover/prime layer by layer #1644

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

Qining
Copy link
Contributor

@Qining Qining commented Feb 23, 2018

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.

@Qining Qining requested a review from AWoloszyn February 23, 2018 19:35
{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++) {
Copy link
Contributor Author

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++ {
Copy link
Contributor Author

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.
@Qining Qining force-pushed the use-aligned-size-virtual-pool branch from 1d03917 to 3cd4a7a Compare February 23, 2018 19:39
@@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Real changes here.

@Qining
Copy link
Contributor Author

Qining commented Feb 23, 2018

All other changes are from clang-format.

@Qining Qining merged commit ac8ee3e into google:master Feb 26, 2018
@Qining Qining deleted the use-aligned-size-virtual-pool branch October 23, 2018 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants