Varjo Native SDK
Varjo_types_layers.h
Go to the documentation of this file.
1 // Copyright 2019-2021 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 
38 typedef int64_t varjo_LayerType;
41 
42 typedef int64_t varjo_LayerFlags;
45 
52 
53 typedef int64_t varjo_Space;
57 static const varjo_Space varjo_SpaceLocal = 0x0;
62 static const varjo_Space varjo_SpaceView = 0x1;
63 
72 };
73 
74 typedef int64_t varjo_ViewExtensionType;
79 
88 };
89 
98  double minDepth;
100  double maxDepth;
102  double nearZ;
104  double farZ;
107 };
108 
123  double nearZ;
125  double farZ;
126 };
127 
142 };
143 
154 
163 
177  int64_t reserved[32];
178 };
179 
189  struct varjo_Matrix projection;
191  struct varjo_Matrix view;
194 };
195 
199  struct varjo_LayerHeader header;
205  int32_t viewCount;
208 };
209 
218  int64_t frameNumber;
219  int64_t reserved;
220 
222  int32_t layerCount;
235 };
236 
237 #if defined __cplusplus
238 }
239 #endif
240 
241 #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:75
varjo_SubmitInfoLayers::frameNumber
int64_t frameNumber
The frame number of the frame being submitted.
Definition: Varjo_types_layers.h:218
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:153
varjo_LayerMultiProj::header
struct varjo_LayerHeader header
The layer header.
Definition: Varjo_types_layers.h:199
varjo_LayerHeader
Layer header for different submission layer types.
Definition: Varjo_types_layers.h:67
varjo_LayerFlag_UsingOcclusionMesh
static const varjo_LayerFlags varjo_LayerFlag_UsingOcclusionMesh
Signal that occlusion mesh is in use.
Definition: Varjo_types_layers.h:49
varjo_BlendControlDebugMode
int64_t varjo_BlendControlDebugMode
Debug mode type.
Definition: Varjo_types_layers.h:156
varjo_SpaceLocal
static const varjo_Space varjo_SpaceLocal
The local space, world-locked origin.
Definition: Varjo_types_layers.h:57
varjo_LayerHeader::flags
varjo_LayerFlags flags
Flags for this layer.
Definition: Varjo_types_layers.h:71
varjo_ViewExtensionDepthTestRange
A varjo_LayerMultiProjView extension that defines range for which the depth test is enabled.
Definition: Varjo_types_layers.h:119
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:50
varjo_SwapChainViewport::width
int32_t width
Width of the input rectangle in pixels.
Definition: Varjo_types_layers.h:32
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:147
varjo_ViewExtension
View Extension header.
Definition: Varjo_types_layers.h:83
varjo_ViewExtensionBlendControlMask::debugMode
varjo_BlendControlDebugMode debugMode
Debug visualization mode.
Definition: Varjo_types_layers.h:175
varjo_ViewExtensionVelocityType
static const varjo_ViewExtensionType varjo_ViewExtensionVelocityType
Definition: Varjo_types_layers.h:77
varjo_LayerMultiProj::space
varjo_Space space
The reference space for this layer.
Definition: Varjo_types_layers.h:203
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:234
varjo_ViewExtensionVelocity::viewport
struct varjo_SwapChainViewport viewport
Image source for the velocity surface.
Definition: Varjo_types_layers.h:141
varjo_ViewExtensionBlendControlMask::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionBlendControlMaskType.
Definition: Varjo_types_layers.h:169
varjo_ViewExtensionDepthTestRange::farZ
double farZ
Positive distance in meters.
Definition: Varjo_types_layers.h:125
varjo_SubmitInfoLayers
A structure describing the list of layers that the application submits to the compositor each frame.
Definition: Varjo_types_layers.h:213
varjo_Bool
int32_t varjo_Bool
Definition: Varjo_types.h:135
varjo_ViewExtensionVelocity::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionVelocityType.
Definition: Varjo_types_layers.h:134
varjo_LayerType
int64_t varjo_LayerType
Definition: Varjo_types_layers.h:38
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:162
varjo_LayerFlag_InvertAlpha
static const varjo_LayerFlags varjo_LayerFlag_InvertAlpha
Invert alpha channel before blending.
Definition: Varjo_types_layers.h:48
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:69
varjo_LayerFlags
int64_t varjo_LayerFlags
Definition: Varjo_types_layers.h:42
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:85
varjo_ViewExtensionDepth::nearZ
double nearZ
Positive distance in meters.
Definition: Varjo_types_layers.h:102
varjo_LayerFlag_Foveated
static const varjo_LayerFlags varjo_LayerFlag_Foveated
Indicate to compositor that layer was rendered with foveation.
Definition: Varjo_types_layers.h:51
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:87
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:149
varjo_BlendControlDebugMode_ShowMask
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_ShowMask
Visualize mask alpha value.
Definition: Varjo_types_layers.h:160
varjo_ViewExtensionBlendControlMask::forceGlobalViewOffset
varjo_Bool forceGlobalViewOffset
Force VR view offset for all clients when masking enabled.
Definition: Varjo_types_layers.h:171
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:187
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:96
varjo_LayerMultiProj::viewCount
int32_t viewCount
The amount of entries in the views array.
Definition: Varjo_types_layers.h:205
varjo_ViewExtensionBlendControlMaskType
static const varjo_ViewExtensionType varjo_ViewExtensionBlendControlMaskType
Definition: Varjo_types_layers.h:78
varjo_ViewExtensionDepth::maxDepth
double maxDepth
Largest depth value allowed in the depth surface, typically 1.0.
Definition: Varjo_types_layers.h:100
varjo_ViewExtensionType
int64_t varjo_ViewExtensionType
Definition: Varjo_types_layers.h:74
varjo_ViewExtensionBlendControlMask::maskingMode
varjo_BlendControlMaskingMode maskingMode
Masking mode used.
Definition: Varjo_types_layers.h:173
varjo_SpaceView
static const varjo_Space varjo_SpaceView
Reference space relative to the user's head.
Definition: Varjo_types_layers.h:62
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:209
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:139
varjo_ViewExtensionVelocity::velocityScale
double velocityScale
Scale multiplier for all velocity vectors in the surface, so that after the scaling,...
Definition: Varjo_types_layers.h:137
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:151
varjo_LayerFlagNone
static const varjo_LayerFlags varjo_LayerFlagNone
Default layer rendering.
Definition: Varjo_types_layers.h:44
varjo_SubmitInfoLayers::reserved
int64_t reserved
Definition: Varjo_types_layers.h:219
varjo_Space
int64_t varjo_Space
Definition: Varjo_types_layers.h:53
varjo_ViewExtensionBlendControlMask::reserved
int64_t reserved[32]
Reserved for future use.
Definition: Varjo_types_layers.h:177
varjo_LayerMultiProjView
A single view in a Multi-projection layer.
Definition: Varjo_types_layers.h:183
varjo_ViewExtensionDepth::viewport
struct varjo_SwapChainViewport viewport
Image source for the depth surface.
Definition: Varjo_types_layers.h:106
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:197
varjo_Matrix
Double precision 4x4 matrix.
Definition: Varjo_types.h:297
varjo_LayerMultiProj::views
struct varjo_LayerMultiProjView * views
Array of views to be rendered.
Definition: Varjo_types_layers.h:207
varjo_SwapChainViewport
Swap chain image source rectangle.
Definition: Varjo_types_layers.h:28
varjo_ViewExtensionDepthTestRange::header
struct varjo_ViewExtension header
Extension header, with type = varjo_ViewExtensionDepthTestRangeType.
Definition: Varjo_types_layers.h:121
varjo_LayerFlag_BlendMode_AlphaBlend
static const varjo_LayerFlags varjo_LayerFlag_BlendMode_AlphaBlend
Set blend mode to be alpha blend.
Definition: Varjo_types_layers.h:46
varjo_ViewExtensionDepth
A varjo_LayerMultiProjView extension that allows submission of a depth surface alongside the color su...
Definition: Varjo_types_layers.h:94
varjo_LayerMultiProjType
static const varjo_LayerType varjo_LayerMultiProjType
Layer type enum corresponding to varjo_LayerMultiProj.
Definition: Varjo_types_layers.h:40
varjo_ViewExtensionBlendControlMask
A varjo_LayerMultiProjView extension that defines blend control masking layer flags.
Definition: Varjo_types_layers.h:167
varjo_BlendControlMaskingMode
int64_t varjo_BlendControlMaskingMode
Masking mode type.
Definition: Varjo_types_layers.h:145
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:222
varjo_ViewExtensionDepth::farZ
double farZ
Positive distance in meters.
Definition: Varjo_types_layers.h:104
varjo_ViewExtensionDepthTestRangeType
static const varjo_ViewExtensionType varjo_ViewExtensionDepthTestRangeType
Definition: Varjo_types_layers.h:76
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:123
varjo_LayerMultiProjView::view
struct varjo_Matrix view
The view matrix this view was rendered with.
Definition: Varjo_types_layers.h:191
varjo_LayerMultiProjView::projection
struct varjo_Matrix projection
The projection matrix this view was rendered with.
Definition: Varjo_types_layers.h:189
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:132
varjo_ViewExtensionDepth::minDepth
double minDepth
Smallest depth value allowed in the depth surface, typically 0.0.
Definition: Varjo_types_layers.h:98
varjo_LayerFlag_DepthTesting
static const varjo_LayerFlags varjo_LayerFlag_DepthTesting
Set depth testing to enabled.
Definition: Varjo_types_layers.h:47
varjo_BlendControlDebugMode_Off
static const varjo_BlendControlDebugMode varjo_BlendControlDebugMode_Off
No debug visualization.
Definition: Varjo_types_layers.h:158
varjo_LayerMultiProjView::viewport
struct varjo_SwapChainViewport viewport
Image source for this view.
Definition: Varjo_types_layers.h:193