Varjo Native SDK
Varjo_types_layers.h
Go to the documentation of this file.
1 // Copyright 2019-2022 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_TYPES_LAYERS_H
4 #define VARJO_TYPES_LAYERS_H
5 
6 #include "Varjo_types.h"
7 #include "Varjo_export.h"
8 
9 #if defined __cplusplus
10 extern "C" {
11 #endif
12 
18  int32_t numberOfTextures;
19  int32_t textureWidth;
20  int32_t textureHeight;
21  int32_t textureArraySize;
22 };
23 
25 struct varjo_SwapChain;
26 
29  struct varjo_SwapChain* swapChain;
30  int32_t x;
31  int32_t y;
32  int32_t width;
33  int32_t height;
34  int32_t arrayIndex;
35  int32_t reserved;
36 };
37 
41  int32_t viewIndex;
42  int32_t reserved;
43 };
44 
45 typedef int64_t varjo_LayerType;
48 
49 typedef int64_t varjo_LayerFlags;
52 
59 
60 typedef int64_t varjo_Space;
64 static const varjo_Space varjo_SpaceLocal = 0x0;
69 static const varjo_Space varjo_SpaceView = 0x1;
70 
79 };
80 
81 typedef int64_t varjo_ViewExtensionType;
86 
95 };
96 
105  double minDepth;
107  double maxDepth;
109  double nearZ;
111  double farZ;
114 };
115 
130  double nearZ;
132  double farZ;
133 };
134 
149 };
150 
165 
174 
188  int64_t reserved[32];
189 };
190 
200  struct varjo_Matrix projection;
202  struct varjo_Matrix view;
205 };
206 
210  struct varjo_LayerHeader header;
216  int32_t viewCount;
219 };
220 
229  int64_t frameNumber;
230  int64_t reserved;
231 
233  int32_t layerCount;
246 };
247 
248 #if defined __cplusplus
249 }
250 #endif
251 
252 #endif
varjo_SwapChainConfig2::textureFormat
varjo_TextureFormat textureFormat
Texture format of the swap chain images.
Definition: Varjo_types_layers.h:17
varjo_SwapChainViewport::arrayIndex
int32_t arrayIndex
Texture array slice (if the swap chain is a texture array), otherwise 0.
Definition: Varjo_types_layers.h:34
varjo_ViewExtensionDepthType
static const varjo_ViewExtensionType varjo_ViewExtensionDepthType
Definition: Varjo_types_layers.h:82
varjo_SubmitInfoLayers::frameNumber
int64_t frameNumber
The frame number of the frame being submitted.
Definition: Varjo_types_layers.h:229
varjo_BlendControlMaskingMode_Reduced
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Reduced
Show VST content in masked area, elsewhere use chroma keying (or plain VST if not active).
Definition: Varjo_types_layers.h:160
varjo_LayerMultiProj::header
struct varjo_LayerHeader header
The layer header.
Definition: Varjo_types_layers.h:210
varjo_LayerHeader
Layer header for different submission layer types.
Definition: Varjo_types_layers.h:74
varjo_LayerFlag_UsingOcclusionMesh
static const varjo_LayerFlags varjo_LayerFlag_UsingOcclusionMesh
Signal that occlusion mesh is in use.
Definition: Varjo_types_layers.h:56
varjo_BlendControlDebugMode
int64_t varjo_BlendControlDebugMode
Debug mode type.
Definition: Varjo_types_layers.h:167
varjo_SpaceLocal
static const varjo_Space varjo_SpaceLocal
The local space, world-locked origin.
Definition: Varjo_types_layers.h:64
varjo_LayerHeader::flags
varjo_LayerFlags flags
Flags for this layer.
Definition: Varjo_types_layers.h:78
varjo_ViewExtensionDepthTestRange
A varjo_LayerMultiProjView extension that defines range for which the depth test is enabled.
Definition: Varjo_types_layers.h:126
varjo_LayerFlag_ChromaKeyMasking
static const varjo_LayerFlags varjo_LayerFlag_ChromaKeyMasking
Layer is masked by video pass through chroma key if flag is given.
Definition: Varjo_types_layers.h:57
varjo_SwapChainViewport::width
int32_t width
Width of the input rectangle in pixels.
Definition: Varjo_types_layers.h:32
varjo_BlendControlMaskingMode_Depth_Test_Or_Always_Pass
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Depth_Test_Or_Always_Pass
Do VST depth test in masked area, elsewhere always pass depth test (show VR).
Definition: Varjo_types_layers.h:164
varjo_BlendControlMaskingMode_Depth_Test_Or_Always_Fail
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Depth_Test_Or_Always_Fail
Do VST depth test in masked area, elsewhere always fail depth test (show VST).
Definition: Varjo_types_layers.h:162
Varjo_export.h
varjo_SwapChainConfig2
Swap chain configuration structure.
Definition: Varjo_types_layers.h:16
varjo_BlendControlMaskingMode_Off
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Off
No masking.
Definition: Varjo_types_layers.h:154
varjo_ViewExtension
View Extension header.
Definition: Varjo_types_layers.h:90
varjo_ViewExtensionBlendControlMask::debugMode
varjo_BlendControlDebugMode debugMode
Debug visualization mode.
Definition: Varjo_types_layers.h:186
varjo_ViewExtensionVelocityType
static const varjo_ViewExtensionType varjo_ViewExtensionVelocityType
Definition: Varjo_types_layers.h:84
varjo_LayerMultiProj::space
varjo_Space space
The reference space for this layer.
Definition: Varjo_types_layers.h:214
varjo_SwapChainConfig2::textureWidth
int32_t textureWidth
Texture width in pixels.
Definition: Varjo_types_layers.h:19
varjo_SubmitInfoLayers::layers
struct varjo_LayerHeader ** layers
Array of pointers to layer structures, one for each layer.
Definition: Varjo_types_layers.h:245
varjo_ViewExtensionVelocity::viewport
struct varjo_SwapChainViewport viewport
Image source for the velocity surface.
Definition: Varjo_types_layers.h:148
varjo_ViewExtensionBlendControlMask::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionBlendControlMaskType.
Definition: Varjo_types_layers.h:180
varjo_ViewExtensionDepthTestRange::farZ
double farZ
Positive distance in meters.
Definition: Varjo_types_layers.h:132
varjo_SubmitInfoLayers
A structure describing the list of layers that the application submits to the compositor each frame.
Definition: Varjo_types_layers.h:224
varjo_Bool
int32_t varjo_Bool
Definition: Varjo_types.h:140
varjo_ViewExtensionVelocity::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionVelocityType.
Definition: Varjo_types_layers.h:141
varjo_LayerType
int64_t varjo_LayerType
Definition: Varjo_types_layers.h:45
varjo_BlendControlDebugMode_ShowColors
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowColors
Visualize mask rgb values (meaningful only with RGBA texture format).
Definition: Varjo_types_layers.h:173
varjo_LayerFlag_InvertAlpha
static const varjo_LayerFlags varjo_LayerFlag_InvertAlpha
Invert alpha channel before blending.
Definition: Varjo_types_layers.h:55
varjo_LayerHeader::type
varjo_LayerType type
The actual type of the layer; currently, the only supported type is varjo_LayerMultiProjType.
Definition: Varjo_types_layers.h:76
varjo_LayerFlags
int64_t varjo_LayerFlags
Definition: Varjo_types_layers.h:49
varjo_SwapChainViewport::swapChain
struct varjo_SwapChain * swapChain
The swap chain to retrieve the image from.
Definition: Varjo_types_layers.h:29
varjo_ViewExtension::type
varjo_ViewExtensionType type
View extension type.
Definition: Varjo_types_layers.h:92
varjo_ViewExtensionDepth::nearZ
double nearZ
Positive distance in meters.
Definition: Varjo_types_layers.h:109
varjo_LayerFlag_Foveated
static const varjo_LayerFlags varjo_LayerFlag_Foveated
Indicate to compositor that layer was rendered with foveation.
Definition: Varjo_types_layers.h:58
varjo_ViewExtension::next
struct varjo_ViewExtension * next
Optional pointer to the next extension; allows chaining multiple extensions into a single view.
Definition: Varjo_types_layers.h:94
varjo_BlendControlMaskingMode_Restricted
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Restricted
Use chroma keying in masked area (or plain VST if not active), elsewhere show VR content.
Definition: Varjo_types_layers.h:156
varjo_BlendControlDebugMode_ShowMask
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowMask
Visualize mask alpha value.
Definition: Varjo_types_layers.h:171
varjo_ViewExtensionBlendControlMask::forceGlobalViewOffset
varjo_Bool forceGlobalViewOffset
Force VR view offset for all clients when masking enabled.
Definition: Varjo_types_layers.h:182
varjo_SwapChainConfig2::textureArraySize
int32_t textureArraySize
Texture array size, or 1 if creating a plain 2D texture swap chain.
Definition: Varjo_types_layers.h:21
varjo_LayerMultiProjView::extension
struct varjo_ViewExtension * extension
An optional extension structure, or nullptr if none.
Definition: Varjo_types_layers.h:198
varjo_SwapChainViewport::reserved
int32_t reserved
Reserved for future use.
Definition: Varjo_types_layers.h:35
varjo_ViewExtensionDepth::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionDepthType.
Definition: Varjo_types_layers.h:103
varjo_LayerMultiProj::viewCount
int32_t viewCount
The amount of entries in the views array.
Definition: Varjo_types_layers.h:216
varjo_ViewExtensionBlendControlMaskType
static const varjo_ViewExtensionType varjo_ViewExtensionBlendControlMaskType
Definition: Varjo_types_layers.h:85
varjo_ViewExtensionDepth::maxDepth
double maxDepth
Largest depth value allowed in the depth surface, typically 1.0.
Definition: Varjo_types_layers.h:107
varjo_ViewExtensionType
int64_t varjo_ViewExtensionType
Definition: Varjo_types_layers.h:81
varjo_ViewExtensionBlendControlMask::maskingMode
varjo_BlendControlMaskingMode maskingMode
Masking mode used.
Definition: Varjo_types_layers.h:184
varjo_SpaceView
static const varjo_Space varjo_SpaceView
Reference space relative to the user's head.
Definition: Varjo_types_layers.h:69
varjo_SwapChainConfig2::textureHeight
int32_t textureHeight
Texture height in pixels.
Definition: Varjo_types_layers.h:20
varjo_TextureFormat
int64_t varjo_TextureFormat
Definition: Varjo_types.h:216
varjo_MirrorView::reserved
int32_t reserved
Reserved for future use.
Definition: Varjo_types_layers.h:42
varjo_SwapChainViewport::x
int32_t x
X offset within the swap chain for the input rectangle.
Definition: Varjo_types_layers.h:30
varjo_ViewExtensionVelocity::includesHMDMotion
varjo_Bool includesHMDMotion
Flag to indicate if motion vectors include also the HMD motion or not.
Definition: Varjo_types_layers.h:146
varjo_ViewExtensionVelocity::velocityScale
double velocityScale
Scale multiplier for all velocity vectors in the surface, so that after the scaling,...
Definition: Varjo_types_layers.h:144
varjo_BlendControlMaskingMode_Extended
static const varjo_BlendControlMaskingMode varjo_BlendControlMaskingMode_Extended
Show VR content in masked area, elsewhere use chroma keying (or plain VST if not active).
Definition: Varjo_types_layers.h:158
varjo_LayerFlagNone
static const varjo_LayerFlags varjo_LayerFlagNone
Default layer rendering.
Definition: Varjo_types_layers.h:51
varjo_SubmitInfoLayers::reserved
int64_t reserved
Definition: Varjo_types_layers.h:230
varjo_Space
int64_t varjo_Space
Definition: Varjo_types_layers.h:60
varjo_ViewExtensionBlendControlMask::reserved
int64_t reserved[32]
Reserved for future use.
Definition: Varjo_types_layers.h:188
varjo_LayerMultiProjView
A single view in a Multi-projection layer.
Definition: Varjo_types_layers.h:194
varjo_MirrorView::viewport
struct varjo_SwapChainViewport viewport
The viewport where mirror view should be rendered.
Definition: Varjo_types_layers.h:40
varjo_ViewExtensionDepth::viewport
struct varjo_SwapChainViewport viewport
Image source for the depth surface.
Definition: Varjo_types_layers.h:113
Varjo_types.h
varjo_LayerMultiProj
Layer type describing a set of planar projected images rendered from the perspective of each eye.
Definition: Varjo_types_layers.h:208
varjo_Matrix
Double precision 4x4 matrix.
Definition: Varjo_types.h:330
varjo_LayerMultiProj::views
struct varjo_LayerMultiProjView * views
Array of views to be rendered.
Definition: Varjo_types_layers.h:218
varjo_SwapChainViewport
Swap chain image source rectangle.
Definition: Varjo_types_layers.h:28
varjo_MirrorView::viewIndex
int32_t viewIndex
Index of the view.
Definition: Varjo_types_layers.h:41
varjo_ViewExtensionDepthTestRange::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionDepthTestRangeType.
Definition: Varjo_types_layers.h:128
varjo_LayerFlag_BlendMode_AlphaBlend
static const varjo_LayerFlags varjo_LayerFlag_BlendMode_AlphaBlend
Set blend mode to be alpha blend.
Definition: Varjo_types_layers.h:53
varjo_ViewExtensionDepth
A varjo_LayerMultiProjView extension that allows submission of a depth surface alongside the color su...
Definition: Varjo_types_layers.h:101
varjo_LayerMultiProjType
static const varjo_LayerType varjo_LayerMultiProjType
Layer type enum corresponding to varjo_LayerMultiProj.
Definition: Varjo_types_layers.h:47
varjo_MirrorView
Describes mirror view.
Definition: Varjo_types_layers.h:39
varjo_ViewExtensionBlendControlMask
A varjo_LayerMultiProjView extension that defines blend control masking layer flags.
Definition: Varjo_types_layers.h:178
varjo_BlendControlMaskingMode
int64_t varjo_BlendControlMaskingMode
Masking mode type.
Definition: Varjo_types_layers.h:152
varjo_SwapChainConfig2::numberOfTextures
int32_t numberOfTextures
Number of textures in the swap chain.
Definition: Varjo_types_layers.h:18
varjo_SubmitInfoLayers::layerCount
int32_t layerCount
The number of elements in the layers array below.
Definition: Varjo_types_layers.h:233
varjo_ViewExtensionDepth::farZ
double farZ
Positive distance in meters.
Definition: Varjo_types_layers.h:111
varjo_ViewExtensionDepthTestRangeType
static const varjo_ViewExtensionType varjo_ViewExtensionDepthTestRangeType
Definition: Varjo_types_layers.h:83
varjo_SwapChainViewport::height
int32_t height
Height of the input rectangle in pixels.
Definition: Varjo_types_layers.h:33
varjo_ViewExtensionDepthTestRange::nearZ
double nearZ
Positive distance in meters.
Definition: Varjo_types_layers.h:130
varjo_LayerMultiProjView::view
struct varjo_Matrix view
The view matrix this view was rendered with.
Definition: Varjo_types_layers.h:202
varjo_LayerMultiProjView::projection
struct varjo_Matrix projection
The projection matrix this view was rendered with.
Definition: Varjo_types_layers.h:200
varjo_SwapChainViewport::y
int32_t y
Y offset within the swap chain for the input rectangle.
Definition: Varjo_types_layers.h:31
varjo_ViewExtensionVelocity
A varjo_LayerMultiProjView extension that allows submission of a pixel velocity surface alongside the...
Definition: Varjo_types_layers.h:139
varjo_ViewExtensionDepth::minDepth
double minDepth
Smallest depth value allowed in the depth surface, typically 0.0.
Definition: Varjo_types_layers.h:105
varjo_LayerFlag_DepthTesting
static const varjo_LayerFlags varjo_LayerFlag_DepthTesting
Set depth testing to enabled.
Definition: Varjo_types_layers.h:54
varjo_BlendControlDebugMode_Off
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_Off
No debug visualization.
Definition: Varjo_types_layers.h:169
varjo_LayerMultiProjView::viewport
struct varjo_SwapChainViewport viewport
Image source for this view.
Definition: Varjo_types_layers.h:204