From 9c39dd56283c74d28254c0b01f2edddb66919c08 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 24 Jun 2020 16:34:53 +0200 Subject: 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 --- src/quick/items/qquickgraphicsdevice_p.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/quick/items/qquickgraphicsdevice_p.h') 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; }; -- cgit v1.2.3