Struct wgpu_hal::vulkan::Surface

source ·
pub struct Surface { /* private fields */ }
Available on vulkan only.

Implementations§

source§

impl Surface

source

pub fn raw_swapchain(&self) -> Option<SwapchainKHR>

Get the raw Vulkan swapchain associated with this surface.

Returns None if the surface is not configured.

source

pub fn set_next_present_time(&self, present_timing: PresentTimeGOOGLE)

Set the present timing information which will be used for the next presentation of this surface, using VK_GOOGLE_display_timing.

This can be used to give an id to presentations, for future use of [vk::PastPresentationTimingGOOGLE]. Note that wgpu-hal does not provide a way to use that API - you should manually access this through [ash].

This can also be used to add a “not before” timestamp to the presentation.

The exact semantics of the fields are also documented in the specification for the extension.

Panics

Trait Implementations§

source§

impl Drop for Surface

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl DynResource for Surface

source§

fn as_any(&self) -> &dyn Any

source§

fn as_any_mut(&mut self) -> &mut dyn Any

source§

impl Surface for Surface

§

type A = Api

source§

unsafe fn configure( &self, device: &Device, config: &SurfaceConfiguration ) -> Result<(), SurfaceError>

Configure self to use device. Read more
source§

unsafe fn unconfigure(&self, device: &Device)

Unconfigure self on device. Read more
source§

unsafe fn acquire_texture( &self, timeout: Option<Duration>, fence: &Fence ) -> Result<Option<AcquiredSurfaceTexture<Api>>, SurfaceError>

Return the next texture to be presented by self, for the caller to draw on. Read more
source§

unsafe fn discard_texture(&self, _texture: SurfaceTexture)

Relinquish an acquired texture without presenting it. Read more

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<S> DynSurface for S
where S: Surface + DynResource,

source§

unsafe fn configure( &self, device: &(dyn DynDevice + 'static), config: &SurfaceConfiguration ) -> Result<(), SurfaceError>

source§

unsafe fn unconfigure(&self, device: &(dyn DynDevice + 'static))

source§

unsafe fn acquire_texture( &self, timeout: Option<Duration>, fence: &(dyn DynFence + 'static) ) -> Result<Option<DynAcquiredSurfaceTexture>, SurfaceError>

source§

unsafe fn discard_texture(&self, texture: Box<dyn DynSurfaceTexture>)

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,