pub struct Surface { /* private fields */ }
Available on
vulkan
only.Implementations§
source§impl Surface
impl Surface
sourcepub fn raw_swapchain(&self) -> Option<SwapchainKHR>
pub fn raw_swapchain(&self) -> Option<SwapchainKHR>
Get the raw Vulkan swapchain associated with this surface.
Returns None
if the surface is not configured.
sourcepub fn set_next_present_time(&self, present_timing: PresentTimeGOOGLE)
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
- If the surface hasn’t been configured.
- If the device doesn’t support present timing.
Trait Implementations§
source§impl DynResource for Surface
impl DynResource for Surface
source§impl Surface for Surface
impl Surface for Surface
type A = Api
source§unsafe fn configure(
&self,
device: &Device,
config: &SurfaceConfiguration
) -> Result<(), SurfaceError>
unsafe fn configure( &self, device: &Device, config: &SurfaceConfiguration ) -> Result<(), SurfaceError>
source§unsafe fn unconfigure(&self, device: &Device)
unsafe fn unconfigure(&self, device: &Device)
source§unsafe fn acquire_texture(
&self,
timeout: Option<Duration>,
fence: &Fence
) -> Result<Option<AcquiredSurfaceTexture<Api>>, SurfaceError>
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 moresource§unsafe fn discard_texture(&self, _texture: SurfaceTexture)
unsafe fn discard_texture(&self, _texture: SurfaceTexture)
Relinquish an acquired texture without presenting it. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl !UnwindSafe for Surface
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
Mutably borrows from an owned value. Read more