Skip to main content

VulkanQueueLock

Struct VulkanQueueLock 

Source
pub struct VulkanQueueLock { /* private fields */ }
Expand description

Serializes one shared Vulkan queue family across FFmpeg and the renderer.

Takes the same recursive lock FFmpeg takes around its submissions. Only contexts made by create_vulkan_device_context have it.

Implementations§

Source§

impl VulkanQueueLock

Source

pub fn new( device: AVHWDeviceContext, queue_family: u32, ) -> Result<Self, BridgeError>

Locks submissions to queue_family on device.

§Errors

Returns an input error unless device came from create_vulkan_device_context and has a lock for queue_family.

Source

pub fn lock(&self) -> VulkanQueueGuard<'_>

Holds the queue lock until the guard drops; the guard stays on this thread.

Source

pub unsafe fn raw_lock(&self)

Acquires the queue lock without a guard, for adapters with their own lock/unlock protocol.

§Safety

The calling thread must release it with exactly one Self::raw_unlock, in reverse order of its other holds on this lock.

Source

pub unsafe fn raw_unlock(&self)

Releases a hold taken by Self::raw_lock.

§Safety

The calling thread must hold the lock from an unreleased Self::raw_lock, and this must be its most recent hold. An unbalanced release lets two submissions reach the queue at once.

Trait Implementations§

Source§

impl Debug for VulkanQueueLock

Available on Linux and crate feature hwdevice only.
Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Sync for VulkanQueueLock

Available on Linux and crate feature hwdevice only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.