mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-22 20:03:11 +00:00
Insert texture barrier after initializing a texture
This commit is contained in:
parent
65a805ab3d
commit
ef08738330
@ -553,8 +553,21 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
encoder.copy_buffer_to_texture(
|
||||
&device.zero_buffer,
|
||||
dst_raw,
|
||||
zero_buffer_copy_regions.into_iter(),
|
||||
zero_buffer_copy_regions.iter().cloned(),
|
||||
);
|
||||
encoder.transition_textures(zero_buffer_copy_regions.iter().map(|copy| {
|
||||
hal::TextureBarrier {
|
||||
texture: dst_raw,
|
||||
range: wgt::ImageSubresourceRange {
|
||||
aspect: wgt::TextureAspect::All,
|
||||
base_mip_level: copy.texture_base.mip_level,
|
||||
mip_level_count: NonZeroU32::new(1),
|
||||
base_array_layer: copy.texture_base.array_layer,
|
||||
array_layer_count: NonZeroU32::new(1),
|
||||
},
|
||||
usage: hal::TextureUses::COPY_DST..hal::TextureUses::COPY_DST,
|
||||
}
|
||||
}));
|
||||
}
|
||||
encoder.copy_buffer_to_texture(&stage.buffer, dst_raw, regions);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user