pub struct Queue {
raw: Queue,
device: Arc<DeviceShared>,
family_index: u32,
relay_semaphores: Mutex<RelaySemaphores>,
signal_semaphores: Mutex<SemaphoreList>,
wait_semaphores: Mutex<SemaphoreList>,
next_submit_chain: Mutex<Option<PnextChain>>,
}vulkan only.Fields§
§raw: Queue§device: Arc<DeviceShared>§family_index: u32§relay_semaphores: Mutex<RelaySemaphores>§signal_semaphores: Mutex<SemaphoreList>§wait_semaphores: Mutex<SemaphoreList>§next_submit_chain: Mutex<Option<PnextChain>>A caller-provided pNext chain to attach to the [vk::SubmitInfo] of the
next call to submit().
Set only through Queue::set_next_submit_chain().
Implementations§
Source§impl Queue
impl Queue
pub fn raw_device(&self) -> &Device
pub fn add_signal_semaphore( &self, semaphore: Semaphore, semaphore_value: Option<u64>, )
Sourcepub fn remove_signal_semaphore(&self, semaphore: Semaphore) -> bool
pub fn remove_signal_semaphore(&self, semaphore: Semaphore) -> bool
Remove semaphore from the pending signal list if it is still present.
Returns true if the semaphore was found and removed. If the submit
already consumed it, this is a harmless no-op that returns false.
Sourcepub fn add_wait_semaphore(
&self,
semaphore: Semaphore,
semaphore_value: Option<u64>,
stage: PipelineStageFlags,
)
pub fn add_wait_semaphore( &self, semaphore: Semaphore, semaphore_value: Option<u64>, stage: PipelineStageFlags, )
Stage a semaphore wait on the next crate::Queue::submit call.
semaphore_value selects the kind of payload the wait targets:
Some(value)- wait untilsemaphore(a timeline semaphore) has been signalled to at leastvalue.None- wait on a binary semaphore signal.
stage is the pipeline stage at which the wait blocks downstream
work (e.g. vk::PipelineStageFlags::TOP_OF_PIPE to gate the
entire submission, or a more specific stage when only that stage
reads the synchronised resource).
Sourcepub fn remove_wait_semaphore(&self, semaphore: Semaphore) -> bool
pub fn remove_wait_semaphore(&self, semaphore: Semaphore) -> bool
Remove semaphore from the pending wait list if it is still present.
Returns true if the semaphore was found and removed. If the submit
already consumed it, this is a no-op that returns false.
Sourcepub unsafe fn set_next_submit_chain(&self, chain: *mut c_void)
pub unsafe fn set_next_submit_chain(&self, chain: *mut c_void)
Set a pNext chain of extension structs to attach to the [vk::SubmitInfo]
of the next submit() on this queue.
This supports submission extensions that wgpu-hal has no dedicated support
for. One example is VkLatencySubmissionPresentIdNV from VK_NV_low_latency2.
The device extension itself must be enabled at device creation, for example
with Adapter::open_with_callback().
The next submission on this queue consumes the chain, and a later call
replaces a chain that hasn’t been submitted yet. One wgpu or wgpu-core
submit maps to one submission here, but layers above wgpu-hal also make
housekeeping submissions of their own, for example when a buffer is mapped,
and those consume the chain too. Set the chain right before the submission
it applies to, with no other queue or buffer-mapping work in between.
§Safety
chainmust point to a validpNextchain of structs that can extend [vk::SubmitInfo]. The extensions in the chain must be enabled on this queue’s device.- The chain must stay valid until the next submission on this queue is made or the queue is dropped. Don’t read or write the chain during that time. Fields the driver wrote during submission may be read afterwards.
Trait Implementations§
Source§impl DynResource for Queue
impl DynResource for Queue
Source§impl Queue for Queue
impl Queue for Queue
type A = Api
Source§unsafe fn submit(
&self,
command_buffers: &[&CommandBuffer],
surface_textures: &[&SurfaceTexture],
(signal_fence, signal_value): (&Fence, FenceValue),
) -> Result<(), DeviceError>
unsafe fn submit( &self, command_buffers: &[&CommandBuffer], surface_textures: &[&SurfaceTexture], (signal_fence, signal_value): (&Fence, FenceValue), ) -> Result<(), DeviceError>
command_buffers for execution on GPU. Read moreSource§unsafe fn present(
&self,
surface: &Surface,
texture: SurfaceTexture,
) -> Result<(), SurfaceError>
unsafe fn present( &self, surface: &Surface, texture: SurfaceTexture, ) -> Result<(), SurfaceError>
unsafe fn get_timestamp_period(&self) -> f32
Source§unsafe fn wait_for_idle(&self) -> Result<(), DeviceError>
unsafe fn wait_for_idle(&self) -> Result<(), DeviceError>
Auto Trait Implementations§
impl !Freeze for Queue
impl !RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl !UnwindSafe for Queue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q> DynQueue for Qwhere
Q: Queue + DynResource,
impl<Q> DynQueue for Qwhere
Q: Queue + DynResource,
unsafe fn submit( &self, command_buffers: &[&(dyn DynCommandBuffer + 'static)], surface_textures: &[&(dyn DynSurfaceTexture + 'static)], signal_fence: (&(dyn DynFence + 'static), u64), ) -> Result<(), DeviceError>
unsafe fn present( &self, surface: &(dyn DynSurface + 'static), texture: Box<dyn DynSurfaceTexture>, ) -> Result<(), SurfaceError>
unsafe fn get_timestamp_period(&self) -> f32
unsafe fn wait_for_idle(&self) -> Result<(), DeviceError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more