From 55e9a8ca45b12064036e90738c6ef9be70e3072c Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Wed, 31 Jul 2024 20:18:57 -0400
Subject: [PATCH] d3d12: Import DirectX-Headers, use local d3d12.h in
SDL_render.
This avoids lots of build issues with the various D3D12 headers out there (MinGW, old Windows SDKs, etc) and also opens the door for WSL2 libd3d12.so support.
Note that the build system has not been changed; technically _all_ platforms now have d3d12.h but we should only enable the backend when it's actually expected to work.
---
src/render/direct3d12/SDL_render_d3d12.c | 13 +-
src/render/direct3d12/SDL_shaders_d3d12.c | 12 +-
src/video/directx/d3d12.h | 34938 ++++++++++++++++++++
src/video/directx/d3d12sdklayers.h | 4263 +++
4 files changed, 39224 insertions(+), 2 deletions(-)
create mode 100644 src/video/directx/d3d12.h
create mode 100644 src/video/directx/d3d12sdklayers.h
diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c
index 765e082da0892..06c5d0a8e1543 100644
--- a/src/render/direct3d12/SDL_render_d3d12.c
+++ b/src/render/direct3d12/SDL_render_d3d12.c
@@ -38,7 +38,18 @@
#define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT 256
#endif
#else
-#include <d3d12.h>
+
+/* From the DirectX-Headers build system:
+ * "MinGW has RPC headers which define old versions, and complain if D3D
+ * headers are included before the RPC headers, since D3D headers were
+ * generated with new MIDL and "require" new RPC headers."
+ */
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#ifndef WINAPI_PARTITION_GAMES
+#define WINAPI_PARTITION_GAMES 0
+#endif /* WINAPI_PARTITION_GAMES */
+#include "../../video/directx/d3d12.h"
+
#include <dxgi1_6.h>
#include <dxgidebug.h>
#include <d3d12sdklayers.h>
diff --git a/src/render/direct3d12/SDL_shaders_d3d12.c b/src/render/direct3d12/SDL_shaders_d3d12.c
index 913d975d9500c..bddd46e8e37ee 100644
--- a/src/render/direct3d12/SDL_shaders_d3d12.c
+++ b/src/render/direct3d12/SDL_shaders_d3d12.c
@@ -23,7 +23,17 @@
#if SDL_VIDEO_RENDER_D3D12 && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
#include "../../core/windows/SDL_windows.h"
-#include <d3d12.h>
+
+/* From the DirectX-Headers build system:
+ * "MinGW has RPC headers which define old versions, and complain if D3D
+ * headers are included before the RPC headers, since D3D headers were
+ * generated with new MIDL and "require" new RPC headers."
+ */
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#ifndef WINAPI_PARTITION_GAMES
+#define WINAPI_PARTITION_GAMES 0
+#endif /* WINAPI_PARTITION_GAMES */
+#include "../../video/directx/d3d12.h"
#include "SDL_shaders_d3d12.h"
diff --git a/src/video/directx/d3d12.h b/src/video/directx/d3d12.h
new file mode 100644
index 0000000000000..684ef13d7b6bf
--- /dev/null
+++ b/src/video/directx/d3d12.h
@@ -0,0 +1,34938 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.01.0628 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12_h__
+#define __d3d12_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12Object_FWD_DEFINED__
+#define __ID3D12Object_FWD_DEFINED__
+typedef interface ID3D12Object ID3D12Object;
+
+#endif /* __ID3D12Object_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceChild_FWD_DEFINED__
+#define __ID3D12DeviceChild_FWD_DEFINED__
+typedef interface ID3D12DeviceChild ID3D12DeviceChild;
+
+#endif /* __ID3D12DeviceChild_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12RootSignature_FWD_DEFINED__
+#define __ID3D12RootSignature_FWD_DEFINED__
+typedef interface ID3D12RootSignature ID3D12RootSignature;
+
+#endif /* __ID3D12RootSignature_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12RootSignatureDeserializer_FWD_DEFINED__
+#define __ID3D12RootSignatureDeserializer_FWD_DEFINED__
+typedef interface ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer;
+
+#endif /* __ID3D12RootSignatureDeserializer_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__
+#define __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__
+typedef interface ID3D12VersionedRootSignatureDeserializer ID3D12VersionedRootSignatureDeserializer;
+
+#endif /* __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Pageable_FWD_DEFINED__
+#define __ID3D12Pageable_FWD_DEFINED__
+typedef interface ID3D12Pageable ID3D12Pageable;
+
+#endif /* __ID3D12Pageable_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Heap_FWD_DEFINED__
+#define __ID3D12Heap_FWD_DEFINED__
+typedef interface ID3D12Heap ID3D12Heap;
+
+#endif /* __ID3D12Heap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Resource_FWD_DEFINED__
+#define __ID3D12Resource_FWD_DEFINED__
+typedef interface ID3D12Resource ID3D12Resource;
+
+#endif /* __ID3D12Resource_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandAllocator_FWD_DEFINED__
+#define __ID3D12CommandAllocator_FWD_DEFINED__
+typedef interface ID3D12CommandAllocator ID3D12CommandAllocator;
+
+#endif /* __ID3D12CommandAllocator_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Fence_FWD_DEFINED__
+#define __ID3D12Fence_FWD_DEFINED__
+typedef interface ID3D12Fence ID3D12Fence;
+
+#endif /* __ID3D12Fence_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Fence1_FWD_DEFINED__
+#define __ID3D12Fence1_FWD_DEFINED__
+typedef interface ID3D12Fence1 ID3D12Fence1;
+
+#endif /* __ID3D12Fence1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12PipelineState_FWD_DEFINED__
+#define __ID3D12PipelineState_FWD_DEFINED__
+typedef interface ID3D12PipelineState ID3D12PipelineState;
+
+#endif /* __ID3D12PipelineState_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__
+#define __ID3D12DescriptorHeap_FWD_DEFINED__
+typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap;
+
+#endif /* __ID3D12DescriptorHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12QueryHeap_FWD_DEFINED__
+#define __ID3D12QueryHeap_FWD_DEFINED__
+typedef interface ID3D12QueryHeap ID3D12QueryHeap;
+
+#endif /* __ID3D12QueryHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandSignature_FWD_DEFINED__
+#define __ID3D12CommandSignature_FWD_DEFINED__
+typedef interface ID3D12CommandSignature ID3D12CommandSignature;
+
+#endif /* __ID3D12CommandSignature_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandList_FWD_DEFINED__
+#define __ID3D12CommandList_FWD_DEFINED__
+typedef interface ID3D12CommandList ID3D12CommandList;
+
+#endif /* __ID3D12CommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList;
+
+#endif /* __ID3D12GraphicsCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList1_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList1_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList1 ID3D12GraphicsCommandList1;
+
+#endif /* __ID3D12GraphicsCommandList1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList2_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList2_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList2 ID3D12GraphicsCommandList2;
+
+#endif /* __ID3D12GraphicsCommandList2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandQueue_FWD_DEFINED__
+#define __ID3D12CommandQueue_FWD_DEFINED__
+typedef interface ID3D12CommandQueue ID3D12CommandQueue;
+
+#endif /* __ID3D12CommandQueue_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device_FWD_DEFINED__
+#define __ID3D12Device_FWD_DEFINED__
+typedef interface ID3D12Device ID3D12Device;
+
+#endif /* __ID3D12Device_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12PipelineLibrary_FWD_DEFINED__
+#define __ID3D12PipelineLibrary_FWD_DEFINED__
+typedef interface ID3D12PipelineLibrary ID3D12PipelineLibrary;
+
+#endif /* __ID3D12PipelineLibrary_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12PipelineLibrary1_FWD_DEFINED__
+#define __ID3D12PipelineLibrary1_FWD_DEFINED__
+typedef interface ID3D12PipelineLibrary1 ID3D12PipelineLibrary1;
+
+#endif /* __ID3D12PipelineLibrary1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device1_FWD_DEFINED__
+#define __ID3D12Device1_FWD_DEFINED__
+typedef interface ID3D12Device1 ID3D12Device1;
+
+#endif /* __ID3D12Device1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device2_FWD_DEFINED__
+#define __ID3D12Device2_FWD_DEFINED__
+typedef interface ID3D12Device2 ID3D12Device2;
+
+#endif /* __ID3D12Device2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device3_FWD_DEFINED__
+#define __ID3D12Device3_FWD_DEFINED__
+typedef interface ID3D12Device3 ID3D12Device3;
+
+#endif /* __ID3D12Device3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12ProtectedSession_FWD_DEFINED__
+#define __ID3D12ProtectedSession_FWD_DEFINED__
+typedef interface ID3D12ProtectedSession ID3D12ProtectedSession;
+
+#endif /* __ID3D12ProtectedSession_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12ProtectedResourceSession_FWD_DEFINED__
+#define __ID3D12ProtectedResourceSession_FWD_DEFINED__
+typedef interface ID3D12ProtectedResourceSession ID3D12ProtectedResourceSession;
+
+#endif /* __ID3D12ProtectedResourceSession_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device4_FWD_DEFINED__
+#define __ID3D12Device4_FWD_DEFINED__
+typedef interface ID3D12Device4 ID3D12Device4;
+
+#endif /* __ID3D12Device4_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12LifetimeOwner_FWD_DEFINED__
+#define __ID3D12LifetimeOwner_FWD_DEFINED__
+typedef interface ID3D12LifetimeOwner ID3D12LifetimeOwner;
+
+#endif /* __ID3D12LifetimeOwner_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12SwapChainAssistant_FWD_DEFINED__
+#define __ID3D12SwapChainAssistant_FWD_DEFINED__
+typedef interface ID3D12SwapChainAssistant ID3D12SwapChainAssistant;
+
+#endif /* __ID3D12SwapChainAssistant_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12LifetimeTracker_FWD_DEFINED__
+#define __ID3D12LifetimeTracker_FWD_DEFINED__
+typedef interface ID3D12LifetimeTracker ID3D12LifetimeTracker;
+
+#endif /* __ID3D12LifetimeTracker_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12StateObject_FWD_DEFINED__
+#define __ID3D12StateObject_FWD_DEFINED__
+typedef interface ID3D12StateObject ID3D12StateObject;
+
+#endif /* __ID3D12StateObject_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12StateObjectProperties_FWD_DEFINED__
+#define __ID3D12StateObjectProperties_FWD_DEFINED__
+typedef interface ID3D12StateObjectProperties ID3D12StateObjectProperties;
+
+#endif /* __ID3D12StateObjectProperties_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12StateObjectProperties1_FWD_DEFINED__
+#define __ID3D12StateObjectProperties1_FWD_DEFINED__
+typedef interface ID3D12StateObjectProperties1 ID3D12StateObjectProperties1;
+
+#endif /* __ID3D12StateObjectProperties1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12WorkGraphProperties_FWD_DEFINED__
+#define __ID3D12WorkGraphProperties_FWD_DEFINED__
+typedef interface ID3D12WorkGraphProperties ID3D12WorkGraphProperties;
+
+#endif /* __ID3D12WorkGraphProperties_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device5_FWD_DEFINED__
+#define __ID3D12Device5_FWD_DEFINED__
+typedef interface ID3D12Device5 ID3D12Device5;
+
+#endif /* __ID3D12Device5_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedDataSettings ID3D12DeviceRemovedExtendedDataSettings;
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedDataSettings1 ID3D12DeviceRemovedExtendedDataSettings1;
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedDataSettings2 ID3D12DeviceRemovedExtendedDataSettings2;
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedData ID3D12DeviceRemovedExtendedData;
+
+#endif /* __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedData1 ID3D12DeviceRemovedExtendedData1;
+
+#endif /* __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedData2 ID3D12DeviceRemovedExtendedData2;
+
+#endif /* __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device6_FWD_DEFINED__
+#define __ID3D12Device6_FWD_DEFINED__
+typedef interface ID3D12Device6 ID3D12Device6;
+
+#endif /* __ID3D12Device6_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12ProtectedResourceSession1_FWD_DEFINED__
+#define __ID3D12ProtectedResourceSession1_FWD_DEFINED__
+typedef interface ID3D12ProtectedResourceSession1 ID3D12ProtectedResourceSession1;
+
+#endif /* __ID3D12ProtectedResourceSession1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device7_FWD_DEFINED__
+#define __ID3D12Device7_FWD_DEFINED__
+typedef interface ID3D12Device7 ID3D12Device7;
+
+#endif /* __ID3D12Device7_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device8_FWD_DEFINED__
+#define __ID3D12Device8_FWD_DEFINED__
+typedef interface ID3D12Device8 ID3D12Device8;
+
+#endif /* __ID3D12Device8_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Resource1_FWD_DEFINED__
+#define __ID3D12Resource1_FWD_DEFINED__
+typedef interface ID3D12Resource1 ID3D12Resource1;
+
+#endif /* __ID3D12Resource1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Resource2_FWD_DEFINED__
+#define __ID3D12Resource2_FWD_DEFINED__
+typedef interface ID3D12Resource2 ID3D12Resource2;
+
+#endif /* __ID3D12Resource2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Heap1_FWD_DEFINED__
+#define __ID3D12Heap1_FWD_DEFINED__
+typedef interface ID3D12Heap1 ID3D12Heap1;
+
+#endif /* __ID3D12Heap1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList3_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList3_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList3 ID3D12GraphicsCommandList3;
+
+#endif /* __ID3D12GraphicsCommandList3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12MetaCommand_FWD_DEFINED__
+#define __ID3D12MetaCommand_FWD_DEFINED__
+typedef interface ID3D12MetaCommand ID3D12MetaCommand;
+
+#endif /* __ID3D12MetaCommand_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList4_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList4_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList4 ID3D12GraphicsCommandList4;
+
+#endif /* __ID3D12GraphicsCommandList4_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12ShaderCacheSession_FWD_DEFINED__
+#define __ID3D12ShaderCacheSession_FWD_DEFINED__
+typedef interface ID3D12ShaderCacheSession ID3D12ShaderCacheSession;
+
+#endif /* __ID3D12ShaderCacheSession_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device9_FWD_DEFINED__
+#define __ID3D12Device9_FWD_DEFINED__
+typedef interface ID3D12Device9 ID3D12Device9;
+
+#endif /* __ID3D12Device9_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device10_FWD_DEFINED__
+#define __ID3D12Device10_FWD_DEFINED__
+typedef interface ID3D12Device10 ID3D12Device10;
+
+#endif /* __ID3D12Device10_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device11_FWD_DEFINED__
+#define __ID3D12Device11_FWD_DEFINED__
+typedef interface ID3D12Device11 ID3D12Device11;
+
+#endif /* __ID3D12Device11_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device12_FWD_DEFINED__
+#define __ID3D12Device12_FWD_DEFINED__
+typedef interface ID3D12Device12 ID3D12Device12;
+
+#endif /* __ID3D12Device12_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device13_FWD_DEFINED__
+#define __ID3D12Device13_FWD_DEFINED__
+typedef interface ID3D12Device13 ID3D12Device13;
+
+#endif /* __ID3D12Device13_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device14_FWD_DEFINED__
+#define __ID3D12Device14_FWD_DEFINED__
+typedef interface ID3D12Device14 ID3D12Device14;
+
+#endif /* __ID3D12Device14_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
+#define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
+typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice;
+
+#endif /* __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Tools_FWD_DEFINED__
+#define __ID3D12Tools_FWD_DEFINED__
+typedef interface ID3D12Tools ID3D12Tools;
+
+#endif /* __ID3D12Tools_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12SDKConfiguration_FWD_DEFINED__
+#define __ID3D12SDKConfiguration_FWD_DEFINED__
+typedef interface ID3D12SDKConfiguration ID3D12SDKConfiguration;
+
+#endif /* __ID3D12SDKConfiguration_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12SDKConfiguration1_FWD_DEFINED__
+#define __ID3D12SDKConfiguration1_FWD_DEFINED__
+typedef interface ID3D12SDKConfiguration1 ID3D12SDKConfiguration1;
+
+#endif /* __ID3D12SDKConfiguration1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceFactory_FWD_DEFINED__
+#define __ID3D12DeviceFactory_FWD_DEFINED__
+typedef interface ID3D12DeviceFactory ID3D12DeviceFactory;
+
+#endif /* __ID3D12DeviceFactory_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceConfiguration_FWD_DEFINED__
+#define __ID3D12DeviceConfiguration_FWD_DEFINED__
+typedef interface ID3D12DeviceConfiguration ID3D12DeviceConfiguration;
+
+#endif /* __ID3D12DeviceConfiguration_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceConfiguration1_FWD_DEFINED__
+#define __ID3D12DeviceConfiguration1_FWD_DEFINED__
+typedef interface ID3D12DeviceConfiguration1 ID3D12DeviceConfiguration1;
+
+#endif /* __ID3D12DeviceConfiguration1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList5_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList5_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5;
+
+#endif /* __ID3D12GraphicsCommandList5_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList6_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList6_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList6 ID3D12GraphicsCommandList6;
+
+#endif /* __ID3D12GraphicsCommandList6_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList7_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList7_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList7 ID3D12GraphicsCommandList7;
+
+#endif /* __ID3D12GraphicsCommandList7_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList8_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList8_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList8 ID3D12GraphicsCommandList8;
+
+#endif /* __ID3D12GraphicsCommandList8_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList9_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList9_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList9 ID3D12GraphicsCommandList9;
+
+#endif /* __ID3D12GraphicsCommandList9_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList10_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList10_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList10 ID3D12GraphicsCommandList10;
+
+#endif /* __ID3D12GraphicsCommandList10_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GBVDiagnostics_FWD_DEFINED__
+#define __ID3D12GBVDiagnostics_FWD_DEFINED__
+typedef interface ID3D12GBVDiagnostics ID3D12GBVDiagnostics;
+
+#endif /* __ID3D12GBVDiagnostics_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgicommon.h"
+#include "dxgiformat.h"
+#include "d3dcommon.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12_0000_0000 */
+/* [local] */
+
+#include <winapifamily.h>
+#pragma region App Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
+#ifndef _D3D12_CONSTANTS
+#define _D3D12_CONSTANTS
+#define D3D12_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff )
+
+#define D3D12_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff )
+
+#define D3D12_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff )
+
+#define D3D12_APPEND_ALIGNED_ELEMENT ( 0xffffffff )
+
+#define D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 )
+
+#define D3D12_CLIP_OR_CULL_DISTANCE_COUNT ( 8 )
+
+#define D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT ( 16 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 )
+
+#define D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 )
+
+#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 )
+
+#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 )
+
+#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 )
+
+#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 )
+
+#define D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT ( 256 )
+
+#define D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 )
+
+#define D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 )
+
+#define D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 )
+
+#define D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 )
+
+#define D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 )
+
+#define D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 )
+
+#define D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 )
+
+#define D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 )
+
+#define D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 )
+
+#define D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 )
+
+#define D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 )
+
+#define D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 )
+
+#define D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 )
+
+#define D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 )
+
+#define D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 )
+
+#define D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 )
+
+#define D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 )
+
+#define D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 )
+
+#define D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 )
+
+#define D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 )
+
+#define D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 )
+
+#define D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 )
+
+#define D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 )
+
+#define D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 )
+
+#define D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 )
+
+#define D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 )
+
+#define D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 )
+
+#define D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 )
+
+#define D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 )
+
+#define D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 )
+
+#define D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 )
+
+#define D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 )
+
+#define D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 )
+
+#define D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_X ( 768 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_Y ( 768 )
+
+#define D3D12_CS_4_X_UAV_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 )
+
+#define D3D12_CS_TGSM_REGISTER_COUNT ( 8192 )
+
+#define D3D12_CS_TGSM_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADGROUPID_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADIDINGROUP_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADID_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_X ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_Y ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_Z ( 64 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_X ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_Y ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_Z ( 1 )
+
+#define D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 )
+
+#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_RED ( 1.0f )
+#define D3D12_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f )
+#define D3D12_DEFAULT_DEPTH_BIAS ( 0 )
+
+#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f )
+#define D3D12_DEFAULT_MAX_ANISOTROPY ( 16 )
+
+#define D3D12_DEFAULT_MIP_LOD_BIAS ( 0.0f )
+#define D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 4194304 )
+
+#define D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 )
+
+#define D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 )
+
+#define D3D12_DEFAULT_SAMPLE_MASK ( 0xffffffff )
+
+#define D3D12_DEFAULT_SCISSOR_ENDX ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_ENDY ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_STARTX ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_STARTY ( 0 )
+
+#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f )
+#define D3D12_DEFAULT_STENCIL_READ_MASK ( 0xff )
+
+#define D3D12_DEFAULT_STENCIL_REFERENCE ( 0 )
+
+#define D3D12_DEFAULT_STENCIL_WRITE_MASK ( 0xff )
+
+#define D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_HEIGHT ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f )
+#define D3D12_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f )
+#define D3D12_DEFAULT_VIEWPORT_TOPLEFTX ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_TOPLEFTY ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_WIDTH ( 0 )
+
+#define D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND ( 0xffffffff )
+
+#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END ( 0xfffffff7 )
+
+#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 )
+
+#define D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 )
+#define D3D12_FLOAT32_MAX ( 3.402823466e+38f )
+#define D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f )
+#define D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f )
+#define D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f )
+#define D3D12_FLOAT_TO_SRGB_OFFSET ( 0.055f )
+#define D3D12_FLOAT_TO_SRGB_SCALE_1 ( 12.92f )
+#define D3D12_FLOAT_TO_SRGB_SCALE_2 ( 1.055f )
+#define D3D12_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f )
+#define D3D12_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f )
+#define D3D12_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f )
+#define D3D12_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f )
+#define D3D12_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f )
+#define D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_C
(Patch may be truncated, please check the link at the top of this post.)