48 Q_DECLARE_PUBLIC(QQuick3DXrManager)
57 bool isValid()
const {
return m_graphics !=
nullptr; }
97 friend class QQuick3DXrRuntimeInfo;
102 void initWorkerThread();
103 void destroyWorkerThread();
104 void onFrameWaitCompleted(XrResult result,
const XrFrameState &frameState);
105 void doRenderFrameAferWait(
const XrFrameState &frameState);
107 void destroySwapchain();
108 void setErrorString(XrResult result,
const char *callName);
109 void checkXrExtensions(
const char* layerName,
int indent = 0);
110 void checkXrLayers();
112 XrResult createXrInstance();
113 void checkXrInstance();
115 void setupDebugMessenger();
117 XrResult initializeSystem();
119 void checkViewConfiguration();
120 [[
nodiscard]]
bool checkXrResult(
const XrResult &result);
121 void checkEnvironmentBlendMode(XrViewConfigurationType type);
123 void pollEvents(
bool *exitRenderLoop,
bool *requestRestart);
126 void checkReferenceSpaces();
127 bool isReferenceSpaceAvailable(XrReferenceSpaceType type);
129 bool setupAppSpace();
130 void updateAppSpace(XrTime predictedDisplayTime);
131 bool setupViewSpace();
132 bool resetEmulatedFloorHeight(XrTime predictedDisplayTime);
134 bool createSwapchains();
136 bool renderLayer(XrTime predictedDisplayTime,
137 XrDuration predictedDisplayPeriod,
138 XrCompositionLayerProjection &layer);
139 void doRender(
const XrSwapchainSubImage &subImage,
140 const XrSwapchainImageBaseHeader *swapchainImage,
141 const XrSwapchainImageBaseHeader *depthSwapchainImage =
nullptr);
143 void updateCameraHelper(QQuick3DXrEyeCamera *camera,
const XrCompositionLayerProjectionView &layerView);
144 void updateCameraNonMultiview(
int eye,
const XrCompositionLayerProjectionView &layerView);
145 void updateCameraMultiview(
int projectionLayerViewStartIndex,
int count);
147 void setupMetaQuestColorSpaces();
148 void setupMetaQuestRefreshRates();
149 void setupMetaQuestFoveation();
153 void createMetaQuestPassthrough();
154 void destroyMetaQuestPassthrough();
155 void startMetaQuestPassthrough();
156 void pauseMetaQuestPassthrough();
159 void createMetaQuestPassthroughLayer();
160 void destroyMetaQuestPassthroughLayer();
161 void pauseMetaQuestPassthroughLayer();
162 void resumeMetaQuestPassthroughLayer();
164 XrTime m_previousTime = 0;
173 QVector<XrViewConfigurationView> m_configViews;
174 QVector<XrCompositionLayerProjectionView> m_projectionLayerViews;
175 QVector<XrCompositionLayerDepthInfoKHR> m_layerDepthInfos;
176 QVector<Swapchain> m_swapchains;
177 QVector<Swapchain> m_depthSwapchains;
180 QVector<XrView> m_views;
182 QString m_errorString;
183 QString m_runtimeName;
184 QVersionNumber m_runtimeVersion;
185 QStringList m_enabledApiLayers;
186 QStringList m_enabledExtensions;
188 XrEventDataBuffer m_eventDataBuffer;
195 bool m_isEmulatingLocalFloor =
false;
196 bool m_isFloorResetPending =
false;
206 QVector<XrReferenceSpaceType> m_availableReferenceSpace;
208 QPointer<QQuick3DXrInputManager> m_inputManager;
210 int64_t m_colorSwapchainFormat = -1;
211 int64_t m_depthSwapchainFormat = -1;
214 bool m_passThroughEnabled =
false;
215 bool m_passthroughSupported =
false;
216 bool m_enablePassthrough =
false;
217 bool m_multiviewRendering =
true;
218 bool m_spaceExtensionSupported =
false;
220 bool m_colorspaceExtensionSupported =
false;
221 bool m_displayRefreshRateExtensionSupported =
false;
222 bool m_foveationExtensionSupported =
false;
227 bool m_compositionLayerDepthSupported =
false;
228 bool m_submitLayerDepth =
false;
229 bool m_handtrackingExtensionSupported =
false;
230 bool m_handtrackingAimExtensionSupported =
false;
231 bool m_isGraphicsInitialized =
false;
233 bool m_sessionRunning{
false};
236#ifdef XR_USE_PLATFORM_ANDROID
241#ifdef XR_EXT_debug_utils
246#if QT_CONFIG(graphicsframecapture)
250 QAbstractOpenXRGraphics *m_graphics =
nullptr;
252 bool m_waitingForFrame =
false;
253 bool m_wantUpdate =
false;
255 QThread *m_workerThread =
nullptr;