50 Q_DECLARE_PUBLIC(QQuick3DXrManager)
61 bool isValid()
const {
return m_graphics !=
nullptr; }
104 friend class QQuick3DXrRuntimeInfo;
109 void initWorkerThread();
110 void destroyWorkerThread();
111 void onFrameWaitCompleted(XrResult result,
const XrFrameState &frameState);
112 void doRenderFrameAferWait(
const XrFrameState &frameState);
114 void destroySwapchain();
115 void setErrorString(XrResult result,
const char *callName);
116 void checkXrExtensions(
const char* layerName,
int indent = 0);
117 void checkXrLayers();
119 XrResult createXrInstance();
120 void checkXrInstance();
122 void setupDebugMessenger();
124 XrResult initializeSystem();
126 void checkViewConfiguration();
127 [[nodiscard]]
bool checkXrResult(
const XrResult &result);
128 void checkEnvironmentBlendMode(XrViewConfigurationType type);
130 void pollEvents(
bool *exitRenderLoop,
bool *requestRestart);
133 void checkReferenceSpaces();
134 bool isReferenceSpaceAvailable(XrReferenceSpaceType type);
136 bool setupAppSpace();
137 void updateAppSpace(XrTime predictedDisplayTime);
138 bool setupViewSpace();
139 bool resetEmulatedFloorHeight(XrTime predictedDisplayTime);
141 bool createSwapchains();
143 bool renderLayer(XrTime predictedDisplayTime,
144 XrDuration predictedDisplayPeriod,
145 XrCompositionLayerProjection &layer);
146 void doRender(
const XrSwapchainSubImage &subImage,
147 const XrSwapchainImageBaseHeader *swapchainImage,
148 const XrSwapchainImageBaseHeader *depthSwapchainImage =
nullptr);
150 void updateCameraHelper(QQuick3DXrEyeCamera *camera,
const XrCompositionLayerProjectionView &layerView);
151 void updateCameraNonMultiview(
int eye,
const XrCompositionLayerProjectionView &layerView);
152 void updateCameraMultiview(
int projectionLayerViewStartIndex,
int count);
154 void setupMetaQuestColorSpaces();
155 void setupMetaQuestRefreshRates();
156 void setupMetaQuestFoveation();
160 void createMetaQuestPassthrough();
161 void destroyMetaQuestPassthrough();
162 void startMetaQuestPassthrough();
163 void pauseMetaQuestPassthrough();
166 void createMetaQuestPassthroughLayer();
167 void destroyMetaQuestPassthroughLayer();
168 void pauseMetaQuestPassthroughLayer();
169 void resumeMetaQuestPassthroughLayer();
171 XrTime m_previousTime = 0;
180 QVector<XrViewConfigurationView> m_configViews;
181 QVector<XrCompositionLayerProjectionView> m_projectionLayerViews;
182 QVector<XrCompositionLayerDepthInfoKHR> m_layerDepthInfos;
183 QVector<Swapchain> m_swapchains;
184 QVector<Swapchain> m_depthSwapchains;
187 QVector<XrView> m_views;
189 QString m_errorString;
190 QString m_runtimeName;
191 QVersionNumber m_runtimeVersion;
192 QStringList m_enabledApiLayers;
193 QStringList m_enabledExtensions;
195 XrEventDataBuffer m_eventDataBuffer;
202 bool m_isEmulatingLocalFloor =
false;
203 bool m_isFloorResetPending =
false;
213 QVector<XrReferenceSpaceType> m_availableReferenceSpace;
215 QPointer<QQuick3DXrInputManager> m_inputManager;
217 int64_t m_colorSwapchainFormat = -1;
218 int64_t m_depthSwapchainFormat = -1;
221 bool m_fbPassthroughEnabled =
false;
222 bool m_multiviewRendering =
true;
223 bool m_spaceExtensionSupported =
false;
225 bool m_colorspaceExtensionSupported =
false;
226 bool m_displayRefreshRateExtensionSupported =
false;
227 bool m_foveationExtensionSupported =
false;
232 bool m_compositionLayerDepthSupported =
false;
233 bool m_submitLayerDepth =
false;
234 bool m_handtrackingExtensionSupported =
false;
235 bool m_handtrackingAimExtensionSupported =
false;
236 bool m_overlayExtensionSupported =
false;
237 bool m_isGraphicsInitialized =
false;
239 bool m_sessionRunning{
false};
242#ifdef XR_USE_PLATFORM_ANDROID
247#ifdef XR_EXT_debug_utils
252#if QT_CONFIG(graphicsframecapture)
256 QAbstractOpenXRGraphics *m_graphics =
nullptr;
258 bool m_waitingForFrame =
false;
259 bool m_wantUpdate =
false;
261 QThread *m_workerThread =
nullptr;
262 QVector<XrEnvironmentBlendMode> m_blendModes;