aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickgraphicsdevice_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-24 16:34:53 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-29 10:17:25 +0200
commit9c39dd56283c74d28254c0b01f2edddb66919c08 (patch)
tree6427f5e5abe4747b4ab7f164d8a182a5ef634c38 /src/quick/items/qquickgraphicsdevice_p.h
parenta2c0fc9e87d84aee77b45705a092f86e4cd96ad8 (diff)
Make it possible to specify an adapter or physical device only
As required by OpenXR. While we are at it, make the API a bit more type safe. Change-Id: I3c6152feeb71359056830ab02d35f8cb258722c0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickgraphicsdevice_p.h')
-rw-r--r--src/quick/items/qquickgraphicsdevice_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quick/items/qquickgraphicsdevice_p.h b/src/quick/items/qquickgraphicsdevice_p.h
index 0a206725a6..e4be39b3e5 100644
--- a/src/quick/items/qquickgraphicsdevice_p.h
+++ b/src/quick/items/qquickgraphicsdevice_p.h
@@ -68,14 +68,22 @@ public:
enum class Type {
Null,
OpenGLContext,
+ Adapter,
DeviceAndContext,
DeviceAndCommandQueue,
+ PhysicalDevice,
DeviceObjects
};
QAtomicInt ref;
Type type = Type::Null;
+ struct Adapter {
+ quint32 luidLow;
+ qint32 luidHigh;
+ int featureLevel;
+ };
+
struct DeviceAndContext {
void *device;
void *context;
@@ -86,16 +94,23 @@ public:
void *cmdQueue;
};
+ struct PhysicalDevice {
+ void *physicalDevice;
+ };
+
struct DeviceObjects {
void *physicalDevice;
void *device;
int queueFamilyIndex;
+ int queueIndex;
};
union {
QOpenGLContext *context;
+ Adapter adapter;
DeviceAndContext deviceAndContext;
DeviceAndCommandQueue deviceAndCommandQueue;
+ PhysicalDevice physicalDevice;
DeviceObjects deviceObjects;
} u;
};