Varjo Native Experimental SDK
Varjo_mr_experimental.h File Reference

Go to the source code of this file.

Functions

VARJO_EXPERIMENTAL_API void varjo_MRResetVideoDepthTest (struct varjo_Session *session)
 Reset video pass-through layer depth test mode and range to defaults. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestMode (struct varjo_Session *session, varjo_VideoDepthTestMode mode, varjo_VideoDepthTestBehavior behavior)
 Set video pass-through layer depth test mode. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestRange (struct varjo_Session *session, double nearZ, double farZ)
 Set video pass-through layer depth test range. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSetShader (struct varjo_Session *session, varjo_ShaderType shaderType, varjo_Bool enabled)
 Turn shader on/off. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRD3D11ConfigureShader (struct varjo_Session *session, struct ID3D11Device *device, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
 Configure the shader and the input layout with D3D11 texture support. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRD3D12ConfigureShader (struct varjo_Session *session, struct ID3D12CommandQueue *commandQueue, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
 Configure the shader and the input layout with D3D12 texture support. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRGLConfigureShader (struct varjo_Session *session, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
 Configure the shader and the input layout with OpenGL texture support. More...
 
VARJO_EXPERIMENTAL_API struct varjo_Texture varjo_MRAcquireShaderTexture (struct varjo_Session *session, varjo_ShaderType shaderType, int32_t index)
 Acquires write lock of a shader input texture. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRReleaseShaderTexture (struct varjo_Session *session, varjo_ShaderType shaderType, int32_t index)
 Releases the acquired input texture (varjo_MRAcquireShaderTexture). More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSubmitShaderInputs (struct varjo_Session *session, varjo_ShaderType shaderType, const int32_t *textureIndices, int32_t numTextureIndices, const char *constantBufferData, int32_t constantBufferSize)
 Submits updates made to input textures and/or constant buffer. More...
 
VARJO_EXPERIMENTAL_API int32_t varjo_MRGetSupportedShaderTextureFormatCount (struct varjo_Session *session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType)
 Get amount of supported texture formats. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRGetSupportedShaderTextureFormats (struct varjo_Session *session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType, varjo_TextureFormat *formats, int32_t maxSize)
 Get supported texture formats. More...
 
VARJO_EXPERIMENTAL_API varjo_DXGITextureFormat varjo_ToDXGIFormat (struct varjo_Session *session, varjo_TextureFormat format)
 Converts varjo_TextureFormat to DXGI_FORMAT. More...
 
VARJO_EXPERIMENTAL_API struct varjo_GLTextureFormat varjo_ToGLFormat (struct varjo_Session *session, varjo_TextureFormat format)
 Converts varjo_TextureFormat to GL format. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSetReconstruction (struct varjo_Session *session, varjo_Bool enabled)
 Start or stop 3D reconstruction. More...
 
VARJO_EXPERIMENTAL_API struct varjo_ReconstructionConfig varjo_MRGetReconstructionConfig (struct varjo_Session *session)
 Get currently applied 3D reconstruction configuration. More...
 
VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotId varjo_MRBeginPointCloudSnapshot (struct varjo_Session *session)
 Schedule a snapshot to be captured the next time point cloud is updated and start saving deltas. More...
 
VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotStatus varjo_MRGetPointCloudSnapshotStatus (struct varjo_Session *session, varjo_PointCloudSnapshotId id)
 Poll snapshot computation status. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRGetPointCloudSnapshotContent (struct varjo_Session *session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudSnapshotContent *content)
 Get pointer to snapshot content. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRReleasePointCloudSnapshot (struct varjo_Session *session, varjo_PointCloudSnapshotId id)
 Release snapshot. More...
 
VARJO_EXPERIMENTAL_API void varjo_MREndPointCloudSnapshot (struct varjo_Session *session, varjo_PointCloudSnapshotId id)
 Ends the snapshot, deltas will no longer be saved. More...
 
VARJO_EXPERIMENTAL_API varjo_Bool varjo_MRGetPointCloudDelta (struct varjo_Session *session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudDeltaContent *content)
 Get the oldest delta that is built on top of the given snapshot and that has not yet been released. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRPopPointCloudDelta (struct varjo_Session *session, varjo_PointCloudSnapshotId id)
 Release the oldest delta that is built on top of the given snapshot. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRSetMeshReconstruction (struct varjo_Session *session, varjo_Bool enabled)
 Start or stop 3D reconstruction meshing. More...
 
VARJO_EXPERIMENTAL_API struct varjo_MeshReconstructionConfig varjo_MRGetMeshReconstructionConfig (struct varjo_Session *session)
 Get currently applied 3D reconstruction meshing configuration. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkDescriptions (struct varjo_Session *session, varjo_Nanoseconds updatedAfter, struct varjo_MeshChunkDescription *buffer, int32_t bufferSize, int32_t *chunkCount)
 Get all reconstruction mesh chunks updated after a given timestamp. More...
 
VARJO_EXPERIMENTAL_API varjo_MeshChunkContentsBufferId varjo_MRLockMeshChunkContentsBuffer (struct varjo_Session *session, const struct varjo_Vector3Di *positions, int32_t count)
 Lock mesh chunk contents buffer for reading. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkContentsBufferData (struct varjo_Session *session, varjo_MeshChunkContentsBufferId id, struct varjo_MeshChunkContent *chunkContents)
 Get mesh chunk contents from mesh chunk contents buffer. More...
 
VARJO_EXPERIMENTAL_API void varjo_MRUnlockMeshChunkContentsBuffer (struct varjo_Session *session, varjo_MeshChunkContentsBufferId id)
 Unlock already locked chunk contents buffer. More...
 

Function Documentation

◆ varjo_MRAcquireShaderTexture()

VARJO_EXPERIMENTAL_API struct varjo_Texture varjo_MRAcquireShaderTexture ( struct varjo_Session *  session,
varjo_ShaderType  shaderType,
int32_t  index 
)

Acquires write lock of a shader input texture.

To be able to access the textures the shader must have been configured shader to use textures (varjo_MRxxxConfigureShader calls).

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

This must be called prior to texture update. The returned texture handle is only valid between this call and varjo_MRReleaseShaderTexture and should therefore be discarded after the release.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_InvalidShaderType, varjo_Error_InvalidTextureIndex varjo_Error_TextureLockFailed

Parameters
sessionVarjo session handle.
shaderTypeShader type.
indexIndex of shader's texture input slot.
Returns
Locked texture handle. Use varjo_ToD3D11Texture to cast into DX11 handle.

◆ varjo_MRBeginPointCloudSnapshot()

VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotId varjo_MRBeginPointCloudSnapshot ( struct varjo_Session *  session)

Schedule a snapshot to be captured the next time point cloud is updated and start saving deltas.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.

◆ varjo_MRD3D11ConfigureShader()

VARJO_EXPERIMENTAL_API void varjo_MRD3D11ConfigureShader ( struct varjo_Session *  session,
struct ID3D11Device *  device,
varjo_ShaderType  shaderType,
const struct varjo_ShaderConfig config,
const char *  shaderData,
int32_t  shaderSize 
)

Configure the shader and the input layout with D3D11 texture support.

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock. Releasing the lock will disable the shader and reset post process shader state.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_RenderAPINotInitialized, varjo_Error_InvalidShaderType, varjo_Error_InvalidShaderFormat, varjo_Error_InvalidInputLayout, varjo_Error_InvalidComputeBlockSize, varjo_Error_InvalidSamplingMargin, varjo_Error_InvalidConstantBufferSize, varjo_Error_InvalidTextureDimensions, varjo_Error_InvalidTextureFormat, varjo_Error_InvalidShaderSize, varjo_Error_InvalidShader

Parameters
sessionVarjo session handle.
deviceD3D11 device to be used.
shaderTypeShader type.
configShader config pointer. See varjo_ShaderConfig for more details.
shaderDataPointer to shader data. Data format is specified in varjo_ShaderConfig::format.
shaderSizeShader data size in bytes.

◆ varjo_MRD3D12ConfigureShader()

VARJO_EXPERIMENTAL_API void varjo_MRD3D12ConfigureShader ( struct varjo_Session *  session,
struct ID3D12CommandQueue *  commandQueue,
varjo_ShaderType  shaderType,
const struct varjo_ShaderConfig config,
const char *  shaderData,
int32_t  shaderSize 
)

Configure the shader and the input layout with D3D12 texture support.

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock. Releasing the lock will disable the shader and reset post process shader state.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_RenderAPINotInitialized, varjo_Error_InvalidShaderType, varjo_Error_InvalidShaderFormat, varjo_Error_InvalidInputLayout, varjo_Error_InvalidComputeBlockSize, varjo_Error_InvalidSamplingMargin, varjo_Error_InvalidConstantBufferSize, varjo_Error_InvalidTextureDimensions, varjo_Error_InvalidTextureFormat, varjo_Error_InvalidShaderSize, varjo_Error_InvalidShader

Parameters
sessionVarjo session handle.
commandQueueD3D12 command queue to be used.
shaderTypeShader type.
configShader config pointer. See varjo_ShaderConfig for more details.
shaderDataPointer to shader data. Data format is specified in varjo_ShaderConfig::format.
shaderSizeShader data size in bytes.

◆ varjo_MREndPointCloudSnapshot()

VARJO_EXPERIMENTAL_API void varjo_MREndPointCloudSnapshot ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id 
)

Ends the snapshot, deltas will no longer be saved.

If snapshot or any deltas are unreleased, they are released.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
idId of the snapshot.

◆ varjo_MRGetMeshChunkContentsBufferData()

VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkContentsBufferData ( struct varjo_Session *  session,
varjo_MeshChunkContentsBufferId  id,
struct varjo_MeshChunkContent chunkContents 
)

Get mesh chunk contents from mesh chunk contents buffer.

The buffer must be locked (varjo_MRLockMeshChunkContentsBuffer) before calling this function.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable varjo_Error_ChunkContentsBufferNotLocked, varjo_Error_ChunkContentsBufferInvalidId

Parameters
sessionVarjo session handle.
idId of the already locked mesh chunk contents buffer.
chunkContentsOutput array for mesh chunk contents. Size must equal the count passed to varjo_MRLockMeshChunkContentsBuffer.

◆ varjo_MRGetMeshChunkDescriptions()

VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkDescriptions ( struct varjo_Session *  session,
varjo_Nanoseconds  updatedAfter,
struct varjo_MeshChunkDescription buffer,
int32_t  bufferSize,
int32_t *  chunkCount 
)

Get all reconstruction mesh chunks updated after a given timestamp.

The 3D reconstruction is subdivided into a grid of chunks. The resolution of the grid may be retrieved with varjo_MRGetMeshReconstructionConfig. Chunk contents may be accessed using varjo_MRLockMeshChunkContentsBuffer.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable varjo_Error_InvalidSize

Parameters
sessionVarjo session handle.
updatedAfterOnly chunks updated after this timestamp are returned. If 0, all non-empty chunks are returned.
bufferOutput array for chunk descriptions.
bufferSizeSize of the output buffer.
chunkCountNumber of chunks written to the buffer.

◆ varjo_MRGetMeshReconstructionConfig()

VARJO_EXPERIMENTAL_API struct varjo_MeshReconstructionConfig varjo_MRGetMeshReconstructionConfig ( struct varjo_Session *  session)

Get currently applied 3D reconstruction meshing configuration.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.

◆ varjo_MRGetPointCloudDelta()

VARJO_EXPERIMENTAL_API varjo_Bool varjo_MRGetPointCloudDelta ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id,
struct varjo_PointCloudDeltaContent content 
)

Get the oldest delta that is built on top of the given snapshot and that has not yet been released.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable, varjo_Error_NullPointer

Parameters
sessionVarjo session handle.
idId of the snapshot.
contentOutput struct for delta content.
Returns
False, if no new deltas are available yet.

◆ varjo_MRGetPointCloudSnapshotContent()

VARJO_EXPERIMENTAL_API void varjo_MRGetPointCloudSnapshotContent ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id,
struct varjo_PointCloudSnapshotContent content 
)

Get pointer to snapshot content.

Snapshot status must be varjo_PointCloudSnapshotStatus_Ready.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable, varjo_Error_NullPointer

Parameters
sessionVarjo session handle.
idId of the snapshot.
contentOutput struct for snapshot content.

◆ varjo_MRGetPointCloudSnapshotStatus()

VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotStatus varjo_MRGetPointCloudSnapshotStatus ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id 
)

Poll snapshot computation status.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
idId of the snapshot.

◆ varjo_MRGetReconstructionConfig()

VARJO_EXPERIMENTAL_API struct varjo_ReconstructionConfig varjo_MRGetReconstructionConfig ( struct varjo_Session *  session)

Get currently applied 3D reconstruction configuration.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.

◆ varjo_MRGetSupportedShaderTextureFormatCount()

VARJO_EXPERIMENTAL_API int32_t varjo_MRGetSupportedShaderTextureFormatCount ( struct varjo_Session *  session,
varjo_RenderAPI  renderAPI,
varjo_ShaderType  shaderType 
)

Get amount of supported texture formats.

Possible errors: varjo_Error_InvalidShaderType

Parameters
sessionVarjo session handle.
renderAPIRender API type.
shaderTypeShader type.
Returns
Number of supported texture formats.

◆ varjo_MRGetSupportedShaderTextureFormats()

VARJO_EXPERIMENTAL_API void varjo_MRGetSupportedShaderTextureFormats ( struct varjo_Session *  session,
varjo_RenderAPI  renderAPI,
varjo_ShaderType  shaderType,
varjo_TextureFormat formats,
int32_t  maxSize 
)

Get supported texture formats.

Use varjo_MRGetSupportedShaderTextureFormatCount to get the count of the formats. Use varjo_ToDXGIFormat and varjo_ToGLFormat for getting native texture formats.

Possible errors: varjo_Error_InvalidShaderType, varjo_Error_NullPointer

Parameters
sessionVarjo session handle.
renderAPIRender API type.
shaderTypeShader type.
formatsOutput parameter for the list of supported formats.
maxSizeSize of formats array.

◆ varjo_MRGLConfigureShader()

VARJO_EXPERIMENTAL_API void varjo_MRGLConfigureShader ( struct varjo_Session *  session,
varjo_ShaderType  shaderType,
const struct varjo_ShaderConfig config,
const char *  shaderData,
int32_t  shaderSize 
)

Configure the shader and the input layout with OpenGL texture support.

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock. Releasing the lock will disable the shader and reset post process shader state.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_RenderAPINotInitialized, varjo_Error_InvalidShaderType, varjo_Error_InvalidShaderFormat, varjo_Error_InvalidInputLayout, varjo_Error_InvalidComputeBlockSize, varjo_Error_InvalidSamplingMargin, varjo_Error_InvalidConstantBufferSize, varjo_Error_InvalidTextureDimensions, varjo_Error_InvalidTextureFormat, varjo_Error_InvalidShaderSize, varjo_Error_InvalidShader

Parameters
sessionVarjo session handle.
shaderTypeShader type.
configShader config pointer. See varjo_ShaderConfig for more details.
shaderDataPointer to shader data. Data format is specified in varjo_ShaderConfig::format.
shaderSizeShader data size in bytes.

◆ varjo_MRLockMeshChunkContentsBuffer()

VARJO_EXPERIMENTAL_API varjo_MeshChunkContentsBufferId varjo_MRLockMeshChunkContentsBuffer ( struct varjo_Session *  session,
const struct varjo_Vector3Di positions,
int32_t  count 
)

Lock mesh chunk contents buffer for reading.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable varjo_Error_ChunkContentsBufferAlreadyLocked, varjo_Error_InvalidSize

Parameters
sessionVarjo session handle.
positionsArray of positions of the chunks to be locked.
countSize of the positions array.
Returns
Chunk contents buffer id, may be used to access the contents using varjo_MRGetMeshChunkContentsBufferData.

◆ varjo_MRPopPointCloudDelta()

VARJO_EXPERIMENTAL_API void varjo_MRPopPointCloudDelta ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id 
)

Release the oldest delta that is built on top of the given snapshot.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
idId of the snapshot.

◆ varjo_MRReleasePointCloudSnapshot()

VARJO_EXPERIMENTAL_API void varjo_MRReleasePointCloudSnapshot ( struct varjo_Session *  session,
varjo_PointCloudSnapshotId  id 
)

Release snapshot.

Deltas continue being saved until the snapshot is ended.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
idId of the snapshot.

◆ varjo_MRReleaseShaderTexture()

VARJO_EXPERIMENTAL_API void varjo_MRReleaseShaderTexture ( struct varjo_Session *  session,
varjo_ShaderType  shaderType,
int32_t  index 
)

Releases the acquired input texture (varjo_MRAcquireShaderTexture).

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

After releasing the corresponding varjo_Texture should not be used anymore.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_InvalidShaderType, varjo_Error_InvalidTextureIndex, varjo_Error_TextureNotAcquired

Parameters
sessionVarjo session handle.
shaderTypeShader type.
indexIndex of shader's texture input slot.

◆ varjo_MRResetVideoDepthTest()

VARJO_EXPERIMENTAL_API void varjo_MRResetVideoDepthTest ( struct varjo_Session *  session)

Reset video pass-through layer depth test mode and range to defaults.

Note: varjo_LockType_VideoDepthTest lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

By default, varjo_VideoDepthTestMode_LimitedRange mode and varjo_VideoDepthTestBehavior_PreferLayerRange behavior are used. The default video depth test range is 0..0.75m.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked

Parameters
sessionVarjo session handle.

◆ varjo_MRSetMeshReconstruction()

VARJO_EXPERIMENTAL_API void varjo_MRSetMeshReconstruction ( struct varjo_Session *  session,
varjo_Bool  enabled 
)

Start or stop 3D reconstruction meshing.

Note
: This feature requires Varjo Base Pro license.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
enabledOn/off toggle.

◆ varjo_MRSetReconstruction()

VARJO_EXPERIMENTAL_API void varjo_MRSetReconstruction ( struct varjo_Session *  session,
varjo_Bool  enabled 
)

Start or stop 3D reconstruction.

Note
: This feature requires Varjo Base Pro license.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable

Parameters
sessionVarjo session handle.
enabledOn/off toggle.

◆ varjo_MRSetShader()

VARJO_EXPERIMENTAL_API void varjo_MRSetShader ( struct varjo_Session *  session,
varjo_ShaderType  shaderType,
varjo_Bool  enabled 
)

Turn shader on/off.

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock. Releasing the lock will disable the shader and reset post process shader state.

Note
: This feature requires Varjo Base Pro license.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_InvalidShaderType

Parameters
sessionVarjo session handle.
shaderTypeShader type to be toggled on/off.
enabledIs shader to be enabled or disabled.

◆ varjo_MRSetVideoDepthTestMode()

VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestMode ( struct varjo_Session *  session,
varjo_VideoDepthTestMode  mode,
varjo_VideoDepthTestBehavior  behavior 
)

Set video pass-through layer depth test mode.

Note: varjo_LockType_VideoDepthTest lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

See varjo_VideoDepthTestMode for available modes. See varjo_VideoDepthTestBehavior for available range combination behaviors.

If varjo_VideoDepthTestMode_ForcedRange mode is used, video pass-through rendering and video depth occlusion are also globally enabled to allow this to be used with pure VR applications without any mixed reality support.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked

Parameters
sessionVarjo session handle.
modeVideo depth test operating mode.
behaviorVideo depth test range behavior with application layer depth test range.

◆ varjo_MRSetVideoDepthTestRange()

VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestRange ( struct varjo_Session *  session,
double  nearZ,
double  farZ 
)

Set video pass-through layer depth test range.

Note: varjo_LockType_VideoDepthTest lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

How ranges are used in different modes: varjo_VideoDepthTestMode_Full - Range limits are not used. varjo_VideoDepthTestMode_LimitedRange - Video pass-through depth test is limited to given range. varjo_VideoDepthTestMode_ForcedRange - As previous, but farZ is also used as fixed depth for layers not providing depth.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked

Parameters
sessionVarjo session handle.
nearZVideo pass-through depth test range near limit.
farZVideo pass-through depth test range far limit.

◆ varjo_MRSubmitShaderInputs()

VARJO_EXPERIMENTAL_API void varjo_MRSubmitShaderInputs ( struct varjo_Session *  session,
varjo_ShaderType  shaderType,
const int32_t *  textureIndices,
int32_t  numTextureIndices,
const char *  constantBufferData,
int32_t  constantBufferSize 
)

Submits updates made to input textures and/or constant buffer.

Note: varjo_LockType_VideoPostProcessShader lock must be held for this function to succeed. Use varjo_Lock to obtain the lock.

This function applies clients changes to Varjo stack. It does not need to be called on every frame necesssarily: only when the inputs need to be updated.

Updates all provided inputs (textures and constant buffer) atomically. Multiple calls to this function can also be used to update indices and/or constant buffer separately and therefore non-atomically.

If any of the textures being submitted is currently in locked state (acquired, but not released), this call fails.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_NotLocked, varjo_Error_InvalidShaderType, varjo_Error_TexturesLocked, varjo_Error_InvalidTextureIndex, varjo_Error_InvalidConstantBufferSize

Parameters
sessionVarjo session handle.
shaderTypeShader type.
textureIndicesList of texture input slot indices that have been updated. Can be 'nullptr' if no texture update is needed.
numTextureIndicesNumber of texture indices. Maximum number is the amount of shader texture slots.
constantBufferDataByte array of constant buffer data. Can be 'nullptr' if no constant buffer update is needed.
constantBufferSizeNumber of bytes in constant buffer byte array.

◆ varjo_MRUnlockMeshChunkContentsBuffer()

VARJO_EXPERIMENTAL_API void varjo_MRUnlockMeshChunkContentsBuffer ( struct varjo_Session *  session,
varjo_MeshChunkContentsBufferId  id 
)

Unlock already locked chunk contents buffer.

Possible errors: varjo_Error_OperationFailed, varjo_Error_NotAvailable, varjo_Error_CapabilityNotAvailable varjo_Error_ChunkContentsBufferNotLocked, varjo_Error_ChunkContentsBufferInvalidId

Parameters
sessionVarjo session handle.
idId of the already locked mesh chunk contents buffer.

◆ varjo_ToDXGIFormat()

VARJO_EXPERIMENTAL_API varjo_DXGITextureFormat varjo_ToDXGIFormat ( struct varjo_Session *  session,
varjo_TextureFormat  format 
)

Converts varjo_TextureFormat to DXGI_FORMAT.

Possible errors: varjo_Error_InvalidTextureFormat

Parameters
sessionVarjo session handle.
formatVarjo texture format to convert.
Returns
Corresponding DXGI_FORMAT or DXGI_FORMAT_UNKNOWN if the mapping does not exist.

◆ varjo_ToGLFormat()

VARJO_EXPERIMENTAL_API struct varjo_GLTextureFormat varjo_ToGLFormat ( struct varjo_Session *  session,
varjo_TextureFormat  format 
)

Converts varjo_TextureFormat to GL format.

Possible errors: varjo_Error_InvalidTextureFormat

Parameters
sessionVarjo session handle.
formatVarjo texture format to convert.
Returns
Corresponding GL texture formats or GL_NONE if the mapping does not exist.