Skip to content

Comments

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

Merged
qining merged 1 commit intogoogle:masterfrom
qining:use-aligned-size-virtual-pool
Feb 26, 2018
Merged

Create aligned pool for image and recover/prime layer by layer#1644
qining merged 1 commit intogoogle:masterfrom
qining:use-aligned-size-virtual-pool

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
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