Varjo Native SDK
Varjo_types_layers.h File Reference

Go to the source code of this file.

Data Structures

struct  varjo_SwapChainConfig2
 Swap chain configuration structure. More...
 
struct  varjo_SwapChainViewport
 Swap chain image source rectangle. More...
 
struct  varjo_LayerHeader
 Layer header for different submission layer types. More...
 
struct  varjo_ViewExtension
 View Extension header. More...
 
struct  varjo_ViewExtensionDepth
 A varjo_LayerMultiProjView extension that allows submission of a depth surface alongside the color surface for a view. More...
 
struct  varjo_ViewExtensionDepthTestRange
 A varjo_LayerMultiProjView extension that defines range for which the depth test is enabled. More...
 
struct  varjo_ViewExtensionVelocity
 A varjo_LayerMultiProjView extension that allows submission of a pixel velocity surface alongside the color surface for a view. More...
 
struct  varjo_ViewExtensionBlendControlMask
 A varjo_LayerMultiProjView extension that defines blend control masking layer flags. More...
 
struct  varjo_LayerMultiProjView
 A single view in a Multi-projection layer. More...
 
struct  varjo_LayerMultiProj
 Layer type describing a set of planar projected images rendered from the perspective of each eye. More...
 
struct  varjo_SubmitInfoLayers
 A structure describing the list of layers that the application submits to the compositor each frame. More...
 

Typedefs

typedef int64_t varjo_LayerType
 
typedef int64_t varjo_LayerFlags
 
typedef int64_t varjo_Space
 
typedef int64_t varjo_ViewExtensionType
 
typedef int64_t varjo_BlendControlMaskingMode
 Masking mode type. More...
 
typedef int64_t varjo_BlendControlDebugMode
 Debug mode type. More...
 

Variables

static const varjo_LayerType varjo_LayerMultiProjType = 0x1
 Layer type enum corresponding to varjo_LayerMultiProj. More...
 
static const varjo_LayerFlags varjo_LayerFlagNone = 0x0
 Default layer rendering. More...
 
static const varjo_LayerFlags varjo_LayerFlag_BlendMode_AlphaBlend = 0x2
 Set blend mode to be alpha blend. More...
 
static const varjo_LayerFlags varjo_LayerFlag_DepthTesting = 0x4
 Set depth testing to enabled. More...
 
static const varjo_LayerFlags varjo_LayerFlag_InvertAlpha = 0x8
 Invert alpha channel before blending. More...
 
static const varjo_LayerFlags varjo_LayerFlag_UsingOcclusionMesh = 0x10
 Signal that occlusion mesh is in use. More...
 
static const varjo_LayerFlags varjo_LayerFlag_ChromaKeyMasking = 0x20
 Layer is masked by video pass through chroma key if flag is given. More...
 
static const varjo_LayerFlags varjo_LayerFlag_Foveated = 0x40
 Indicate to compositor that layer was rendered with foveation. More...
 
static const varjo_Space varjo_SpaceLocal = 0x0
 The local space, world-locked origin. More...
 
static const varjo_Space varjo_SpaceView = 0x1
 Reference space relative to the user's head. More...
 
static const varjo_ViewExtensionType varjo_ViewExtensionDepthType = 1
 
static const varjo_ViewExtensionType varjo_ViewExtensionDepthTestRangeType = 2
 
static const varjo_ViewExtensionType varjo_ViewExtensionVelocityType = 3
 
static const varjo_ViewExtensionType varjo_ViewExtensionBlendControlMaskType = 4
 
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Off = 0
 No masking. More...
 
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Restricted = 1
 Use chroma keying in masked area (or plain VST if not active), elsewhere show VR content. More...
 
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Extended = 2
 Show VR content in masked area, elsewhere use chroma keying (or plain VST if not active). More...
 
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Reduced = 3
 Show VST content in masked area, elsewhere use chroma keying (or plain VST if not active). More...
 
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_Off = 0
 No debug visualization. More...
 
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowMask = 1
 Visualize mask alpha value. More...
 
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowColors = 2
 Visualize mask rgb values (meaningful only with RGBA texture format). More...
 

Data Structure Documentation

◆ varjo_SwapChainConfig2

struct varjo_SwapChainConfig2

Swap chain configuration structure.

Data Fields
int32_t numberOfTextures Number of textures in the swap chain.
int32_t textureArraySize Texture array size, or 1 if creating a plain 2D texture swap chain.
varjo_TextureFormat textureFormat Texture format of the swap chain images.
int32_t textureHeight Texture height in pixels.
int32_t textureWidth Texture width in pixels.

◆ varjo_SwapChainViewport

struct varjo_SwapChainViewport

Swap chain image source rectangle.


Data Fields
int32_t arrayIndex Texture array slice (if the swap chain is a texture array), otherwise 0.
int32_t height Height of the input rectangle in pixels.
int32_t reserved Reserved for future use.
struct varjo_SwapChain * swapChain The swap chain to retrieve the image from.
int32_t width Width of the input rectangle in pixels.
int32_t x X offset within the swap chain for the input rectangle.
int32_t y Y offset within the swap chain for the input rectangle.

◆ varjo_LayerHeader

struct varjo_LayerHeader

Layer header for different submission layer types.

Data Fields
varjo_LayerFlags flags Flags for this layer.

See varjo_LayerFlags.

varjo_LayerType type The actual type of the layer; currently, the only supported type is varjo_LayerMultiProjType.

◆ varjo_ViewExtension

struct varjo_ViewExtension

View Extension header.

Data Fields
struct varjo_ViewExtension * next Optional pointer to the next extension; allows chaining multiple extensions into a single view.
varjo_ViewExtensionType type View extension type.

◆ varjo_ViewExtensionDepth

struct varjo_ViewExtensionDepth

A varjo_LayerMultiProjView extension that allows submission of a depth surface alongside the color surface for a view.

Data Fields
double farZ Positive distance in meters.

To indicate depth values reversed, can be smaller than nearZ.

struct varjo_ViewExtension header Extension header, with type = varjo_ViewExtensionDepthType.
double maxDepth Largest depth value allowed in the depth surface, typically 1.0.
double minDepth Smallest depth value allowed in the depth surface, typically 0.0.
double nearZ Positive distance in meters.

To indicate depth values reversed, can be greater than farZ.

struct varjo_SwapChainViewport viewport Image source for the depth surface.

◆ varjo_ViewExtensionDepthTestRange

struct varjo_ViewExtensionDepthTestRange

A varjo_LayerMultiProjView extension that defines range for which the depth test is enabled.

Outside the given range the layer is alpha-blended in the layer order. This extension is only meaningful when used with varjo_ViewExtensionDepth.

When video-pass-through depth estimation is enabled using varjo_MRSetVideoDepthEstimation, the depth test range for video layer is limited to close range (hands) by default. If any application specifies its own range by providing this extension, the application range is used instead. This way application can use full range depth.

Data Fields
double farZ Positive distance in meters.
struct varjo_ViewExtension header Extension header, with type = varjo_ViewExtensionDepthTestRangeType.
double nearZ Positive distance in meters.

◆ varjo_ViewExtensionVelocity

struct varjo_ViewExtensionVelocity

A varjo_LayerMultiProjView extension that allows submission of a pixel velocity surface alongside the color surface for a view.

Data Fields
struct varjo_ViewExtension header Extension header, with type = varjo_ViewExtensionVelocityType.
varjo_Bool includesHMDMotion Flag to indicate if motion vectors include also the HMD motion or not.
double velocityScale Scale multiplier for all velocity vectors in the surface, so that after the scaling, the velocities are in pixels per second.
struct varjo_SwapChainViewport viewport Image source for the velocity surface.

◆ varjo_ViewExtensionBlendControlMask

struct varjo_ViewExtensionBlendControlMask

A varjo_LayerMultiProjView extension that defines blend control masking layer flags.

Data Fields
varjo_BlendControlDebugMode debugMode Debug visualization mode.
varjo_Bool forceGlobalViewOffset Force VR view offset for all clients when masking enabled.

(See varjo_MRSetVRViewOffset for more info)

struct varjo_ViewExtension header Extension header, with type = varjo_ViewExtensionBlendControlMaskType.
varjo_BlendControlMaskingMode maskingMode Masking mode used.
int64_t reserved[32] Reserved for future use.

◆ varjo_LayerMultiProjView

struct varjo_LayerMultiProjView

A single view in a Multi-projection layer.

Data Fields
struct varjo_ViewExtension * extension An optional extension structure, or nullptr if none.
struct varjo_Matrix projection The projection matrix this view was rendered with.
struct varjo_Matrix view The view matrix this view was rendered with.
struct varjo_SwapChainViewport viewport Image source for this view.

See varjo_SwapChainViewport for more info.

◆ varjo_LayerMultiProj

struct varjo_LayerMultiProj

Layer type describing a set of planar projected images rendered from the perspective of each eye.

Data Fields
struct varjo_LayerHeader header The layer header.
varjo_Space space The reference space for this layer.

See varjo_Space for valid options.

int32_t viewCount The amount of entries in the views array.
struct varjo_LayerMultiProjView * views Array of views to be rendered.

See varjo_LayerMultiProjView for more information.

◆ varjo_SubmitInfoLayers

struct varjo_SubmitInfoLayers

A structure describing the list of layers that the application submits to the compositor each frame.

Data Fields
int64_t frameNumber The frame number of the frame being submitted.

This should match the frame number returned in varjo_FrameInfo when calling varjo_WaitSync.

int32_t layerCount The number of elements in the layers array below.
struct varjo_LayerHeader ** layers Array of pointers to layer structures, one for each layer.

Note that the elements in this array are not really of varjo_LayerHeader, but rather structures such as varjo_LayerMultiProj that contain varjo_LayerHeader as a first element. varjo_LayerHeader.type is used to detect the actual structure type. Currently the only supported layer type is varjo_LayerMultiProjType, that corresponds to varjo_LayerMultiProj structure.

When submitting multiple layers, the layers are rendered back-to-front in the order they're provided in this array.

int64_t reserved

Typedef Documentation

◆ varjo_BlendControlDebugMode

typedef int64_t varjo_BlendControlDebugMode

Debug mode type.

◆ varjo_BlendControlMaskingMode

Masking mode type.

◆ varjo_LayerFlags

typedef int64_t varjo_LayerFlags

◆ varjo_LayerType

typedef int64_t varjo_LayerType

◆ varjo_Space

typedef int64_t varjo_Space

◆ varjo_ViewExtensionType

typedef int64_t varjo_ViewExtensionType

Variable Documentation

◆ varjo_BlendControlDebugMode_Off

const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_Off = 0
static

No debug visualization.

◆ varjo_BlendControlDebugMode_ShowColors

const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowColors = 2
static

Visualize mask rgb values (meaningful only with RGBA texture format).

◆ varjo_BlendControlDebugMode_ShowMask

const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowMask = 1
static

Visualize mask alpha value.

◆ varjo_BlendControlMaskingMode_Extended

const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Extended = 2
static

Show VR content in masked area, elsewhere use chroma keying (or plain VST if not active).

◆ varjo_BlendControlMaskingMode_Off

const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Off = 0
static

No masking.

Masking layer is not added to composited scenes.

◆ varjo_BlendControlMaskingMode_Reduced

const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Reduced = 3
static

Show VST content in masked area, elsewhere use chroma keying (or plain VST if not active).

◆ varjo_BlendControlMaskingMode_Restricted

const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Restricted = 1
static

Use chroma keying in masked area (or plain VST if not active), elsewhere show VR content.

◆ varjo_LayerFlag_BlendMode_AlphaBlend

const varjo_LayerFlags varjo_LayerFlag_BlendMode_AlphaBlend = 0x2
static

Set blend mode to be alpha blend.

◆ varjo_LayerFlag_ChromaKeyMasking

const varjo_LayerFlags varjo_LayerFlag_ChromaKeyMasking = 0x20
static

Layer is masked by video pass through chroma key if flag is given.

◆ varjo_LayerFlag_DepthTesting

const varjo_LayerFlags varjo_LayerFlag_DepthTesting = 0x4
static

Set depth testing to enabled.

◆ varjo_LayerFlag_Foveated

const varjo_LayerFlags varjo_LayerFlag_Foveated = 0x40
static

Indicate to compositor that layer was rendered with foveation.

◆ varjo_LayerFlag_InvertAlpha

const varjo_LayerFlags varjo_LayerFlag_InvertAlpha = 0x8
static

Invert alpha channel before blending.

◆ varjo_LayerFlag_UsingOcclusionMesh

const varjo_LayerFlags varjo_LayerFlag_UsingOcclusionMesh = 0x10
static

Signal that occlusion mesh is in use.

◆ varjo_LayerFlagNone

const varjo_LayerFlags varjo_LayerFlagNone = 0x0
static

Default layer rendering.

◆ varjo_LayerMultiProjType

const varjo_LayerType varjo_LayerMultiProjType = 0x1
static

Layer type enum corresponding to varjo_LayerMultiProj.

◆ varjo_SpaceLocal

const varjo_Space varjo_SpaceLocal = 0x0
static

The local space, world-locked origin.

◆ varjo_SpaceView

const varjo_Space varjo_SpaceView = 0x1
static

Reference space relative to the user's head.

This space can be used to render face-locked layers.

◆ varjo_ViewExtensionBlendControlMaskType

const varjo_ViewExtensionType varjo_ViewExtensionBlendControlMaskType = 4
static

◆ varjo_ViewExtensionDepthTestRangeType

const varjo_ViewExtensionType varjo_ViewExtensionDepthTestRangeType = 2
static

◆ varjo_ViewExtensionDepthType

const varjo_ViewExtensionType varjo_ViewExtensionDepthType = 1
static

◆ varjo_ViewExtensionVelocityType

const varjo_ViewExtensionType varjo_ViewExtensionVelocityType = 3
static