Create aligned pool for image and recover/prime layer by layer#1644
Merged
qining merged 1 commit intogoogle:masterfrom Feb 26, 2018
Merged
Create aligned pool for image and recover/prime layer by layer#1644qining merged 1 commit intogoogle:masterfrom
qining merged 1 commit intogoogle:masterfrom
Conversation
qining
commented
Feb 23, 2018
| {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++) { |
qining
commented
Feb 23, 2018
| }) | ||
| 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++ { |
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
qining
commented
Feb 23, 2018
| 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) |
Contributor
Author
|
All other changes are from clang-format. |
AWoloszyn
approved these changes
Feb 26, 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.
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.