[rs] Add map alignment from wgpu-types (#853)

* Add map alignment, and fix staging belt aligning to it instead for validations

* bump wgpu versions
This commit is contained in:
Aaron Housh
2021-04-13 06:44:59 -07:00
committed by GitHub
parent 2d5647f6d5
commit ef4b2dd079
3 changed files with 6 additions and 6 deletions

View File

@@ -28,20 +28,20 @@ cross = ["wgc/cross"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "27dbf076d5e257e14c816b052fcfdb25c165eda3"
rev = "c820cc8e737e3773c9c28ec49a1fecd8fa273dab"
features = ["raw-window-handle"]
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "27dbf076d5e257e14c816b052fcfdb25c165eda3"
rev = "c820cc8e737e3773c9c28ec49a1fecd8fa273dab"
features = ["raw-window-handle"]
optional = true
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "27dbf076d5e257e14c816b052fcfdb25c165eda3"
rev = "c820cc8e737e3773c9c28ec49a1fecd8fa273dab"
[dependencies]
arrayvec = "0.5"

View File

@@ -37,7 +37,7 @@ pub use wgt::{
StencilState, StorageTextureAccess, SwapChainDescriptor, SwapChainStatus, TextureAspect,
TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures,
TextureSampleType, TextureUsage, TextureViewDimension, VertexAttribute, VertexFormat,
BIND_BUFFER_ALIGNMENT, COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT,
BIND_BUFFER_ALIGNMENT, COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT,
PUSH_CONSTANT_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_STRIDE_ALIGNMENT,
};

View File

@@ -129,9 +129,9 @@ impl StagingBelt {
encoder.copy_buffer_to_buffer(&chunk.buffer, chunk.offset, target, offset, size.get());
let old_offset = chunk.offset;
chunk.offset += size.get();
let remainder = chunk.offset % crate::COPY_BUFFER_ALIGNMENT;
let remainder = chunk.offset % crate::MAP_ALIGNMENT;
if remainder != 0 {
chunk.offset += crate::COPY_BUFFER_ALIGNMENT - remainder;
chunk.offset += crate::MAP_ALIGNMENT - remainder;
}
self.active_chunks.push(chunk);