[rs] Fix create_texture_with_data for 3d textures (#771)

* Fix create_texture_with_data for 3d textures

* Remove depth_per_iteration variable
This commit is contained in:
Ashley 2021-02-22 18:19:57 +01:00 committed by GitHub
parent e913cefcc6
commit 0476822863

View File

@ -25,7 +25,7 @@ pub trait DeviceExt {
/// each layer and its mips to be tightly packed.
///
/// Example:
/// Layer0Mip0 Layer0Mip1 Layer0Mip2 ... Layer1Mip0 Layer1Mip1 Layer1Mip2 ...
/// Layer0Mip0 Layer0Mip1 Layer0Mip2 ... Layer1Mip0 Layer1Mip1 Layer1Mip2 ...
fn create_texture_with_data(
&self,
queue: &crate::Queue,
@ -105,7 +105,7 @@ impl DeviceExt for crate::Device {
let height_blocks = mip_physical.height / format_info.block_dimensions.1 as u32;
let bytes_per_row = width_blocks * format_info.block_size as u32;
let data_size = bytes_per_row * height_blocks;
let data_size = bytes_per_row * height_blocks * mip_extent.depth;
let end_offset = binary_offset + data_size as usize;
@ -123,7 +123,7 @@ impl DeviceExt for crate::Device {
crate::TextureDataLayout {
offset: 0,
bytes_per_row,
rows_per_image: 0,
rows_per_image: mip_physical.height,
},
mip_physical,
);