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 !Freeze for Surface
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