mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Allow passing external_memory in vulkan-hal::Device::texture_from_raw() (#8512)
This commit is contained in:
parent
81dfcaf664
commit
d017d48b45
@ -123,6 +123,7 @@ By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206
|
||||
- Validation errors from `CommandEncoder::finish()` will report the label of the invalid encoder. By @kpreid in [#8449](https://github.com/gfx-rs/wgpu/pull/8449).
|
||||
- Corrected documentation of the minimum alignment of the *end* of a mapped range of a buffer (it is 4, not 8). By @kpreid in [#8450](https://github.com/gfx-rs/wgpu/pull/8450).
|
||||
- `util::StagingBelt` now takes a `Device` when it is created instead of when it is used. By @kpreid in [#8462](https://github.com/gfx-rs/wgpu/pull/8462).
|
||||
- `wgpu_hal::vulkan::Device::texture_from_raw` now takes an `external_memory` argument. By @s-ol in [#8512](https://github.com/gfx-rs/wgpu/pull/8512)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@ -488,11 +488,14 @@ impl super::Device {
|
||||
/// - If `drop_callback` is [`None`], wgpu-hal will take ownership of `vk_image`. If
|
||||
/// `drop_callback` is [`Some`], `vk_image` must be valid until the callback is called.
|
||||
/// - If the `ImageCreateFlags` does not contain `MUTABLE_FORMAT`, the `view_formats` of `desc` must be empty.
|
||||
/// - If `external_memory` is [`Some`], wgpu-hal will take ownership of the memory (which is presumed to back
|
||||
/// `vk_image`). If `external_memory` is [`None`], the memory must be valid until `drop_callback` is called.
|
||||
pub unsafe fn texture_from_raw(
|
||||
&self,
|
||||
vk_image: vk::Image,
|
||||
desc: &crate::TextureDescriptor,
|
||||
drop_callback: Option<crate::DropCallback>,
|
||||
external_memory: Option<vk::DeviceMemory>,
|
||||
) -> super::Texture {
|
||||
let mut raw_flags = vk::ImageCreateFlags::empty();
|
||||
let mut view_formats = vec![];
|
||||
@ -518,7 +521,7 @@ impl super::Device {
|
||||
super::Texture {
|
||||
raw: vk_image,
|
||||
drop_guard,
|
||||
external_memory: None,
|
||||
external_memory,
|
||||
block: None,
|
||||
format: desc.format,
|
||||
copy_size: desc.copy_extent(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user