Open
Bug 2002395
Opened 11 months ago
Updated 11 months ago
`create_texture_with_shared_texture_dmabuf` should use `wgpu_hal`'s `external_memory` argument
Categories
(Core :: Graphics: WebGPU, enhancement, P5)
Core
Graphics: WebGPU
Tracking
()
NEW
People
(Reporter: jimb, Unassigned)
References
Details
wgpu_bindings::server should rely on wgpu_hal::vulkan's own resource management to free the vk::DeviceMemory backing a swapchain texture, and remove our hand-coded VkImageHolder type that does exactly the same thing.
As of wgpu#8512, wgpu_hal::vulkan::Device::texture_from_raw can accept ownership of a vk::DeviceMemory presumed to hold the contents of the accompanying vk::Image, such that wgpu_hal::vulkan will free the DeviceMemory when the Texture is dropped. Thus, there is no need for Firefox to implement the same behavior itself via wgpu_bindings::server::VkImageHolder.
Be careful of the distinction between:
VkImageHandle, which owns a raw Vulkan image shared with WebRender for presentation. These are not managed by wgpu. They're owned bySharedTextureDMABuf, which participates in the wholeRemoteTexturething.- The
wgpu_core::Textures created bycreate_texture_with_shared_texture_dmabuffor canvas textures. These are managed by wgpu, but share content with theVkImageHandles by exporting the image viaVK_KHR_external_memory_fdand then re-importing it.
The latter are what we can simplify. The former don't touch wgpu_hal at all.
You need to log in
before you can comment on or make changes to this bug.
Description
•