[][src]Struct openvr::Compositor

pub struct Compositor(_);

Methods

impl Compositor[src]

pub fn vulkan_instance_extensions_required(&self) -> Vec<CString>[src]

pub unsafe fn vulkan_device_extensions_required(
    &self,
    physical_device: *mut VkPhysicalDevice_T
) -> Vec<CString>
[src]

Safety: physical_device must be a valid VkPhysicalDevice

pub fn set_tracking_space(&self, origin: TrackingUniverseOrigin)[src]

Sets tracking space returned by WaitGetPoses

pub fn wait_get_poses(&self) -> Result<WaitPoses, CompositorError>[src]

Block until a few milliseconds before the next vsync, then return poses for the next step of rendering and game logic.

Poses are relative to the origin set by set_tracking_space.

pub unsafe fn submit(
    &self,
    eye: Eye,
    texture: &Texture,
    bounds: Option<&Bounds>,
    pose: Option<[[f32; 4]; 3]>
) -> Result<(), CompositorError>
[src]

Display the supplied texture for the next frame.

If bounds is None, the entire texture will be used. Lens distortion is handled by the OpenVR implementation.

Safety

The handles you supply must be valid and comply with the graphics API's synchronization requirements.

pub fn post_present_handoff(&self)[src]

Call immediately after presenting your app's window (i.e. companion window) to unblock the compositor.

This is an optional call, which only needs to be used if you can't instead call wait_get_poses immediately after submitting frames. For example, if your engine's render and game loop are not on separate threads, or blocking the render thread until 3ms before the next vsync would introduce a deadlock of some sort. This function tells the compositor that you have finished all rendering after having Submitted buffers for both eyes, and it is free to start its rendering work. This should only be called from the same thread you are rendering on.

pub fn is_fullscreen(&self) -> bool[src]

Return whether the compositor is fullscreen.

pub fn clear_last_submitted_frame(&self)[src]

Clears the frame that was sent with the last call to `submit.

This will cause the compositor to show the grid until submit is called again.

pub fn set_explicit_timing_mode(&self, mode: bool)[src]

Controls whether the application should flag the time at which the frame begins explicitly

Vulkan/D3D12 Only There are two purposes for SetExplicitTimingMode:

  1. To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications.
  2. (Optional) To avoid having WaitGetPoses access the Vulkan queue so that the queue can be accessed from another thread while WaitGetPoses is executing.

More accurate GPU timestamp for the start of the frame is achieved by the application calling SubmitExplicitTimingData immediately before its first submission to the Vulkan/D3D12 queue. This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11, WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for Vulkan/D3D12 as it is for D3D11, resulting in a more accurate GPU time measurement for the frame.

Avoiding WaitGetPoses accessing the Vulkan queue can be achieved using SetExplicitTimingMode as well. If this is desired, the application MUST call PostPresentHandoff itself prior to WaitGetPoses. If SetExplicitTimingMode is true and the application calls PostPresentHandoff, then WaitGetPoses is guaranteed not to access the queue. Note that PostPresentHandoff and SubmitExplicitTimingData will access the queue, so only WaitGetPoses becomes safe for accessing the queue from another thread.

pub fn submit_explicit_timing_data(&self) -> Result<(), CompositorError>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]