Skip to content

Commit 4efc992

Browse files
author
Eric Szentivanyi
authored
Add raw_handle method for metal texture (#6894)
* Add `raw_handle` method for metal texture * Add raw_handle method for metal texture (#6894)
1 parent 44b23c3 commit 4efc992

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ By @wumpf in [#6849](https://github.com/gfx-rs/wgpu/pull/6849).
173173

174174
- Allow using some 32-bit floating-point atomic operations (load, store, add, sub, exchange) in shaders. It requires Metal 3.0+ with Apple 7, 8, 9 or Mac 2. By @AsherJingkongChen in [#6234](https://github.com/gfx-rs/wgpu/pull/6234).
175175
- Add build support for Apple Vision Pro. By @guusw in [#6611](https://github.com/gfx-rs/wgpu/pull/6611).
176+
- Add `raw_handle` method to access raw Metal textures in [#6894](https://github.com/gfx-rs/wgpu/pull/6894).
176177

177178
#### Changes
178179

wgpu-hal/src/metal/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,15 @@ pub struct Texture {
518518
copy_size: crate::CopyExtent,
519519
}
520520

521+
impl Texture {
522+
/// # Safety
523+
///
524+
/// - The texture handle must not be manually destroyed
525+
pub unsafe fn raw_handle(&self) -> &metal::Texture {
526+
&self.raw
527+
}
528+
}
529+
521530
impl crate::DynTexture for Texture {}
522531

523532
unsafe impl Send for Texture {}

0 commit comments

Comments
 (0)