mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-19 18:33:30 +00:00
Review feedback / fix validate_linear_texture_data
This commit is contained in:
parent
50043875e5
commit
720c73fa9c
@ -181,7 +181,7 @@ pub(crate) fn validate_linear_texture_data(
|
||||
let bytes_per_row = if let Some(bytes_per_row) = layout.bytes_per_row {
|
||||
bytes_per_row.get() as BufferAddress
|
||||
} else {
|
||||
if copy_depth > 1 || block_height > 1 {
|
||||
if copy_depth > 1 || height_in_blocks > 1 {
|
||||
return Err(TransferError::UnspecifiedBytesPerRow);
|
||||
}
|
||||
bytes_per_block * width_in_blocks
|
||||
|
@ -401,14 +401,14 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
)?;
|
||||
dst.life_guard.use_at(device.active_submission_index + 1);
|
||||
|
||||
let bytes_per_row = if let Some(bytes_per_row) = data_layout.bytes_per_row {
|
||||
bytes_per_row.get()
|
||||
} else {
|
||||
width_blocks * bytes_per_block
|
||||
};
|
||||
|
||||
let ptr = stage.memory.map(&device.raw, 0, stage_size)?;
|
||||
unsafe {
|
||||
let bytes_per_row = if let Some(bytes_per_row) = data_layout.bytes_per_row {
|
||||
bytes_per_row.get()
|
||||
} else {
|
||||
width_blocks * bytes_per_block
|
||||
};
|
||||
|
||||
//TODO: https://github.com/zakarumych/gpu-alloc/issues/13
|
||||
if stage_bytes_per_row == bytes_per_row {
|
||||
// Fast path if the data isalready being aligned optimally.
|
||||
|
Loading…
Reference in New Issue
Block a user