From c406a89bcf184c17c86a16262f052daa5d021b4d Mon Sep 17 00:00:00 2001 From: Willow Griffiths Date: Wed, 29 Apr 2026 23:51:07 +0100 Subject: [PATCH] Add raw_handle method on vulkan::Buffer (#9459) --- CHANGELOG.md | 1 + wgpu-hal/src/vulkan/mod.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e61f3e55..f96e2cf07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,6 +119,7 @@ By @andyleiserson in [#9321](https://github.com/gfx-rs/wgpu/pull/9321). - DRM support by @rectalogic in [#9182](https://github.com/gfx-rs/wgpu/pull/9182). - Conditional compilation by @jimblandy in [#9390](https://github.com/gfx-rs/wgpu/pull/9390) - Fixed alignment and MatrixStride for mat2x2 in SPIR-V uniform blocks. By @39ali [#9369](https://github.com/gfx-rs/wgpu/pull/9369). +- Add `wgpu_hal::vulkan::Buffer::raw_handle()` for retrieving the underlying `vk::Buffer` resource. By @WillowGriffiths in [#9459](https://github.com/gfx-rs/wgpu/pull/9459). #### naga diff --git a/wgpu-hal/src/vulkan/mod.rs b/wgpu-hal/src/vulkan/mod.rs index 5f7cca336..5c26dedbc 100644 --- a/wgpu-hal/src/vulkan/mod.rs +++ b/wgpu-hal/src/vulkan/mod.rs @@ -695,6 +695,12 @@ impl Buffer { })), } } + + /// # Safety + /// - The buffer handle must not be manually destroyed + pub unsafe fn raw_handle(&self) -> vk::Buffer { + self.raw + } } impl crate::DynBuffer for Buffer {}