Class VRCompositor
- java.lang.Object
-
- org.lwjgl.openvr.VRCompositor
-
public class VRCompositor extends java.lang.Object
Allows the application to interact with the compositor.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
nVRCompositor_GetCumulativeStats(long pStats, int nStatsSizeInBytes)
Unsafe version of:GetCumulativeStats
static void
nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __result)
Unsafe version of:GetCurrentFadeColor
static void
nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __functionAddress, long __result)
Unsafe version of:GetCurrentFadeColor
static boolean
nVRCompositor_GetFrameTiming(long pTiming, int unFramesAgo)
Unsafe version of:GetFrameTiming
static int
nVRCompositor_GetFrameTimings(long pTiming, int nFrames)
Unsafe version of:GetFrameTimings
static int
nVRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, long pOutputPose, long pOutputGamePose)
Unsafe version of:GetLastPoseForTrackedDeviceIndex
static int
nVRCompositor_GetLastPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)
Unsafe version of:GetLastPoses
static int
nVRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, long ppD3D11ShaderResourceView)
Unsafe version of:GetMirrorTextureD3D11
static int
nVRCompositor_GetMirrorTextureGL(int eEye, long pglTextureId, long pglSharedTextureHandle)
Unsafe version of:GetMirrorTextureGL
static int
nVRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, long pchValue, int unBufferSize)
Unsafe version of:GetVulkanDeviceExtensionsRequired
static int
nVRCompositor_GetVulkanInstanceExtensionsRequired(long pchValue, int unBufferSize)
Unsafe version of:GetVulkanInstanceExtensionsRequired
static int
nVRCompositor_SetSkyboxOverride(long pTextures, int unTextureCount)
Unsafe version of:SetSkyboxOverride
static int
nVRCompositor_SetStageOverride_Async(long pchRenderModelPath, long pTransform, long pRenderSettings, int nSizeOfRenderSettings)
Unsafe version of:SetStageOverride_Async
static int
nVRCompositor_Submit(int eEye, long pTexture, long pBounds, int nSubmitFlags)
Unsafe version of:Submit
static int
nVRCompositor_WaitGetPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)
Unsafe version of:WaitGetPoses
static boolean
VRCompositor_CanRenderScene()
Returns true if the current process has the scene focus.static void
VRCompositor_ClearLastSubmittedFrame()
Clears the frame that was sent with the last call to Submit.static void
VRCompositor_ClearSkyboxOverride()
Resets compositor skybox back to defaults.static void
VRCompositor_ClearStageOverride()
Resets the stage to its default user specified setting.static void
VRCompositor_CompositorBringToFront()
Brings the compositor window to the front.static void
VRCompositor_CompositorDumpImages()
Writes back buffer and stereo left/right pair from the application to a 'screenshots' folder in the SteamVR runtime root.static void
VRCompositor_CompositorGoToBack()
Pushes the compositor window to the back.static void
VRCompositor_CompositorQuit()
Tells the compositor process to clean up and exit.static void
VRCompositor_FadeGrid(float fSeconds, boolean bFadeIn)
Fading the Grid in or out infSeconds
.static void
VRCompositor_FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, boolean bBackground)
Fades the view on the HMD to the specified color.static void
VRCompositor_ForceInterleavedReprojectionOn(boolean bOverride)
Override interleaved reprojection logic to force on.static void
VRCompositor_ForceReconnectProcess()
Force reconnecting to the compositor process.static void
VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats)
Fills out stats accumulated for the last connected application.static void
VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats, int nStatsSizeInBytes)
Fills out stats accumulated for the last connected application.static HmdColor
VRCompositor_GetCurrentFadeColor(boolean bBackground, HmdColor __result)
Get current fade color value.static float
VRCompositor_GetCurrentGridAlpha()
Get current alpha value of grid.static int
VRCompositor_GetCurrentSceneFocusProcess()
Returns the process ID of the process that is currently rendering the scene.static float
VRCompositor_GetFrameTimeRemaining()
Returns the time in seconds left in the current (as identified by FrameTiming's frameIndex) frame.static boolean
VRCompositor_GetFrameTiming(CompositorFrameTiming.Buffer pTiming)
Returns true if timing data is filled it.static int
VRCompositor_GetFrameTimings(CompositorFrameTiming.Buffer pTiming)
Interface for copying a range of timing data.static int
VRCompositor_GetLastFrameRenderer()
Returns the process ID of the process that rendered the last frame (or 0 if the compositor itself rendered the frame).static int
VRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, TrackedDevicePose pOutputPose, TrackedDevicePose pOutputGamePose)
Interface for accessing last set of poses returned byWaitGetPoses
one at a time.static int
VRCompositor_GetLastPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)
Get the last set of poses returned byWaitGetPoses
.static int
VRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, org.lwjgl.PointerBuffer ppD3D11ShaderResourceView)
Opens a shared D3D11 texture with the undistorted composited image for each eye.static int
VRCompositor_GetMirrorTextureGL(int eEye, java.nio.IntBuffer pglTextureId, org.lwjgl.PointerBuffer pglSharedTextureHandle)
Access to mirror textures from OpenGL.static int
VRCompositor_GetTrackingSpace()
Gets current tracking space returned byWaitGetPoses
.static java.lang.String
VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, int unBufferSize)
Returns 0.static int
VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, java.nio.ByteBuffer pchValue)
Returns 0.static java.lang.String
VRCompositor_GetVulkanInstanceExtensionsRequired(int unBufferSize)
Returns 0.static int
VRCompositor_GetVulkanInstanceExtensionsRequired(java.nio.ByteBuffer pchValue)
Returns 0.static void
VRCompositor_HideMirrorWindow()
DEPRECATED: Closes the headset view, either as a window or docked widget.static boolean
VRCompositor_IsCurrentSceneFocusAppLoading()
Indicates whether or not the current scene focus app is currently loading.static boolean
VRCompositor_IsFullscreen()
Return whether the compositor is fullscreen.static boolean
VRCompositor_IsMirrorWindowVisible()
DEPRECATED: Returns true if the headset view (either as a window or docked widget) is shown.static boolean
VRCompositor_IsMotionSmoothingEnabled()
Indicates whether or not motion smoothing is enabled by the user settings.static boolean
VRCompositor_IsMotionSmoothingSupported()
Indicates whether or not motion smoothing is supported by the current hardware.static void
VRCompositor_LockGLSharedTextureForAccess(long glSharedTextureHandle)
static void
VRCompositor_PostPresentHandoff()
Call immediately after presenting your app's window (i.e.static void
VRCompositor_ReleaseMirrorTextureD3D11(long pD3D11ShaderResourceView)
Releases a shared D3D11 texture.static boolean
VRCompositor_ReleaseSharedGLTexture(int glTextureId, long glSharedTextureHandle)
static void
VRCompositor_SetExplicitTimingMode(int eTimingMode)
Vulkan/D3D12 Onlystatic int
VRCompositor_SetSkyboxOverride(Texture.Buffer pTextures)
Override the skybox used in the compositor (e.g.static int
VRCompositor_SetStageOverride_Async(java.lang.CharSequence pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)
Override the stage model used in the compositor to replace the grid.static int
VRCompositor_SetStageOverride_Async(java.nio.ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)
Override the stage model used in the compositor to replace the grid.static int
VRCompositor_SetStageOverride_Async(java.nio.ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings, int nSizeOfRenderSettings)
Override the stage model used in the compositor to replace the grid.static void
VRCompositor_SetTrackingSpace(int eOrigin)
Sets tracking space returned byWaitGetPoses
.static boolean
VRCompositor_ShouldAppRenderWithLowResources()
Let an app know it should be rendering with low resources.static void
VRCompositor_ShowMirrorWindow()
DEPRECATED: Opens the headset view (as either a window or docked widget depending on user's preferences) that displays what the user sees in the headset.static int
VRCompositor_Submit(int eEye, Texture pTexture, VRTextureBounds pBounds, int nSubmitFlags)
Updated scene texture to display.static int
VRCompositor_SubmitExplicitTimingData()
Vulkan/D3D12 Onlystatic void
VRCompositor_SuspendRendering(boolean bSuspend)
Temporarily suspends rendering (useful for finer control over scene transitions).static void
VRCompositor_UnlockGLSharedTextureForAccess(long glSharedTextureHandle)
static int
VRCompositor_WaitGetPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)
Scene applications should call this function to get poses to render with (and optionally poses predicted an additional frame out to use for gameplay).
-
-
-
Method Detail
-
VRCompositor_SetTrackingSpace
public static void VRCompositor_SetTrackingSpace(int eOrigin)
Sets tracking space returned byWaitGetPoses
.
-
VRCompositor_GetTrackingSpace
public static int VRCompositor_GetTrackingSpace()
Gets current tracking space returned byWaitGetPoses
.
-
nVRCompositor_WaitGetPoses
public static int nVRCompositor_WaitGetPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)
Unsafe version of:WaitGetPoses
-
VRCompositor_WaitGetPoses
public static int VRCompositor_WaitGetPoses(TrackedDevicePose.Buffer pRenderPoseArray, @Nullable TrackedDevicePose.Buffer pGamePoseArray)
Scene applications should call this function to get poses to render with (and optionally poses predicted an additional frame out to use for gameplay). This function will block until "running start" milliseconds before the start of the frame, and should be called at the last moment before needing to start rendering.
-
nVRCompositor_GetLastPoses
public static int nVRCompositor_GetLastPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)
Unsafe version of:GetLastPoses
-
VRCompositor_GetLastPoses
public static int VRCompositor_GetLastPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)
Get the last set of poses returned byWaitGetPoses
.
-
nVRCompositor_GetLastPoseForTrackedDeviceIndex
public static int nVRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, long pOutputPose, long pOutputGamePose)
Unsafe version of:GetLastPoseForTrackedDeviceIndex
-
VRCompositor_GetLastPoseForTrackedDeviceIndex
public static int VRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, @Nullable TrackedDevicePose pOutputPose, @Nullable TrackedDevicePose pOutputGamePose)
Interface for accessing last set of poses returned byWaitGetPoses
one at a time.It is okay to pass
NULL
for either pose if you only want one of the values.- Returns:
VR.EVRCompositorError_VRCompositorError_IndexOutOfRange
ifunDeviceIndex
not less thanVR.k_unMaxTrackedDeviceCount
otherwiseVR.EVRCompositorError_VRCompositorError_None
-
nVRCompositor_Submit
public static int nVRCompositor_Submit(int eEye, long pTexture, long pBounds, int nSubmitFlags)
Unsafe version of:Submit
-
VRCompositor_Submit
public static int VRCompositor_Submit(int eEye, Texture pTexture, @Nullable VRTextureBounds pBounds, int nSubmitFlags)
Updated scene texture to display.If
pBounds
isNULL
the entire texture will be used. If called from an OpenGL app, consider adding aglFlush
after submitting both frames to signal the driver to start processing, otherwise it may wait until the command buffer fills up, causing the app to miss frames.OpenGL dirty state: glBindTexture
- Parameters:
eEye
- one of:VR.EVREye_Eye_Left
VR.EVREye_Eye_Right
nSubmitFlags
- one of:VR.EVRSubmitFlags_Submit_Default
VR.EVRSubmitFlags_Submit_LensDistortionAlreadyApplied
VR.EVRSubmitFlags_Submit_GlRenderBuffer
VR.EVRSubmitFlags_Submit_Reserved
VR.EVRSubmitFlags_Submit_TextureWithDepth
- Returns:
- return codes:
- IsNotSceneApplication (make sure to call VR_Init with VRApplication_Scene)
- DoNotHaveFocus (some other app has taken focus)
- TextureIsOnWrongDevice (application did not use proper AdapterIndex - see IVRSystem.GetDXGIOutputInfo)
- SharedTexturesNotSupported (application needs to call CreateDXGIFactory1 or later before creating DX device)
- TextureUsesUnsupportedFormat (scene textures must be compatible with DXGI sharing rules - e.g. uncompressed, no mips, etc.)
- InvalidTexture (usually means bad arguments passed in)
- AlreadySubmitted (app has submitted two left textures or two right textures in a single frame - i.e. before calling WaitGetPoses again)
-
VRCompositor_ClearLastSubmittedFrame
public static void VRCompositor_ClearLastSubmittedFrame()
Clears the frame that was sent with the last call to Submit. This will cause the compositor to show the grid untilSubmit
is called again.
-
VRCompositor_PostPresentHandoff
public static void VRCompositor_PostPresentHandoff()
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
WaitGetPoses
immediately afterPresent()
. 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.
-
nVRCompositor_GetFrameTiming
public static boolean nVRCompositor_GetFrameTiming(long pTiming, int unFramesAgo)
Unsafe version of:GetFrameTiming
-
VRCompositor_GetFrameTiming
public static boolean VRCompositor_GetFrameTiming(CompositorFrameTiming.Buffer pTiming)
Returns true if timing data is filled it. Sets oldest timing info ifnFramesAgo
is larger than the stored history.Be sure to set
timing.size = sizeof(Compositor_FrameTiming)
on struct passed in before calling this function.
-
nVRCompositor_GetFrameTimings
public static int nVRCompositor_GetFrameTimings(long pTiming, int nFrames)
Unsafe version of:GetFrameTimings
-
VRCompositor_GetFrameTimings
public static int VRCompositor_GetFrameTimings(CompositorFrameTiming.Buffer pTiming)
Interface for copying a range of timing data. Frames are returned in ascending order (oldest to newest) with the last being the most recent frame. Only the first entry'sm_nSize
needs to be set, as the rest will be inferred from that. Returns total number of entries filled out.
-
VRCompositor_GetFrameTimeRemaining
public static float VRCompositor_GetFrameTimeRemaining()
Returns the time in seconds left in the current (as identified by FrameTiming's frameIndex) frame.Due to "running start", this value may roll over to the next frame before ever reaching 0.0.
-
nVRCompositor_GetCumulativeStats
public static void nVRCompositor_GetCumulativeStats(long pStats, int nStatsSizeInBytes)
Unsafe version of:GetCumulativeStats
-
VRCompositor_GetCumulativeStats
public static void VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats, int nStatsSizeInBytes)
Fills out stats accumulated for the last connected application.- Parameters:
nStatsSizeInBytes
- must besizeof( Compositor_CumulativeStats )
-
VRCompositor_GetCumulativeStats
public static void VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats)
Fills out stats accumulated for the last connected application.
-
VRCompositor_FadeToColor
public static void VRCompositor_FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, boolean bBackground)
Fades the view on the HMD to the specified color.The fade will take
fSeconds
, and the color values are between 0.0 and 1.0. This color is faded on top of the scene based on the alpha parameter. Removing the fade color instantly would beFadeToColor( 0.0, 0.0, 0.0, 0.0, 0.0 )
. Values are in un-premultiplied alpha space.
-
nVRCompositor_GetCurrentFadeColor
public static void nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __functionAddress, long __result) public static void nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __result)
Unsafe version of:GetCurrentFadeColor
-
VRCompositor_GetCurrentFadeColor
public static HmdColor VRCompositor_GetCurrentFadeColor(boolean bBackground, HmdColor __result)
Get current fade color value.
-
VRCompositor_FadeGrid
public static void VRCompositor_FadeGrid(float fSeconds, boolean bFadeIn)
Fading the Grid in or out infSeconds
.
-
VRCompositor_GetCurrentGridAlpha
public static float VRCompositor_GetCurrentGridAlpha()
Get current alpha value of grid.
-
nVRCompositor_SetSkyboxOverride
public static int nVRCompositor_SetSkyboxOverride(long pTextures, int unTextureCount)
Unsafe version of:SetSkyboxOverride
-
VRCompositor_SetSkyboxOverride
public static int VRCompositor_SetSkyboxOverride(Texture.Buffer pTextures)
Override the skybox used in the compositor (e.g. for during level loads when the app can't feed scene images fast enough)Order is Front, Back, Left, Right, Top, Bottom. If only a single texture is passed, it is assumed in lat-long format. If two are passed, it is assumed a lat-long stereo pair.
-
VRCompositor_ClearSkyboxOverride
public static void VRCompositor_ClearSkyboxOverride()
Resets compositor skybox back to defaults.
-
VRCompositor_CompositorBringToFront
public static void VRCompositor_CompositorBringToFront()
Brings the compositor window to the front. This is useful for covering any other window that may be on the HMD and is obscuring the compositor window.
-
VRCompositor_CompositorGoToBack
public static void VRCompositor_CompositorGoToBack()
Pushes the compositor window to the back. This is useful for allowing other applications to draw directly to the HMD.
-
VRCompositor_CompositorQuit
public static void VRCompositor_CompositorQuit()
Tells the compositor process to clean up and exit. You do not need to call this function at shutdown. Under normal circumstances the compositor will manage its own life cycle based on what applications are running.
-
VRCompositor_IsFullscreen
public static boolean VRCompositor_IsFullscreen()
Return whether the compositor is fullscreen.
-
VRCompositor_GetCurrentSceneFocusProcess
public static int VRCompositor_GetCurrentSceneFocusProcess()
Returns the process ID of the process that is currently rendering the scene.
-
VRCompositor_GetLastFrameRenderer
public static int VRCompositor_GetLastFrameRenderer()
Returns the process ID of the process that rendered the last frame (or 0 if the compositor itself rendered the frame).- Returns:
- 0 when fading out from an app and the app's process Id when fading into an app
-
VRCompositor_CanRenderScene
public static boolean VRCompositor_CanRenderScene()
Returns true if the current process has the scene focus.
-
VRCompositor_ShowMirrorWindow
public static void VRCompositor_ShowMirrorWindow()
DEPRECATED: Opens the headset view (as either a window or docked widget depending on user's preferences) that displays what the user sees in the headset.
-
VRCompositor_HideMirrorWindow
public static void VRCompositor_HideMirrorWindow()
DEPRECATED: Closes the headset view, either as a window or docked widget.
-
VRCompositor_IsMirrorWindowVisible
public static boolean VRCompositor_IsMirrorWindowVisible()
DEPRECATED: Returns true if the headset view (either as a window or docked widget) is shown.
-
VRCompositor_CompositorDumpImages
public static void VRCompositor_CompositorDumpImages()
Writes back buffer and stereo left/right pair from the application to a 'screenshots' folder in the SteamVR runtime root.
-
VRCompositor_ShouldAppRenderWithLowResources
public static boolean VRCompositor_ShouldAppRenderWithLowResources()
Let an app know it should be rendering with low resources.
-
VRCompositor_ForceInterleavedReprojectionOn
public static void VRCompositor_ForceInterleavedReprojectionOn(boolean bOverride)
Override interleaved reprojection logic to force on.
-
VRCompositor_ForceReconnectProcess
public static void VRCompositor_ForceReconnectProcess()
Force reconnecting to the compositor process.
-
VRCompositor_SuspendRendering
public static void VRCompositor_SuspendRendering(boolean bSuspend)
Temporarily suspends rendering (useful for finer control over scene transitions).
-
nVRCompositor_GetMirrorTextureD3D11
public static int nVRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, long ppD3D11ShaderResourceView)
Unsafe version of:GetMirrorTextureD3D11
-
VRCompositor_GetMirrorTextureD3D11
public static int VRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, org.lwjgl.PointerBuffer ppD3D11ShaderResourceView)
Opens a shared D3D11 texture with the undistorted composited image for each eye.Use
ReleaseMirrorTextureD3D11
when finished instead of calling Release on the resource itself.
-
VRCompositor_ReleaseMirrorTextureD3D11
public static void VRCompositor_ReleaseMirrorTextureD3D11(long pD3D11ShaderResourceView)
Releases a shared D3D11 texture.
-
nVRCompositor_GetMirrorTextureGL
public static int nVRCompositor_GetMirrorTextureGL(int eEye, long pglTextureId, long pglSharedTextureHandle)
Unsafe version of:GetMirrorTextureGL
-
VRCompositor_GetMirrorTextureGL
public static int VRCompositor_GetMirrorTextureGL(int eEye, java.nio.IntBuffer pglTextureId, org.lwjgl.PointerBuffer pglSharedTextureHandle)
Access to mirror textures from OpenGL.
-
VRCompositor_ReleaseSharedGLTexture
public static boolean VRCompositor_ReleaseSharedGLTexture(int glTextureId, long glSharedTextureHandle)
-
VRCompositor_LockGLSharedTextureForAccess
public static void VRCompositor_LockGLSharedTextureForAccess(long glSharedTextureHandle)
-
VRCompositor_UnlockGLSharedTextureForAccess
public static void VRCompositor_UnlockGLSharedTextureForAccess(long glSharedTextureHandle)
-
nVRCompositor_GetVulkanInstanceExtensionsRequired
public static int nVRCompositor_GetVulkanInstanceExtensionsRequired(long pchValue, int unBufferSize)
Unsafe version of:GetVulkanInstanceExtensionsRequired
-
VRCompositor_GetVulkanInstanceExtensionsRequired
public static int VRCompositor_GetVulkanInstanceExtensionsRequired(@Nullable java.nio.ByteBuffer pchValue) public static java.lang.String VRCompositor_GetVulkanInstanceExtensionsRequired(int unBufferSize)
Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of-required instance extensions to enable inVkCreateInstance
.
-
nVRCompositor_GetVulkanDeviceExtensionsRequired
public static int nVRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, long pchValue, int unBufferSize)
Unsafe version of:GetVulkanDeviceExtensionsRequired
-
VRCompositor_GetVulkanDeviceExtensionsRequired
public static int VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, @Nullable java.nio.ByteBuffer pchValue) public static java.lang.String VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, int unBufferSize)
Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of required device extensions to enable inVkCreateDevice
.
-
VRCompositor_SetExplicitTimingMode
public static void VRCompositor_SetExplicitTimingMode(int eTimingMode)
Vulkan/D3D12 Only
There are two purposes for
SetExplicitTimingMode
:- To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications.
- (Optional) To avoid having
WaitGetPoses
access the Vulkan queue so that the queue can be accessed from another thread whileWaitGetPoses
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 duringWaitGetPoses
. In D3D11,WaitGetPoses
queues a GPU timestamp write, but it does not actually get submitted to the GPU until the application flushes. By usingSubmitExplicitTimingData
, 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 usingSetExplicitTimingMode
as well. If this is desired, the application should set the timing mode toVR.EVRCompositorTimingMode_VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff
and MUST callPostPresentHandoff
itself. If these conditions are met, thenWaitGetPoses
is guaranteed not to access the queue. Note thatPostPresentHandoff
andSubmitExplicitTimingData
will access the queue, so onlyWaitGetPoses
becomes safe for accessing the queue from another thread.
-
VRCompositor_SubmitExplicitTimingData
public static int VRCompositor_SubmitExplicitTimingData()
Vulkan/D3D12 Only
Submit explicit timing data. When
SetExplicitTimingMode
is true, this must be called immediately before the application's firstvkQueueSubmit
(Vulkan) orID3D12CommandQueue::ExecuteCommandLists
(D3D12) of each frame. This function will insert a GPU timestamp write just before the application starts its rendering. This function will perform avkQueueSubmit
on Vulkan so must not be done simultaneously withVkQueue
operations on another thread.- Returns:
VR.EVRCompositorError_VRCompositorError_RequestFailed
ifSetExplicitTimingMode
is not enabled
-
VRCompositor_IsMotionSmoothingEnabled
public static boolean VRCompositor_IsMotionSmoothingEnabled()
Indicates whether or not motion smoothing is enabled by the user settings.If you want to know if motion smoothing actually triggered due to a late frame, check
CompositorFrameTiming
m_nReprojectionFlags
&VRCompositor_ReprojectionMotion
instead.
-
VRCompositor_IsMotionSmoothingSupported
public static boolean VRCompositor_IsMotionSmoothingSupported()
Indicates whether or not motion smoothing is supported by the current hardware.
-
VRCompositor_IsCurrentSceneFocusAppLoading
public static boolean VRCompositor_IsCurrentSceneFocusAppLoading()
Indicates whether or not the current scene focus app is currently loading.This is inferred from its use of
FadeGrid
to explicitly fade to the compositor to cover up the fact that it cannot render at a sustained full framerate during this time.
-
nVRCompositor_SetStageOverride_Async
public static int nVRCompositor_SetStageOverride_Async(long pchRenderModelPath, long pTransform, long pRenderSettings, int nSizeOfRenderSettings)
Unsafe version of:SetStageOverride_Async
-
VRCompositor_SetStageOverride_Async
public static int VRCompositor_SetStageOverride_Async(java.nio.ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings, int nSizeOfRenderSettings) public static int VRCompositor_SetStageOverride_Async(java.nio.ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings) public static int VRCompositor_SetStageOverride_Async(java.lang.CharSequence pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)
Override the stage model used in the compositor to replace the grid.RenderModelPath
is a full path the an OBJ file to load. This file will be loaded asynchronously from disk and uploaded to the gpu by the runtime. Once ready for rendering, the VREventVR.EVREventType_VREvent_Compositor_StageOverrideReady
will be sent. UseFadeToGrid
to reveal. CallClearStageOverride
to free the associated resources when finished.
-
VRCompositor_ClearStageOverride
public static void VRCompositor_ClearStageOverride()
Resets the stage to its default user specified setting.
-
-