[PATCH] include: Add dxcore.idl.

Biswapriyo Nath nathbappai at gmail.com
Sat Jun 25 00:36:45 CDT 2022


Thank you for the review. I copied it from dxcore.h[1]. I have
attached the updated patch.

[1]: https://github.com/microsoft/DirectX-Headers/blob/main/include/directx/dxcore.h
-------------- next part --------------
From 1407a68dc45c3882ed8b80869ba7113386dfc032 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai at gmail.com>
Date: Sat, 25 Jun 2022 09:26:41 +0530
Subject: [PATCH] include: Add dxcore.idl.

Signed-off-by: Biswapriyo Nath <nathbappai at gmail.com>
---
 include/Makefile.in |   1 +
 include/dxcore.idl  | 202 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 203 insertions(+)
 create mode 100644 include/dxcore.idl

diff --git a/include/Makefile.in b/include/Makefile.in
index d03c6d94..5ca89eab 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -276,6 +276,7 @@ SOURCES = \
 	dwrite_1.idl \
 	dwrite_2.idl \
 	dwrite_3.idl \
+	dxcore.idl \
 	dxdiag.h \
 	dxerr8.h \
 	dxerr9.h \
diff --git a/include/dxcore.idl b/include/dxcore.idl
new file mode 100644
index 00000000..ee98c7fd
--- /dev/null
+++ b/include/dxcore.idl
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) the Wine project
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+cpp_quote("#define _FACDXCORE 0x880")
+cpp_quote("#define MAKE_DXCORE_HRESULT(code) MAKE_HRESULT(1, _FACDXCORE, code)")
+
+cpp_quote("#if 0")
+typedef struct _LUID {
+  DWORD LowPart;
+  LONG HighPart;
+} LUID, *PLUID;
+cpp_quote("#endif")
+
+typedef enum DXCoreAdapterProperty {
+  InstanceLuid = 0,
+  DriverVersion = 1,
+  DriverDescription = 2,
+  HardwareID = 3,
+  KmdModelVersion = 4,
+  ComputePreemptionGranularity = 5,
+  GraphicsPreemptionGranularity = 6,
+  DedicatedAdapterMemory = 7,
+  DedicatedSystemMemory = 8,
+  SharedSystemMemory = 9,
+  AcgCompatible = 10,
+  IsHardware = 11,
+  IsIntegrated = 12,
+  IsDetachable = 13,
+  HardwareIDParts = 14
+} DXCoreAdapterProperty;
+
+typedef enum DXCoreAdapterState {
+  IsDriverUpdateInProgress = 0,
+  AdapterMemoryBudget = 1
+} DXCoreAdapterState;
+
+typedef enum DXCoreSegmentGroup {
+  Local = 0,
+  NonLocal = 1
+} DXCoreSegmentGroup;
+
+typedef enum DXCoreNotificationType {
+  AdapterListStale = 0,
+  AdapterNoLongerValid = 1,
+  AdapterBudgetChange = 2,
+  AdapterHardwareContentProtectionTeardown = 3
+} DXCoreNotificationType;
+
+typedef enum DXCoreAdapterPreference {
+  Hardware = 0,
+  MinimumPower = 1,
+  HighPerformance = 2
+} DXCoreAdapterPreference;
+
+typedef struct DXCoreHardwareID {
+  UINT32 vendorID;
+  UINT32 deviceID;
+  UINT32 subSysID;
+  UINT32 revision;
+} DXCoreHardwareID;
+
+typedef struct DXCoreHardwareIDParts {
+  UINT32 vendorID;
+  UINT32 deviceID;
+  UINT32 subSystemID;
+  UINT32 subVendorID;
+  UINT32 revisionID;
+} DXCoreHardwareIDParts;
+
+typedef struct DXCoreAdapterMemoryBudgetNodeSegmentGroup {
+  UINT32 nodeIndex;
+  DXCoreSegmentGroup segmentGroup;
+} DXCoreAdapterMemoryBudgetNodeSegmentGroup;
+
+typedef struct DXCoreAdapterMemoryBudget {
+  UINT64 budget;
+  UINT64 currentUsage;
+  UINT64 availableForReservation;
+  UINT64 currentReservation;
+} DXCoreAdapterMemoryBudget;
+
+cpp_quote("typedef void (WINAPI *PFN_DXCORE_NOTIFICATION_CALLBACK)(DXCoreNotificationType notificationType, IUnknown *object, void *context);")
+
+cpp_quote("DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b);")
+cpp_quote("DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1);")
+cpp_quote("DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90);")
+
+[uuid(f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e), object, local, pointer_default(unique)]
+interface IDXCoreAdapter : IUnknown
+{
+  boolean IsValid();
+
+  boolean IsAttributeSupported(
+    REFGUID attributeGUID);
+
+  boolean IsPropertySupported(
+    DXCoreAdapterProperty property);
+
+  HRESULT GetProperty(
+    DXCoreAdapterProperty property,
+    SIZE_T bufferSize,
+    void *propertyData);
+
+  HRESULT GetPropertySize(
+    DXCoreAdapterProperty property,
+    SIZE_T *bufferSize);
+
+  boolean IsQueryStateSupported(
+    DXCoreAdapterState property);
+
+  HRESULT QueryState(
+    DXCoreAdapterState state,
+    SIZE_T inputStateDetailsSize,
+    const void *inputStateDetails,
+    SIZE_T outputBufferSize,
+    void *outputBuffer);
+
+  boolean IsSetStateSupported(
+    DXCoreAdapterState property);
+
+  HRESULT SetState(
+    DXCoreAdapterState state,
+    SIZE_T inputStateDetailsSize,
+    const void *inputStateDetails,
+    SIZE_T inputDataSize,
+    const void *inputData);
+
+  HRESULT GetFactory(
+    REFIID riid,
+    void **ppvFactory);
+}
+
+[uuid(526c7776-40e9-459b-b711-f32ad76dfc28), object, local, pointer_default(unique)]
+interface IDXCoreAdapterList : IUnknown
+{
+  HRESULT GetAdapter(
+    UINT32 index,
+    REFIID riid,
+    void **ppvAdapter);
+
+  UINT32 GetAdapterCount();
+  boolean IsStale();
+
+  HRESULT GetFactory(
+    REFIID riid,
+     void **ppvFactory);
+
+  HRESULT Sort(
+    UINT32 numPreferences,
+    const DXCoreAdapterPreference *preferences);
+
+  boolean IsAdapterPreferenceSupported(
+    DXCoreAdapterPreference preference);
+}
+
+[uuid(78ee5945-c36e-4b13-a669-005dd11c0f06), object, local, pointer_default(unique)]
+interface IDXCoreAdapterFactory : IUnknown
+{
+  HRESULT CreateAdapterList(
+    UINT32 numAttributes,
+    const GUID *filterAttributes,
+    REFIID riid,
+    void **ppvAdapterList);
+
+  HRESULT GetAdapterByLuid(
+    const LUID adapterLUID,
+    REFIID riid,
+    void **ppvAdapter);
+
+  boolean IsNotificationTypeSupported(
+    DXCoreNotificationType notificationType);
+
+  HRESULT RegisterEventNotification(
+    IUnknown *dxCoreObject,
+    DXCoreNotificationType notificationType,
+    void *callbackFunction,
+    void *callbackContext,
+    UINT32 *eventCookie);
+
+  HRESULT UnregisterEventNotification(
+    UINT32 eventCookie);
+}
+
+cpp_quote("HRESULT WINAPI DXCoreCreateAdapterFactory(REFIID riid, void **ppvFactory);")
-- 
2.36.1



More information about the wine-devel mailing list