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// Qt-Security score:significant reason:default
4
5
6#ifndef QOPENXRGRAPHICSMETAL_H
7#define QOPENXRGRAPHICSMETAL_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DXr/private/qabstractopenxrgraphics_p.h>
21#include <QtQuick3DXr/private/qopenxrplatform_p.h>
22#include <QtCore/QMap>
23
26
27QT_BEGIN_NAMESPACE
28
29class QOpenXRGraphicsMetal : public QAbstractOpenXRGraphics
30{
31public:
32 QOpenXRGraphicsMetal();
33
34 bool initialize(const QVector<XrExtensionProperties> &extensions) override;
35 QVector<const char *> getRequiredExtensions() const override;
36 const XrBaseInStructure *handle() const override;
37 bool setupGraphics(const XrInstance &instance, XrSystemId &systemId, const QQuickGraphicsConfiguration &quickConfig) override;
38 bool finializeGraphics(QRhi *rhi) override;
39 int64_t colorSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
40 int64_t depthSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
41 QVector<XrSwapchainImageBaseHeader *> allocateSwapchainImages(int count, XrSwapchain swapchain) override;
42 QQuickRenderTarget renderTarget(const XrSwapchainSubImage &subImage, const XrSwapchainImageBaseHeader *swapchainImage, quint64 swapchainFormat, int samples, int arraySize, const XrSwapchainImageBaseHeader *depthSwapchainImage, quint64 depthSwapchainFormat) const override;
43 QRhi *rhi() const override;
44 void setupWindow(QQuickWindow *) override;
45private:
46 QRhi *m_rhi = nullptr;
47 MTLDevice *m_device = nullptr;
48 MTLCommandQueue *m_commandQueue = nullptr;
49 XrGraphicsBindingMetalKHR m_graphicsBinding = {XR_TYPE_GRAPHICS_BINDING_METAL_KHR, nullptr, nullptr};
50 QMap<XrSwapchain, QVector<XrSwapchainImageMetalKHR>> m_swapchainImageBuffer;
51 XrGraphicsRequirementsMetalKHR m_graphicsRequirements = {XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR, nullptr, nullptr};
52};
53
54
55QT_END_NAMESPACE
56
57#endif // QOPENXRGRAPHICSMETAL_H
Combined button and popup list for selecting options.
Q_FORWARD_DECLARE_OBJC_CLASS(MTLCommandQueue)
Q_FORWARD_DECLARE_OBJC_CLASS(MTLDevice)