1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2026 Mark Alan Boykin
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: MPL-2.0
//! The one seam where the carried wgpu majors disagree on a call signature.
//!
//! wgpu 30 made the texture tracker's initial state an explicit parameter of
//! `Device::create_texture_from_hal`; wgpu 28/29 hardcoded
//! `TextureUses::UNINITIALIZED` internally. wgpu 30 makes the imported
//! resource's state explicit, so each import path supplies the state it has
//! established at the HAL boundary. Routing the version split through here
//! keeps 28/29 behavior intact while making the 30 contract visible at every
//! import site.
/// Wrap an already-created HAL texture in a `wgpu::Texture`, identically
/// across the carried wgpu majors.
///
/// # Safety
///
/// Same contract as `wgpu::Device::create_texture_from_hal`: `hal_texture`
/// must come from this device, match `desc`, and be initialized. On wgpu 30,
/// `initial_state` must match the resource's actual backend state.
pub unsafe