diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index def79de6d..a2b81e3de 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -3403,6 +3403,9 @@ impl Device { bb.offset..bb.offset + visible_size }; + // Once a buffer is initialized, nothing can cause the contents to revert to an + // unknown state, so we do not record an init action in the bind group when that is + // the case. (The same is not true of textures.) buffer_init_actions.extend(buffer.initialization_status.read().create_action( buffer, init_range, @@ -3484,6 +3487,10 @@ impl Device { let texture = &view.parent; + // Unlike buffers, textures contents can revert to being undefined if used as a + // render attachment with `StoreOp::Discard`. Therefore, we must always register + // the init action in the bind group, and check the initialization state every + // time the binding is used. texture_init_actions.push(TextureInitTrackerAction { texture: texture.clone(), range: TextureInitRange {