Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qopenxrgraphics_metal_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QOPENXRGRAPHICSMETAL_H
5#define QOPENXRGRAPHICSMETAL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DXr/private/qabstractopenxrgraphics_p.h>
19#include <QtQuick3DXr/private/qopenxrplatform_p.h>
20#include <QtCore/QMap>
21
24
25QT_BEGIN_NAMESPACE
26
27class QOpenXRGraphicsMetal : public QAbstractOpenXRGraphics
28{
29public:
30 QOpenXRGraphicsMetal();
31
32 bool isExtensionSupported(const QVector<XrExtensionProperties> &extensions) const override;
33 const char *extensionName() const override;
34 const XrBaseInStructure *handle() const override;
35 bool setupGraphics(const XrInstance &instance, XrSystemId &systemId, const QQuickGraphicsConfiguration &quickConfig) override;
36 bool finializeGraphics(QRhi *rhi) override;
37 int64_t colorSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
38 int64_t depthSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
39 QVector<XrSwapchainImageBaseHeader *> allocateSwapchainImages(int count, XrSwapchain swapchain) override;
40 QQuickRenderTarget renderTarget(const XrSwapchainSubImage &subImage, const XrSwapchainImageBaseHeader *swapchainImage, quint64 swapchainFormat, int samples, int arraySize, const XrSwapchainImageBaseHeader *depthSwapchainImage, quint64 depthSwapchainFormat) const override;
41 QRhi *rhi() const override;
42 void setupWindow(QQuickWindow *) override;
43private:
44 QRhi *m_rhi = nullptr;
45 MTLDevice *m_device = nullptr;
46 MTLCommandQueue *m_commandQueue = nullptr;
47 XrGraphicsBindingMetalKHR m_graphicsBinding = {XR_TYPE_GRAPHICS_BINDING_METAL_KHR, nullptr, nullptr};
48 QMap<XrSwapchain, QVector<XrSwapchainImageMetalKHR>> m_swapchainImageBuffer;
49 XrGraphicsRequirementsMetalKHR m_graphicsRequirements = {XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR, nullptr, nullptr};
50};
51
52
53QT_END_NAMESPACE
54
55#endif // QOPENXRGRAPHICSMETAL_H
bool checkXrResult(XrResult result, XrInstance instance)
Q_FORWARD_DECLARE_OBJC_CLASS(MTLCommandQueue)
Q_FORWARD_DECLARE_OBJC_CLASS(MTLDevice)