Pārlūkot izejas kodu

started dx12 driver

Nicolas Cannasse 3 gadi atpakaļ
vecāks
revīzija
88a80255f1

+ 1 - 0
.gitignore

@@ -20,6 +20,7 @@ x64
 *.a
 *.opendb
 *.VC.db
+.vs
 /hl
 /include/sdl
 /include/openal

+ 5 - 1
libs/directx/dx/Driver.hx

@@ -1,5 +1,7 @@
 package dx;
 
+#if !dx12
+
 typedef DriverInstance = hl.Abstract<"dx_driver">;
 
 typedef Pointer = hl.Abstract<"dx_pointer">;
@@ -756,4 +758,6 @@ class Driver {
 		return null;
 	}
 
-}
+}
+
+#end

+ 233 - 0
libs/directx/dx/Dx12.hx

@@ -0,0 +1,233 @@
+package dx;
+
+import haxe.Int64;
+
+typedef DriverInstance = hl.Abstract<"dx_driver">;
+
+enum DriverInitFlag {
+	Debug;
+}
+
+enum abstract CommandListType(Int) {
+	public var Direct = 0;
+	public var Bundle = 1;
+	public var Compute = 2;
+	public var Copy = 3;
+	public var VideoDecode = 4;
+	public var VideoProcess = 5;
+	public var VideoEncode = 6;
+}
+
+typedef DriverInitFlags = haxe.EnumFlags<DriverInitFlag>;
+
+@:hlNative("dx12","resource_")
+abstract Resource(hl.Abstract<"dx_resource">) {
+	public function release() {}
+}
+
+abstract PipelineState(Resource) {
+}
+
+@:hlNative("dx12","command_allocator_")
+abstract CommandAllocator(Resource) {
+	public function new(type) {
+		this = create(type);
+	}
+	public function reset() {}
+	static function create( type : CommandListType ) : Resource { return null; }
+}
+
+@:hlNative("dx12","command_list_")
+abstract CommandList(Resource) {
+	public function new(mask,type,alloc,state) {
+		this = create(mask,type,alloc,state);
+	}
+	public function close() {}
+	public function execute() {}
+	public function clearRenderTargetView( rtv : Address, color : ClearColor ) {}
+	public function reset( alloc : CommandAllocator, state : PipelineState ) {}
+	public function resourceBarrier( b : ResourceBarrier ) {}
+	static function create( mask : Int, type : CommandListType, alloc : CommandAllocator, state : PipelineState ) : Resource { return null; }
+}
+
+enum abstract FenceFlags(Int) {
+	var None = 0;
+	var Shared = 1;
+	var SharedCrossAdapter = 2;
+	var NonMonitored = 4;
+}
+
+@:hlNative("dx12","fence_")
+abstract Fence(Resource) {
+	public function new(value,flags) {
+		this = create(value, flags);
+	}
+	@:hlNative("dx12","fence_get_completed_value")
+	public function getValue() : Int64 { return 0; }
+	public function setEvent( value : Int64, event : WaitEvent ) {}
+	static function create( value : Int64, flags : FenceFlags ) : Resource { return null; }
+}
+
+@:hlNative("dx12","waitevent_")
+abstract WaitEvent(hl.Abstract<"dx_event">) {
+
+	public function new(state) {
+		this = cast create(state);
+	}
+
+	public function wait( time : Int ) : Bool { return false; }
+	static function create( state : Bool ) : WaitEvent { return null; }
+}
+
+enum abstract DescriptorHeapType(Int) {
+	var CBV_SRV_UAV = 0;
+	var SAMPLER = 1;
+	var RTV = 2;
+	var DSV = 3;
+}
+
+enum abstract DescriptorHeapFlags(Int) {
+	var None = 0;
+	var ShaderVisible = 1;
+}
+
+@:struct class DescriptorHeapDesc {
+	public var type : DescriptorHeapType;
+	public var numDescriptors : Int;
+	public var flags : DescriptorHeapFlags;
+	public var nodeMask : Int;
+	public function new() {
+	}
+}
+
+abstract Address(Int64) from Int64 {
+	public inline function offset( delta : Int ) : Address {
+		return cast this + delta;
+	}
+}
+
+@:hlNative("dx12","descriptor_heap_")
+abstract DescriptorHeap(Resource) {
+	public function new(desc) {
+		this = create(desc);
+	}
+
+	@:hlNative("dx12","descriptor_heap_get_handle")
+	public function getHandle( gpu : Bool ) : Address { return cast null; }
+	static function create( desc : DescriptorHeapDesc ) : Resource { return null; }
+}
+
+enum abstract ResourceBarrierType(Int) {
+	var Transition = 0;
+	var Aliasing = 1;
+	var UAV = 2;
+}
+
+enum abstract ResourceBarrierFlags(Int) {
+	var None = 0;
+	var BeginOnly = 1;
+	var EndOnly = 2;
+}
+
+enum abstract ResourceState(Int) {
+	public var Common = 0;
+	public var VertexAndConstantBuffer = 0x1;
+	public var IndexBuffer = 0x2;
+	public var RenderTarget = 0x4;
+	public var UnorderedAccess = 0x8;
+	public var DepthWrite = 0x10;
+	public var DepthRead = 0x20;
+	public var NonPixelShaderResource = 0x40;
+	public var PixelShaderResource = 0x80;
+	public var StreamOut = 0x100;
+	public var IndirectArgument = 0x200;
+	public var CopyDest = 0x400;
+	public var CopySource = 0x800;
+	public var ResolveDest = 0x1000;
+	public var ResolveSource = 0x2000;
+	public var RaytracingAccelerationStructure = 0x400000;
+	public var ShadingRateSource = 0x1000000;
+	public var GenericRead = 0x1 | 0x2 | 0x40  | 0x80  | 0x200  | 0x800;
+	public var AllShaderResource = 0x40 | 0x80;
+	public var Present = 0;
+	public var Predication = 0x200;
+	public var VideoDecodeRead = 0x10000;
+	public var VideoDecodeWrite = 0x20000;
+	public var VideoProcessRead = 0x40000;
+	public var VideoProcessWrite = 0x80000;
+	public var VideoEncodeRead = 0x200000;
+	public var VideoEncodeWrite = 0x800000;
+}
+
+@:struct class ClearColor {
+	public var r : Single;
+	public var g : Single;
+	public var b : Single;
+	public var a : Single;
+	public function new() {
+	}
+}
+
+@:struct class ResourceBarrier {
+	var type : ResourceBarrierType;
+	public var flags : ResourceBarrierFlags;
+	public var resource : Resource;
+	public var subResource : Int;
+	public var stateBefore : ResourceState;
+	public var stateAfter : ResourceState;
+	public function new() { type = Transition; }
+}
+
+@:struct class RenderTargetViewDesc {
+}
+
+@:hlNative("dx12")
+class Dx12 {
+
+	public static function create( win : Window, flags : DriverInitFlags ) {
+		return dxCreate(@:privateAccess win.win, flags);
+	}
+
+	public static function flushMessages() {
+	}
+
+	public static function getDescriptorHandleIncrementSize( type : DescriptorHeapType ) : Int {
+		return 0;
+	}
+
+	public static function getBackBuffer( index : Int ) : Resource {
+		return null;
+	}
+
+	public static function getCurrentBackBufferIndex() : Int {
+		return 0;
+	}
+
+	public static function createRenderTargetView( buffer : Resource, desc : RenderTargetViewDesc, target : Address ) {
+	}
+
+	public static function resize( width : Int, height : Int, bufferCount : Int ) : Bool {
+		return false;
+	}
+
+	public static function signal( fence : Fence, value : Int64 ) {
+	}
+
+	public static function present( vsync : Bool ) {
+	}
+
+	public static function getDeviceName() {
+		return @:privateAccess String.fromUCS2(dxGetDeviceName());
+	}
+
+	@:hlNative("dx12", "get_device_name")
+	static function dxGetDeviceName() : hl.Bytes {
+		return null;
+	}
+
+	@:hlNative("dx12", "create")
+	static function dxCreate( win : hl.Abstract<"dx_window">, flags : DriverInitFlags ) : DriverInstance {
+		return null;
+	}
+
+}

+ 294 - 0
libs/directx/dx12.cpp

@@ -0,0 +1,294 @@
+#define HL_NAME(n) dx12_##n
+#include <hl.h>
+
+#ifdef HL_WIN_DESKTOP
+#include <dxgi.h>
+#include <dxgi1_5.h>
+#include <d3d12.h>
+#endif
+
+#define DXERR(cmd)	{ HRESULT __ret = cmd; if( __ret == E_OUTOFMEMORY ) return NULL; if( __ret != S_OK ) ReportDxError(__ret,__LINE__); }
+#define CHKERR(cmd) { HRESULT __ret = cmd; if( __ret != S_OK ) ReportDxError(__ret,__LINE__); }
+
+typedef struct {
+	HWND wnd;
+	IDXGIFactory4 *factory;
+	IDXGIAdapter1 *adapter;
+	IDXGISwapChain4 *swapchain;
+	ID3D12Device *device;
+	ID3D12CommandQueue *commandQueue;
+	ID3D12Debug1 *debug;
+    ID3D12DebugDevice *debugDevice;
+	ID3D12InfoQueue *infoQueue;
+} dx_driver;
+
+static dx_driver *static_driver = NULL;
+
+void dx12_flush_messages();
+
+static void ReportDxError( HRESULT err, int line ) {
+	dx12_flush_messages();
+	hl_error("DXERROR %X line %d",(DWORD)err,line);
+}
+
+static void OnDebugMessage( 
+D3D12_MESSAGE_CATEGORY Category,
+D3D12_MESSAGE_SEVERITY Severity,
+D3D12_MESSAGE_ID ID,
+LPCSTR pDescription,
+void *pContext ) {
+	printf("%s\n", pDescription);
+	fflush(stdout);
+}
+
+
+HL_PRIM dx_driver *HL_NAME(create)( HWND window, int flags ) {
+	UINT dxgiFlags = 0;
+	dx_driver *drv = (dx_driver*)hl_gc_alloc_raw(sizeof(dx_driver));
+	memset(drv,0,sizeof(dx_driver));
+	drv->wnd = window;
+
+	if( flags & 1 ) {
+		ID3D12Debug *debugController;
+		D3D12GetDebugInterface(IID_PPV_ARGS(&debugController));
+		debugController->QueryInterface(&drv->debug);
+		drv->debug->EnableDebugLayer();
+		drv->debug->SetEnableGPUBasedValidation(true);
+		dxgiFlags |= DXGI_CREATE_FACTORY_DEBUG;
+		debugController->Release();
+	}
+	CHKERR(CreateDXGIFactory2(dxgiFlags, IID_PPV_ARGS(&drv->factory)));
+
+	UINT index = 0;
+	IDXGIAdapter1 *adapter = NULL;
+	while( drv->factory->EnumAdapters1(index++,&adapter) != DXGI_ERROR_NOT_FOUND ) {
+		DXGI_ADAPTER_DESC1 desc;
+		adapter->GetDesc1(&desc);
+		if( desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE ) {
+			adapter->Release();
+			continue;
+		}
+		if( SUCCEEDED(D3D12CreateDevice(adapter,D3D_FEATURE_LEVEL_12_0,IID_PPV_ARGS(&drv->device))) ) {
+			drv->adapter = adapter;
+			break;
+		}
+		adapter->Release();
+	}
+	if( !drv->device )
+		return NULL;
+	drv->device->SetName(L"HL_DX12");
+	if( drv->debug ) {
+		CHKERR(drv->device->QueryInterface(IID_PPV_ARGS(&drv->debugDevice)));
+		CHKERR(drv->device->QueryInterface(IID_PPV_ARGS(&drv->infoQueue)));
+		drv->infoQueue->ClearStoredMessages();
+	}
+
+	{
+		D3D12_COMMAND_QUEUE_DESC desc = {};
+		desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
+		desc.Priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
+		desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
+		desc.NodeMask = 0;
+		CHKERR(drv->device->CreateCommandQueue(&desc,IID_PPV_ARGS(&drv->commandQueue)));
+	}
+
+	static_driver = drv;
+	return drv;
+}
+
+HL_PRIM void HL_NAME(resize)( int width, int height, int buffer_count ) {
+	dx_driver *drv = static_driver;
+	if( drv->swapchain ) {
+		drv->swapchain->ResizeBuffers(buffer_count, width, height, DXGI_FORMAT_R8G8B8A8_UNORM, 0);
+	} else {
+		DXGI_SWAP_CHAIN_DESC1 desc = {};
+		desc.Width = width;
+		desc.Height = height;
+		desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+		desc.BufferCount = buffer_count;
+		desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+		desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
+		desc.SampleDesc.Count = 1;
+
+		IDXGISwapChain1 *swapchain;
+		drv->factory->CreateSwapChainForHwnd(drv->commandQueue,drv->wnd,&desc,NULL,NULL,&swapchain);
+		swapchain->QueryInterface(IID_PPV_ARGS(&drv->swapchain));
+	}
+}
+
+HL_PRIM void HL_NAME(present)( bool vsync ) {
+	dx_driver *drv = static_driver;
+	UINT syncInterval = vsync ? 1 : 0;
+	UINT presentFlags = 0;
+	CHKERR(drv->swapchain->Present(syncInterval, presentFlags));
+}
+
+int HL_NAME(get_current_back_buffer_index)() {
+	return static_driver->swapchain->GetCurrentBackBufferIndex();
+}
+
+ID3D12Resource *HL_NAME(get_back_buffer)( int index ) {
+	ID3D12Resource *buf = NULL;
+	static_driver->swapchain->GetBuffer(index, IID_PPV_ARGS(&buf));
+	return buf;
+}
+
+void HL_NAME(create_render_target_view)( ID3D12Resource *res, D3D12_RENDER_TARGET_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor ) {
+	static_driver->device->CreateRenderTargetView(res,desc,descriptor);
+}
+
+void HL_NAME(signal)( ID3D12Fence *fence, int64 value ) {
+	static_driver->commandQueue->Signal(fence,value);
+}
+
+void HL_NAME(resource_release)( IUnknown *res ) {
+	res->Release();
+}
+
+void HL_NAME(flush_messages)() {
+	dx_driver *drv = static_driver;
+	if( !drv->infoQueue ) return;
+	int count = (int)drv->infoQueue->GetNumStoredMessages();
+	if( !count ) return;
+	int i;
+	for(i=0;i<count;i++) {
+		SIZE_T len = 0;
+		drv->infoQueue->GetMessage(i, NULL, &len);
+		D3D12_MESSAGE *msg = (D3D12_MESSAGE*)malloc(len);
+		drv->infoQueue->GetMessage(i, msg, &len);
+		printf("%s\n",msg->pDescription);
+		free(msg);
+		fflush(stdout);
+	}
+	drv->infoQueue->ClearStoredMessages();
+}
+
+uchar *HL_NAME(get_device_name)() {
+	DXGI_ADAPTER_DESC desc;
+	IDXGIAdapter *adapter = NULL;
+	if( !static_driver ) {
+		IDXGIFactory4 *factory = NULL;
+		CreateDXGIFactory2(0, IID_PPV_ARGS(&factory));
+		if( factory ) factory->EnumAdapters(0,&adapter);
+		if( !adapter )
+			return USTR("Unknown");
+	} else
+		adapter = static_driver->adapter;
+	adapter->GetDesc(&desc);
+	return (uchar*)hl_copy_bytes((vbyte*)desc.Description,(int)(ustrlen((uchar*)desc.Description)+1)*2);
+}
+
+#define _DRIVER _ABSTRACT(dx_driver)
+#define _RES _ABSTRACT(dx_resource)
+
+DEFINE_PRIM(_DRIVER, create, _ABSTRACT(dx_window) _I32);
+DEFINE_PRIM(_BOOL, resize, _I32 _I32 _I32);
+DEFINE_PRIM(_VOID, present, _BOOL);
+DEFINE_PRIM(_I32, get_current_back_buffer_index, _NO_ARG);
+DEFINE_PRIM(_VOID, create_render_target_view, _RES _STRUCT _I64);
+DEFINE_PRIM(_RES, get_back_buffer, _I32);
+DEFINE_PRIM(_VOID, resource_release, _RES);
+DEFINE_PRIM(_VOID, signal, _RES _I64);
+DEFINE_PRIM(_VOID, flush_messages, _NO_ARG);
+DEFINE_PRIM(_BYTES, get_device_name, _NO_ARG);
+
+// ---- HEAPS
+
+ID3D12DescriptorHeap *HL_NAME(descriptor_heap_create)( D3D12_DESCRIPTOR_HEAP_DESC *desc ) {
+	ID3D12DescriptorHeap *heap = NULL;
+	DXERR(static_driver->device->CreateDescriptorHeap(desc,IID_PPV_ARGS(&heap)));
+	return heap;
+}
+
+int HL_NAME(get_descriptor_handle_increment_size)( D3D12_DESCRIPTOR_HEAP_TYPE type ) {
+	return static_driver->device->GetDescriptorHandleIncrementSize(type);
+}
+
+int64 HL_NAME(descriptor_heap_get_handle)( ID3D12DescriptorHeap *heap, bool gpu ) {
+	UINT64 handle = gpu ? heap->GetGPUDescriptorHandleForHeapStart().ptr : heap->GetCPUDescriptorHandleForHeapStart().ptr;
+	return handle; 
+}
+
+DEFINE_PRIM(_RES, descriptor_heap_create, _STRUCT);
+DEFINE_PRIM(_I32, get_descriptor_handle_increment_size, _I32);
+DEFINE_PRIM(_I64, descriptor_heap_get_handle, _RES _BOOL);
+
+// ---- SYNCHRO
+
+ID3D12Fence *HL_NAME(fence_create)( int64 value, D3D12_FENCE_FLAGS flags ) {
+	ID3D12Fence *f = NULL;
+	DXERR(static_driver->device->CreateFence(value,flags, IID_PPV_ARGS(&f)));
+	return f;
+}
+
+int64 HL_NAME(fence_get_completed_value)( ID3D12Fence *fence ) {
+	return (int64)fence->GetCompletedValue();
+}
+
+void HL_NAME(fence_set_event)( ID3D12Fence *fence, int64 value, HANDLE event ) {
+	fence->SetEventOnCompletion(value, event);
+}
+
+HANDLE HL_NAME(waitevent_create)( bool initState ) {
+	return CreateEvent(NULL,FALSE,initState,NULL);
+}
+
+bool HL_NAME(waitevent_wait)( HANDLE event, int time ) {
+	return WaitForSingleObject(event,time) == 0;
+}
+
+#define _EVENT _ABSTRACT(dx_event)
+DEFINE_PRIM(_RES, fence_create, _I64 _I32);
+DEFINE_PRIM(_I64, fence_get_completed_value, _RES);
+DEFINE_PRIM(_VOID, fence_set_event, _RES _I64 _EVENT);
+DEFINE_PRIM(_EVENT, waitevent_create, _BOOL);
+DEFINE_PRIM(_BOOL, waitevent_wait, _EVENT _I32);
+
+
+// ---- COMMANDS
+
+ID3D12CommandAllocator *HL_NAME(command_allocator_create)( D3D12_COMMAND_LIST_TYPE type ) {
+	ID3D12CommandAllocator *a = NULL;
+	DXERR(static_driver->device->CreateCommandAllocator(type,IID_PPV_ARGS(&a)));
+	return a;
+}
+
+void HL_NAME(command_allocator_reset)( ID3D12CommandAllocator *a ) {
+	CHKERR(a->Reset());
+}
+
+ID3D12GraphicsCommandList *HL_NAME(command_list_create)( int nodeMask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *alloc, ID3D12PipelineState *initState ) {
+	ID3D12GraphicsCommandList *l = NULL;
+	DXERR(static_driver->device->CreateCommandList(nodeMask,type,alloc,initState,IID_PPV_ARGS(&l)));
+	return l;
+}
+
+void HL_NAME(command_list_close)( ID3D12GraphicsCommandList *l ) {
+	CHKERR(l->Close());
+}
+
+void HL_NAME(command_list_reset)( ID3D12GraphicsCommandList *l, ID3D12CommandAllocator *alloc, ID3D12PipelineState *state ) {
+	CHKERR(l->Reset(alloc,state));
+}
+
+void HL_NAME(command_list_execute)( ID3D12GraphicsCommandList *l ) {
+	ID3D12CommandList* const commandLists[] = { l };
+	static_driver->commandQueue->ExecuteCommandLists(1, commandLists);
+}
+
+void HL_NAME(command_list_resource_barrier)( ID3D12GraphicsCommandList *l, D3D12_RESOURCE_BARRIER *barrier ) {
+	l->ResourceBarrier(1,barrier);
+}
+
+void HL_NAME(command_list_clear_render_target_view)( ID3D12GraphicsCommandList *l, D3D12_CPU_DESCRIPTOR_HANDLE view, FLOAT *colors ) {
+	l->ClearRenderTargetView(view,colors,0,NULL);
+}
+
+DEFINE_PRIM(_RES, command_allocator_create, _I32);
+DEFINE_PRIM(_VOID, command_allocator_reset, _RES);
+DEFINE_PRIM(_RES, command_list_create, _I32 _I32 _RES _RES);
+DEFINE_PRIM(_VOID, command_list_close, _RES);
+DEFINE_PRIM(_VOID, command_list_reset, _RES _RES _RES);
+DEFINE_PRIM(_VOID, command_list_resource_barrier, _RES _STRUCT);
+DEFINE_PRIM(_VOID, command_list_execute, _RES);
+DEFINE_PRIM(_VOID, command_list_clear_render_target_view, _RES _I64 _STRUCT);

+ 31 - 0
libs/directx/dx12.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32106.194
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dx12", "dx12.vcxproj", "{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		ReleaseVS2017|x64 = ReleaseVS2017|x64
+		ReleaseVS2017|x86 = ReleaseVS2017|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.Debug|x64.ActiveCfg = Debug|x64
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.Debug|x64.Build.0 = Debug|x64
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.Debug|x86.ActiveCfg = Debug|Win32
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.Debug|x86.Build.0 = Debug|Win32
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.ReleaseVS2017|x64.ActiveCfg = ReleaseVS2017|x64
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.ReleaseVS2017|x64.Build.0 = ReleaseVS2017|x64
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.ReleaseVS2017|x86.ActiveCfg = ReleaseVS2017|Win32
+		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}.ReleaseVS2017|x86.Build.0 = ReleaseVS2017|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {07DDF0F6-CAE2-4E5F-9F7C-83E25A725087}
+	EndGlobalSection
+EndGlobal

+ 170 - 0
libs/directx/dx12.vcxproj

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseVS2017|Win32">
+      <Configuration>ReleaseVS2017</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseVS2017|x64">
+      <Configuration>ReleaseVS2017</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dx12.cpp" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>directx</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.hdll</TargetExt>
+    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../$(Configuration)</LibraryPath>
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../src</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.hdll</TargetExt>
+    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;../../x64/$(Configuration)</LibraryPath>
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../src</IncludePath>
+    <OutDir>$(SolutionDir)..\..\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <TargetExt>.hdll</TargetExt>
+    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../$(Configuration)</LibraryPath>
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../src</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <TargetExt>.hdll</TargetExt>
+    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;../../x64/$(Configuration)</LibraryPath>
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../src</IncludePath>
+    <OutDir>$(SolutionDir)..\..\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DIRECTX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <OutputFile>../../$(Configuration)/$(TargetName).hdll</OutputFile>
+      <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;DIRECTX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DIRECTX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <OutputFile>../../$(Configuration)/$(TargetName).hdll</OutputFile>
+      <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;DIRECTX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>