46 Q_DECLARE_PUBLIC(QQuick3DXrManager)
55 bool isValid()
const {
return m_graphics !=
nullptr; }
95 friend class QQuick3DXrRuntimeInfo;
100 void destroySwapchain();
101 void setErrorString(XrResult result,
const char *callName);
102 void checkXrExtensions(
const char* layerName,
int indent = 0);
103 void checkXrLayers();
105 XrResult createXrInstance();
106 void checkXrInstance();
108 void setupDebugMessenger();
110 XrResult initializeSystem();
112 void checkViewConfiguration();
113 [[
nodiscard]]
bool checkXrResult(
const XrResult &result);
114 void checkEnvironmentBlendMode(XrViewConfigurationType type);
116 void pollEvents(
bool *exitRenderLoop,
bool *requestRestart);
119 void checkReferenceSpaces();
120 bool isReferenceSpaceAvailable(XrReferenceSpaceType type);
122 bool setupAppSpace();
123 void updateAppSpace(XrTime predictedDisplayTime);
124 bool setupViewSpace();
125 bool resetEmulatedFloorHeight(XrTime predictedDisplayTime);
127 bool createSwapchains();
129 bool renderLayer(XrTime predictedDisplayTime,
130 XrDuration predictedDisplayPeriod,
131 XrCompositionLayerProjection &layer);
132 void doRender(
const XrSwapchainSubImage &subImage,
133 const XrSwapchainImageBaseHeader *swapchainImage,
134 const XrSwapchainImageBaseHeader *depthSwapchainImage =
nullptr);
136 void updateCameraHelper(QQuick3DXrEyeCamera *camera,
const XrCompositionLayerProjectionView &layerView);
137 void updateCameraNonMultiview(
int eye,
const XrCompositionLayerProjectionView &layerView);
138 void updateCameraMultiview(
int projectionLayerViewStartIndex,
int count);
140 void setupMetaQuestColorSpaces();
141 void setupMetaQuestRefreshRates();
142 void setupMetaQuestFoveation();
146 void createMetaQuestPassthrough();
147 void destroyMetaQuestPassthrough();
148 void startMetaQuestPassthrough();
149 void pauseMetaQuestPassthrough();
152 void createMetaQuestPassthroughLayer();
153 void destroyMetaQuestPassthroughLayer();
154 void pauseMetaQuestPassthroughLayer();
155 void resumeMetaQuestPassthroughLayer();
157 XrTime m_previousTime = 0;
166 QVector<XrViewConfigurationView> m_configViews;
167 QVector<XrCompositionLayerProjectionView> m_projectionLayerViews;
168 QVector<XrCompositionLayerDepthInfoKHR> m_layerDepthInfos;
169 QVector<Swapchain> m_swapchains;
170 QVector<Swapchain> m_depthSwapchains;
173 QVector<XrView> m_views;
175 QString m_errorString;
176 QString m_runtimeName;
177 QVersionNumber m_runtimeVersion;
178 QStringList m_enabledApiLayers;
179 QStringList m_enabledExtensions;
181 XrEventDataBuffer m_eventDataBuffer;
188 bool m_isEmulatingLocalFloor =
false;
189 bool m_isFloorResetPending =
false;
199 QVector<XrReferenceSpaceType> m_availableReferenceSpace;
201 QPointer<QQuick3DXrInputManager> m_inputManager;
203 int64_t m_colorSwapchainFormat = -1;
204 int64_t m_depthSwapchainFormat = -1;
207 bool m_passThroughEnabled =
false;
208 bool m_passthroughSupported =
false;
209 bool m_enablePassthrough =
false;
210 bool m_multiviewRendering =
true;
211 bool m_spaceExtensionSupported =
false;
213 bool m_colorspaceExtensionSupported =
false;
214 bool m_displayRefreshRateExtensionSupported =
false;
215 bool m_foveationExtensionSupported =
false;
220 bool m_compositionLayerDepthSupported =
false;
221 bool m_submitLayerDepth =
false;
222 bool m_handtrackingExtensionSupported =
false;
223 bool m_handtrackingAimExtensionSupported =
false;
224 bool m_isGraphicsInitialized =
false;
226 bool m_sessionRunning{
false};
229#ifdef XR_USE_PLATFORM_ANDROID
234#ifdef XR_EXT_debug_utils
239#if QT_CONFIG(graphicsframecapture)
243 QAbstractOpenXRGraphics *m_graphics =
nullptr;