Преглед изворни кода

more dx12 api, integrate with hl compilation

Nicolas Cannasse пре 3 година
родитељ
комит
a621812795
5 измењених фајлова са 537 додато и 155 уклоњено
  1. 20 0
      hl.sln
  2. 386 88
      libs/directx/dx/Dx12.hx
  3. 114 21
      libs/directx/dx12.cpp
  4. 0 31
      libs/directx/dx12.sln
  5. 17 15
      libs/directx/dx12.vcxproj

+ 20 - 0
hl.sln

@@ -18,10 +18,12 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hl", "hl.vcxproj", "{BBF750D2-6DD2-4A41-AC3A-07C070B94FA1}"
 	ProjectSection(ProjectDependencies) = postProject
 		{76E4DB00-8114-4B96-BA76-39D800F8D5EE} = {76E4DB00-8114-4B96-BA76-39D800F8D5EE}
+		{540E0E11-B7B1-43F8-B107-0867B2D97F74} = {540E0E11-B7B1-43F8-B107-0867B2D97F74}
 		{7DDA1414-6675-45C7-8254-42057901F865} = {7DDA1414-6675-45C7-8254-42057901F865}
 		{6534D221-34DF-404A-AFCD-6DEC9BBC9798} = {6534D221-34DF-404A-AFCD-6DEC9BBC9798}
 		{12049F27-EA26-4A33-ADF8-E542C4167C00} = {12049F27-EA26-4A33-ADF8-E542C4167C00}
 		{EC2DCE5C-267A-4050-8DDE-5BF58FF08E31} = {EC2DCE5C-267A-4050-8DDE-5BF58FF08E31}
+		{F9A2435E-D545-43EB-B471-A4497D96A71B} = {F9A2435E-D545-43EB-B471-A4497D96A71B}
 		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04} = {EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}
 		{C6213FBF-BC2B-4235-A827-84A60E848C52} = {C6213FBF-BC2B-4235-A827-84A60E848C52}
 		{F4D939D6-88D6-4FF2-874A-7BECF75A01C2} = {F4D939D6-88D6-4FF2-874A-7BECF75A01C2}
@@ -65,6 +67,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql", "libs\mysql\mysql.v
 		{C6213FBF-BC2B-4235-A827-84A60E848C52} = {C6213FBF-BC2B-4235-A827-84A60E848C52}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dx12", "libs\directx\dx12.vcxproj", "{F9A2435E-D545-43EB-B471-A4497D96A71B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C6213FBF-BC2B-4235-A827-84A60E848C52} = {C6213FBF-BC2B-4235-A827-84A60E848C52}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -207,6 +214,18 @@ Global
 		{540E0E11-B7B1-43F8-B107-0867B2D97F74}.ReleaseVS2013|Win32.Build.0 = ReleaseVS2013|Win32
 		{540E0E11-B7B1-43F8-B107-0867B2D97F74}.ReleaseVS2013|x64.ActiveCfg = ReleaseVS2013|x64
 		{540E0E11-B7B1-43F8-B107-0867B2D97F74}.ReleaseVS2013|x64.Build.0 = ReleaseVS2013|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Debug|Win32.Build.0 = Debug|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Debug|x64.ActiveCfg = Debug|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Debug|x64.Build.0 = Debug|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Release|Win32.ActiveCfg = Release|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Release|Win32.Build.0 = Release|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Release|x64.ActiveCfg = Release|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.Release|x64.Build.0 = Release|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.ReleaseVS2013|Win32.ActiveCfg = Release|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.ReleaseVS2013|Win32.Build.0 = Release|Win32
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.ReleaseVS2013|x64.ActiveCfg = Release|x64
+		{F9A2435E-D545-43EB-B471-A4497D96A71B}.ReleaseVS2013|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -221,6 +240,7 @@ Global
 		{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04} = {0EC4330B-6B61-45F8-B297-CA7097AFFD98}
 		{EC2DCE5C-267A-4050-8DDE-5BF58FF08E31} = {0EC4330B-6B61-45F8-B297-CA7097AFFD98}
 		{540E0E11-B7B1-43F8-B107-0867B2D97F74} = {0EC4330B-6B61-45F8-B297-CA7097AFFD98}
+		{F9A2435E-D545-43EB-B471-A4497D96A71B} = {0EC4330B-6B61-45F8-B297-CA7097AFFD98}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {52150AEE-F84D-4481-89B7-00D273AE84AF}

+ 386 - 88
libs/directx/dx/Dx12.hx

@@ -5,17 +5,17 @@ import haxe.Int64;
 typedef DriverInstance = hl.Abstract<"dx_driver">;
 
 enum DriverInitFlag {
-	Debug;
+	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;
+	public var DIRECT = 0;
+	public var BUNDLE = 1;
+	public var COMPUTE = 2;
+	public var COPY = 3;
+	public var VIDEO_DECODE = 4;
+	public var VIDEO_PROCESS = 5;
+	public var VIDEO_ENCODE = 6;
 }
 
 typedef DriverInitFlags = haxe.EnumFlags<DriverInitFlag>;
@@ -25,6 +25,22 @@ abstract Resource(hl.Abstract<"dx_resource">) {
 	public function release() {}
 }
 
+@:struct class Range {
+	public var begin : Int64;
+	public var end : Int64;
+	public function new() {
+	}
+}
+
+@:hlNative("dx12","resource_")
+abstract GpuResource(Resource) {
+	@:hlNative("dx12","resource_get_gpu_virtual_address")
+	public function getGpuVirtualAddress() : Int64 { return 0; }
+	public function map( subResource : Int, range : Range ) : hl.Bytes { return null; }
+	public function unmap( subResource : Int, writtenRange : Range ) {}
+	@:to inline function to() : Resource { return cast this; }
+}
+
 abstract PipelineState(Resource) {
 }
 
@@ -37,24 +53,100 @@ abstract CommandAllocator(Resource) {
 	static function create( type : CommandListType ) : Resource { return null; }
 }
 
+enum abstract ClearFlags(Int) {
+	var DEPTH = 1;
+	var STENCIL = 2;
+	var BOTH = 3;
+}
+
+enum abstract PrimitiveTopology(Int) {
+	var UNDEFINED = 0;
+	var POINTLIST = 1;
+	var LINELIST = 2;
+	var LINESTRIP = 3;
+	var TRIANGLELIST = 4;
+	var TRIANGLESTRIP = 5;
+	var LINELIST_ADJ = 10;
+	var LINESTRIP_ADJ = 11;
+	var TRIANGLELIST_ADJ = 12;
+	var TRIANGLESTRIP_ADJ = 13;
+	public static function controlPointPatchList( count : Int ) : PrimitiveTopology {
+		return cast (32 + count);
+	}
+}
+
+@:struct class VertexBufferView {
+	public var bufferLocation : Address;
+	public var sizeInBytes : Int;
+	public var strideInBytes : Int;
+	public function new() {
+	}
+}
+
+@:struct class IndexBufferView {
+	public var bufferLocation : Address;
+	public var sizeInBytes : Int;
+	public var format : DxgiFormat;
+	public function new() {
+	}
+}
+
+@:struct class Viewport {
+	public var topLeftX : Single;
+	public var topLeftY : Single;
+	public var width : Single;
+	public var height : Single;
+	public var minDepth : Single;
+	public var maxDepth : Single;
+	public function new() {
+	}
+}
+
+@:struct class Rect {
+	public var left : Int;
+	public var top : Int;
+	public var right : Int;
+	public var bottom : Int;
+	public function new() {
+	}
+}
+
 @:hlNative("dx12","command_list_")
 abstract CommandList(Resource) {
 	public function new(type,alloc,state) {
 		this = create(type,alloc,state);
 	}
+
 	public function close() {}
 	public function execute() {}
 	public function clearRenderTargetView( rtv : Address, color : ClearColor ) {}
+	public function clearDepthStencilView( rtv : Address, flags : ClearFlags, depth : Single, stencil : Int ) {}
 	public function reset( alloc : CommandAllocator, state : PipelineState ) {}
 	public function resourceBarrier( b : ResourceBarrier ) {}
+	public function setPipelineState( state : PipelineState ) {}
+	public function setGraphicsRootSignature( sign : RootSignature ) {}
+	public function copyBufferRegion( dst : GpuResource, dstOffset : Int64, src : GpuResource, srcOffset : Int64, size : Int64 ) {}
+
+	public function iaSetPrimitiveTopology( top : PrimitiveTopology ) {}
+	public function iaSetVertexBuffers( startSlot : Int, numViews : Int, views : VertexBufferView ) {}
+	public function iaSetIndexBuffer( view : IndexBufferView ) {}
+
+	public function drawInstanced( vertexCountPerInstance : Int, instanceCount : Int, startVertexLocation : Int, startInstanceLocation : Int ) {}
+	public function drawIndexedInstanced( indexCountPerInstance : Int, instanceCount : Int, startIndexLocation : Int, baseVertexLocation : Int, startInstanceLocation : Int ) {}
+
+	public function omSetRenderTargets( count : Int, handles : hl.BytesAccess<Address>, flag : Bool32, depthStencils : hl.BytesAccess<Address> ) {}
+
+	public function rsSetViewports( count : Int, viewports : Viewport ) {}
+	public function rsSetScissorRects( count : Int, rects : Rect ) {}
+
 	static function create( 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;
+	var NONE = 0;
+	var SHARED = 1;
+	var SHARED_CROSS_ADAPTER = 2;
+	var NON_MONITORED = 4;
 }
 
 @:hlNative("dx12","fence_")
@@ -87,8 +179,8 @@ enum abstract DescriptorHeapType(Int) {
 }
 
 enum abstract DescriptorHeapFlags(Int) {
-	var None = 0;
-	var ShaderVisible = 1;
+	var NONE = 0;
+	var SHADER_VISIBLE = 1;
 }
 
 @:struct class DescriptorHeapDesc {
@@ -138,45 +230,45 @@ abstract DescriptorHeap(Resource) {
 }
 
 enum abstract ResourceBarrierType(Int) {
-	var Transition = 0;
-	var Aliasing = 1;
+	var TRANSITION = 0;
+	var ALIASING = 1;
 	var UAV = 2;
 }
 
 enum abstract ResourceBarrierFlags(Int) {
-	var None = 0;
-	var BeginOnly = 1;
-	var EndOnly = 2;
+	var NONE = 0;
+	var BEGIN_ONLY = 1;
+	var END_ONLY = 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;
+	public var COMMON = 0;
+	public var VERTEX_AND_CONSTANT_BUFFER = 0x1;
+	public var INDEX_BUFFER = 0x2;
+	public var RENDER_TARGET = 0x4;
+	public var UNORDERED_ACCESS = 0x8;
+	public var DEPTH_WRITE = 0x10;
+	public var DEPTH_READ = 0x20;
+	public var NON_PIXEL_SHADER_RESOURCE = 0x40;
+	public var PIXEL_SHADER_RESOURCE = 0x80;
+	public var STREAM_OUT = 0x100;
+	public var INDIRECT_ARGUMENT = 0x200;
+	public var COPY_DESC = 0x400;
+	public var COPY_SOURCE = 0x800;
+	public var RESOLVE_DESC = 0x1000;
+	public var RESOLVE_SOURCE = 0x2000;
+	public var RAYTRACING_ACCELERATION_STRUCTURE = 0x400000;
+	public var SHADING_RATE_SOURCE = 0x1000000;
+	public var GENERIC_READ = 0x1 | 0x2 | 0x40  | 0x80  | 0x200  | 0x800;
+	public var ALL_SHADER_RESOURCE = 0x40 | 0x80;
+	public var PRESENT = 0;
+	public var PREDICATIOn = 0x200;
+	public var VIDE_DECODE_READ = 0x10000;
+	public var VIDE_DECODE_WRITE = 0x20000;
+	public var VIDE_PROCESS_READ = 0x40000;
+	public var VIDE_PROCESS_WRITE = 0x80000;
+	public var VIDE_ENCODE_READ = 0x200000;
+	public var VIDE_ENCODE_WRITE = 0x800000;
 }
 
 @:struct class ClearColor {
@@ -195,14 +287,75 @@ enum abstract ResourceState(Int) {
 	public var subResource : Int;
 	public var stateBefore : ResourceState;
 	public var stateAfter : ResourceState;
-	public function new() { type = Transition; }
+	public function new() { type = TRANSITION; }
+}
+
+enum abstract DsvDimension(Int) {
+	var UNKNOWN	= 0;
+    var TEXTURE1D = 1;
+    var TEXTURE1DARRAY = 2;
+    var TEXTURE2D = 3;
+    var TEXTURE2DARRAY = 4;
+    var TEXTURE2DMS = 5;
+    var TEXTURE2DMSARRAY = 6;
 }
 
 @:struct class RenderTargetViewDesc {
+	public var format : DxgiFormat;
+	public var viewDimension : DsvDimension;
+
+	var int0 : Int;
+	var int1 : Int;
+	var int2 : Int;
+	var int3 : Int;
+
+	public var mipSlice(get,set) : Int;
+
+	public var firstElement(get,set) : Int;
+	public var numElements(get,set) : Int;
+
+	public var firstArraySlice(get,set) : Int;
+	public var arraySize(get,set) : Int;
+	public var planeSlice(get,set) : Int;
+
+	inline function get_firstElement() return int0;
+	inline function set_firstElement(v) return int0 = v;
+	inline function get_numElements() return int1;
+	inline function set_numElements(v) return int1 = v;
+	inline function get_mipSlice() return int0;
+	inline function set_mipSlice(v) return int0 = v;
+
+	inline function get_firstArraySlice() return switch( viewDimension ) { case TEXTURE2DMSARRAY: int0; default: int1; };
+	inline function set_firstArraySlice(v) return switch( viewDimension ) { case TEXTURE2DMSARRAY: int0 = v; default: int1 = v; };
+
+	inline function get_arraySize() return switch( viewDimension ) { case TEXTURE2DMSARRAY: int1; default: int2; };
+	inline function set_arraySize(v) return switch( viewDimension ) { case TEXTURE2DMSARRAY: int1 = v; default: int2 = v; };
+
+	inline function get_planeSlice() return switch( viewDimension ) { case TEXTURE2D: int1; default: int3; };
+	inline function set_planeSlice(v) return switch( viewDimension ) { case TEXTURE2D: int1 = v; default: int3 = v; };
+
+	function new() {
+	}
+}
+
+
+enum DsvFlags {
+	READ_ONLY_DEPTH;
+	READ_ONLY_STENCIL;
+}
+
+@:struct class DepthStencilViewDesc {
+	public var format : DxgiFormat;
+	public var viewDimension : DsvDimension;
+	public var flags : haxe.EnumFlags<DsvFlags>;
+	public var mipSlice : Int;
+	public var firstArraySlice : Int;
+	public var arraySize : Int;
+	public function new() {
+	}
 }
 
 enum RootSignatureFlag {
-	NONE;
 	ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT;
 	DENY_VERTEX_SHADER_ROOT_ACCESS;
 	DENY_HULL_SHADER_ROOT_ACCESS;
@@ -218,8 +371,8 @@ enum RootSignatureFlag {
 }
 
 enum abstract RootParameterType(Int) {
-	var DescriptorTable = 0;
-	var Constants = 1;
+	var DESCRIPTOR_TABLE = 0;
+	var CONSTANTS = 1;
 	var CBV = 2;
 	var SRV = 3;
 	var UAV = 4;
@@ -253,7 +406,7 @@ enum abstract DescriptorRangeType(Int) {
 	public var descriptorRanges : DescriptorRange;
 	public var shaderVisibility : ShaderVisibility;
 	public function new() {
-		parameterType = DescriptorTable;
+		parameterType = DESCRIPTOR_TABLE;
 	}
 }
 
@@ -264,7 +417,7 @@ enum abstract DescriptorRangeType(Int) {
 	var __unused : Int;
 	public var shaderVisibility : ShaderVisibility;
 	public function new() {
-		parameterType = Constants;
+		parameterType = CONSTANTS;
 	}
 }
 
@@ -280,11 +433,11 @@ enum abstract DescriptorRangeType(Int) {
 }
 
 enum abstract AddressMode(Int) {
-	var Wrap = 1;
-	var Mirror = 2;
-	var Clamp = 3;
-	var Border = 4;
-	var Once = 5;
+	var WRAP = 1;
+	var MIRROR = 2;
+	var CLAMP = 3;
+	var BORDER = 4;
+	var ONCE = 5;
 }
 
 enum abstract Filter(Int) {
@@ -327,31 +480,31 @@ enum abstract Filter(Int) {
 }
 
 enum abstract ComparisonFunc(Int) {
-	var Never = 1;
-	var Less = 2;
-	var Equal = 3;
-	var LessEqual = 4;
-	var Greater = 5;
-	var NotEqual = 6;
-	var GreaterEqual = 7;
-	var Always = 8;
+	var NEVER = 1;
+	var LESS = 2;
+	var EQUAL = 3;
+	var LESS_EQUAL = 4;
+	var GREATER = 5;
+	var NOT_EQUAL = 6;
+	var GREATER_EQUAL = 7;
+	var ALWAYS = 8;
 }
 
 enum abstract StaticBorderColor(Int) {
-	var TransparentBlack = 0;
-	var OpaqueBlack = 1;
-	var OpaqueWhite = 2;
+	var TRANSPARENT_BLACK = 0;
+	var OPAQUE_BLACK = 1;
+	var OPAQUE_WHITE = 2;
 }
 
 enum abstract ShaderVisibility(Int) {
-	var All = 0;
-	var Vertex = 1;
-	var Hull = 2;
-	var Domain = 3;
-	var Geometry = 4;
-	var Pixel = 5;
-	var Amplification = 6;
-	var Mesh = 7;
+	var ALL = 0;
+	var VERTEX = 1;
+	var HULL = 2;
+	var DOMAIN = 3;
+	var GEOMETRY = 4;
+	var PIXEL = 5;
+	var AMPLIFICATION = 6;
+	var MESH = 7;
 }
 
 @:struct class StaticSamplerDesc {
@@ -391,6 +544,9 @@ abstract RootSignature(Resource) {
 }
 
 abstract GraphicsPipelineState(Resource) {
+	@:to inline function toPS():PipelineState {
+		return cast this;
+	}
 }
 
 abstract Bool32(Int) {
@@ -675,19 +831,19 @@ enum abstract LogicOp(Int) {
 }
 
 enum abstract FillMode(Int) {
-	var WireFrame = 2;
-	var Solid = 3;
+	var WIREFRAME = 2;
+	var SOLID = 3;
 }
 
 enum abstract CullMode(Int) {
-	var None = 1;
-	var Front = 2;
-	var Back = 3;
+	var NONE = 1;
+	var FRONT = 2;
+	var BACK = 3;
 }
 
 enum abstract ConservativeRasterMode(Int) {
-	var Off = 0;
-	var On = 1;
+	var OFF = 0;
+	var ON = 1;
 }
 
 @:struct class RasterizerDesc {
@@ -707,8 +863,8 @@ enum abstract ConservativeRasterMode(Int) {
 }
 
 enum abstract DepthWriteMask(Int) {
-	var Zero = 0;
-	var All = 1;
+	var ZERO = 0;
+	var ALL = 1;
 }
 
 enum abstract StencilOp(Int) {
@@ -769,7 +925,7 @@ enum abstract InputClassification(Int) {
 }
 
 enum abstract IndexBufferStripCutValue(Int) {
-	var Disabled = 0;
+	var DISABLED = 0;
 	var _0xFFFF = 1;
 	var _0xFFFFFFFF = 2;
 }
@@ -837,6 +993,141 @@ enum abstract PipelineStateFlags(Int) {
 	}
 }
 
+enum abstract HeapType(Int) {
+	var DEFAULT = 1;
+	var UPLOAD = 2;
+	var READBACK = 3;
+	var CUSTOM = 4;
+}
+
+enum abstract CpuPageProperty(Int) {
+	var UNKNOWN = 0;
+	var NOT_AVAILABLE = 1;
+	var WRITE_COMBINE = 2;
+	var WRITE_BACK = 3;
+}
+
+enum abstract MemoryPool(Int) {
+	var UNKNOWN = 0;
+	var L0 = 1;
+	var L1 = 2;
+}
+
+@:struct class HeapProperties {
+	public var type : HeapType;
+	public var cpuPageProperty : CpuPageProperty;
+	public var memoryPoolReference : MemoryPool;
+	public var creationNodeMask : Int;
+	public var visibleNodeMask : Int;
+	public function new() {
+	}
+}
+
+enum HeapFlag {
+	SHARED;
+	DENY_BUFFERS;
+	ALLOW_DISPLAY;
+	__UNUSED;
+	SHARED_CROSS_ADAPTER;
+	DENY_RT_DS_TEXTURES;
+	DENY_NON_RT_DS_TEXTURES;
+	HARDWARE_PROTECTED;
+	ALLOW_WRITE_WATCH;
+	ALLOW_SHADER_ATOMICS;
+	CREATE_NOT_RESIDENT;
+	CREATE_NOT_ZEROED;
+}
+
+enum abstract ResourceDimension(Int) {
+	var UNKNOWN = 0;
+	var BUFFER = 1;
+	var TEXTURE1D = 2;
+	var TEXTURE2D = 3;
+	var TEXTURE3D = 4;
+}
+
+enum abstract TextureLayout(Int) {
+	var UNKNOWN = 0;
+	var ROW_MAJOR = 1;
+	var _64KB_UNDEFINED_SWIZZLE = 2;
+	var _64KB_STANDARD_SWIZZLE = 3;
+}
+
+enum ResourceFlag {
+	ALLOW_RENDER_TARGET;
+	ALLOW_DEPTH_STENCIL;
+	ALLOW_UNORDERED_ACCESS;
+	DENY_SHADER_RESOURCE;
+	ALLOW_CROSS_ADAPTER;
+	ALLOW_SIMULTANEOUS_ACCESS;
+	VIDEO_DECODE_REFERENCE_ONLY;
+	VIDEO_ENCODE_REFERENCE_ONLY;
+}
+
+@:struct class ResourceDesc {
+	public var dimension : ResourceDimension;
+	public var alignment : Int64;
+	public var width : Int64;
+	public var height : Int;
+	public var depthOrArraySize : hl.UI16;
+	public var mipLevels : hl.UI16;
+	public var format : DxgiFormat;
+	@:packed public var sampleDesc(default,null) : DxgiSampleDesc;
+	public var layout : TextureLayout;
+	public var flags : haxe.EnumFlags<ResourceFlag>;
+	public function new() {
+	}
+}
+
+@:struct class ClearValue {
+	public var format : DxgiFormat;
+	public var red : Single;
+	public var green : Single;
+	public var blue : Single;
+	public var alpha : Single;
+	public var depth(get,set) : Float;
+	public var stencil(get,set) : Int;
+	inline function get_depth() return red;
+	inline function set_depth(v) return red = v;
+	function get_stencil() return haxe.io.FPHelper.floatToI32(green);
+	function set_stencil(v) {
+		green = haxe.io.FPHelper.i32ToFloat(v);
+		return v;
+	}
+}
+
+enum abstract ResourceStates(Int) {
+	var COMMON = 0;
+	var VERTEX_AND_CONSTANT_BUFFER = 0x1;
+	var INDEX_BUFFER = 0x2;
+	var RENDER_TARGET = 0x4;
+	var UNORDERED_ACCESS = 0x8;
+	var DEPTH_WRITE = 0x10;
+	var DEPTH_READ = 0x20;
+	var NON_PIXEL_SHADER_RESOURCE = 0x40;
+	var PIXEL_SHADER_RESOURCE = 0x80;
+	var STREAM_OUT = 0x100;
+	var INDIRECT_ARGUMENT = 0x200;
+	var COPY_DEST = 0x400;
+	var COPY_SOURCE = 0x800;
+	var RESOLVE_DEST = 0x1000;
+	var RESOLVE_SOURCE = 0x2000;
+	var RAYTRACING_ACCELERATION_STRUCTURE = 0x400000;
+	var SHADING_RATE_SOURCE = 0x1000000;
+	var GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 )  | 0x40 )  | 0x80 )  | 0x200 )  | 0x800 ) ;
+	var ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) ;
+	var PRESENT = 0;
+	var PREDICATION = 0x200;
+	var VIDEO_DECODE_READ = 0x10000;
+	var VIDEO_DECODE_WRITE = 0x20000;
+	var VIDEO_PROCESS_READ = 0x40000;
+	var VIDEO_PROCESS_WRITE = 0x80000;
+	var VIDEO_ENCODE_READ = 0x200000;
+	var VIDEO_ENCODE_WRITE = 0x800000;
+	@:op(a|b) function or(r:ResourceStates):ResourceStates;
+}
+
+
 @:hlNative("dx12")
 class Dx12 {
 
@@ -859,7 +1150,7 @@ class Dx12 {
 		return null;
 	}
 
-	public static function getBackBuffer( index : Int ) : Resource {
+	public static function getBackBuffer( index : Int ) : GpuResource {
 		return null;
 	}
 
@@ -870,7 +1161,14 @@ class Dx12 {
 	public static function createRenderTargetView( buffer : Resource, desc : RenderTargetViewDesc, target : Address ) {
 	}
 
-	public static function resize( width : Int, height : Int, bufferCount : Int ) : Bool {
+	public static function createDepthStencilView( buffer : Resource, desc : DepthStencilViewDesc, target : Address ) {
+	}
+
+	public static function createCommittedResource( heapProperties : HeapProperties, heapFlags : haxe.EnumFlags<HeapFlag>, desc : ResourceDesc, initialState : ResourceStates, clearValue : ClearValue ) : GpuResource {
+		return null;
+	}
+
+	public static function resize( width : Int, height : Int, bufferCount : Int, format : DxgiFormat ) : Bool {
 		return false;
 	}
 

+ 114 - 21
libs/directx/dx12.cpp

@@ -98,15 +98,15 @@ HL_PRIM dx_driver *HL_NAME(create)( HWND window, int flags ) {
 	return drv;
 }
 
-HL_PRIM void HL_NAME(resize)( int width, int height, int buffer_count ) {
+HL_PRIM void HL_NAME(resize)( int width, int height, int buffer_count, DXGI_FORMAT format ) {
 	dx_driver *drv = static_driver;
 	if( drv->swapchain ) {
-		drv->swapchain->ResizeBuffers(buffer_count, width, height, DXGI_FORMAT_R8G8B8A8_UNORM, 0);
+		drv->swapchain->ResizeBuffers(buffer_count, width, height, format, 0);
 	} else {
 		DXGI_SWAP_CHAIN_DESC1 desc = {};
 		desc.Width = width;
 		desc.Height = height;
-		desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+		desc.Format = format;
 		desc.BufferCount = buffer_count;
 		desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
 		desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
@@ -129,24 +129,10 @@ 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;
@@ -185,16 +171,62 @@ uchar *HL_NAME(get_device_name)() {
 #define _RES _ABSTRACT(dx_resource)
 
 DEFINE_PRIM(_DRIVER, create, _ABSTRACT(dx_window) _I32);
-DEFINE_PRIM(_BOOL, resize, _I32 _I32 _I32);
+DEFINE_PRIM(_BOOL, resize, _I32 _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);
 
+// ---- RESOURCES
+
+ID3D12Resource *HL_NAME(get_back_buffer)( int index ) {
+	ID3D12Resource *buf = NULL;
+	static_driver->swapchain->GetBuffer(index, IID_PPV_ARGS(&buf));
+	return buf;
+}
+
+ID3D12Resource *HL_NAME(create_committed_resource)( D3D12_HEAP_PROPERTIES *heapProperties, D3D12_HEAP_FLAGS heapFlags, D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initialState, D3D12_CLEAR_VALUE *clearValue ) {
+	ID3D12Resource *res = NULL;
+	DXERR(static_driver->device->CreateCommittedResource(heapProperties, heapFlags, desc, initialState, clearValue, IID_PPV_ARGS(&res)));
+	return res;
+}
+
+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(create_depth_stencil_view)( ID3D12Resource *res, D3D12_DEPTH_STENCIL_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor ) {
+	static_driver->device->CreateDepthStencilView(res,desc,descriptor);
+}
+
+int64 HL_NAME(resource_get_gpu_virtual_address)( ID3D12Resource *res ) {
+	return res->GetGPUVirtualAddress();
+}
+
+void HL_NAME(resource_release)( IUnknown *res ) {
+	res->Release();
+}
+
+void *HL_NAME(resource_map)( ID3D12Resource *res, int subres, D3D12_RANGE *range ) {
+	void *data = NULL;
+	DXERR(res->Map(subres, range, &data));
+	return data;
+}
+
+void HL_NAME(resource_unmap)( ID3D12Resource *res, int subres, D3D12_RANGE *range ) {
+	res->Unmap(subres, range);
+}
+
+DEFINE_PRIM(_VOID, create_render_target_view, _RES _STRUCT _I64);
+DEFINE_PRIM(_VOID, create_depth_stencil_view, _RES _STRUCT _I64);
+DEFINE_PRIM(_RES, create_committed_resource, _STRUCT _I32 _STRUCT _I32 _STRUCT);
+DEFINE_PRIM(_RES, get_back_buffer, _I32);
+DEFINE_PRIM(_VOID, resource_release, _RES);
+DEFINE_PRIM(_I64, resource_get_gpu_virtual_address, _RES);
+DEFINE_PRIM(_BYTES, resource_map, _RES _I32 _STRUCT);
+DEFINE_PRIM(_VOID, resource_unmap, _RES _I32 _STRUCT);
+
 // ---- SHADERS
 
 typedef struct {
@@ -261,6 +293,7 @@ ID3D12RootSignature *HL_NAME(rootsignature_create)( vbyte *bytes, int len ) {
 
 ID3D12PipelineState *HL_NAME(create_graphics_pipeline_state)( D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc ) {
 	ID3D12PipelineState *state = NULL;
+	// if shader is considered invalid, maybe you're missing dxil.dll
 	DXERR(static_driver->device->CreateGraphicsPipelineState(desc,IID_PPV_ARGS(&state)));
 	return state;
 }
@@ -364,6 +397,54 @@ void HL_NAME(command_list_clear_render_target_view)( ID3D12GraphicsCommandList *
 	l->ClearRenderTargetView(view,colors,0,NULL);
 }
 
+void HL_NAME(command_list_clear_depth_stencil_view)( ID3D12GraphicsCommandList *l, D3D12_CPU_DESCRIPTOR_HANDLE view, D3D12_CLEAR_FLAGS flags, FLOAT depth, int stencil ) {
+	l->ClearDepthStencilView(view,flags,depth,(UINT8)stencil,0,NULL);
+}
+
+void HL_NAME(command_list_draw_instanced)( ID3D12GraphicsCommandList *l, int vertexCountPerInstance, int instanceCount, int startVertexLocation, int startInstanceLocation ) {
+	l->DrawInstanced(vertexCountPerInstance, instanceCount, startVertexLocation, startInstanceLocation);
+}
+
+void HL_NAME(command_list_draw_indexed_instanced)( ID3D12GraphicsCommandList *l, int indexCountPerInstance, int instanceCount, int startIndexLocation, int baseVertexLocation, int startInstanceLocation ) {
+	l->DrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation);
+}
+
+void HL_NAME(command_list_set_graphics_root_signature)( ID3D12GraphicsCommandList *l, ID3D12RootSignature *sign ) {
+	l->SetGraphicsRootSignature(sign);
+}
+
+void HL_NAME(command_list_set_pipeline_state)( ID3D12GraphicsCommandList *l, ID3D12PipelineState *pipe ) {
+	l->SetPipelineState(pipe);
+}
+
+void HL_NAME(command_list_ia_set_vertex_buffers)( ID3D12GraphicsCommandList *l, int startSlot, int numViews, D3D12_VERTEX_BUFFER_VIEW *views ) {
+	l->IASetVertexBuffers(startSlot, numViews, views);
+}
+
+void HL_NAME(command_list_ia_set_index_buffer)( ID3D12GraphicsCommandList *l, D3D12_INDEX_BUFFER_VIEW *view ) {
+	l->IASetIndexBuffer(view);
+}
+
+void HL_NAME(command_list_ia_set_primitive_topology)( ID3D12GraphicsCommandList *l, D3D12_PRIMITIVE_TOPOLOGY topo ) {
+	l->IASetPrimitiveTopology(topo);
+}
+
+void HL_NAME(command_list_copy_buffer_region)( ID3D12GraphicsCommandList *l, ID3D12Resource *dst, int64 dstOffset, ID3D12Resource *src, int64 srcOffset, int64 numBytes ) {
+	l->CopyBufferRegion(dst, dstOffset, src, srcOffset, numBytes);
+}
+
+void HL_NAME(command_list_om_set_render_targets)( ID3D12GraphicsCommandList *l, int count, D3D12_CPU_DESCRIPTOR_HANDLE *handles, BOOL flag, D3D12_CPU_DESCRIPTOR_HANDLE *depthStencils ) {
+	l->OMSetRenderTargets(count,handles,flag,depthStencils);
+}
+
+void HL_NAME(command_list_rs_set_viewports)( ID3D12GraphicsCommandList *l, int count, D3D12_VIEWPORT *viewports ) {
+	l->RSSetViewports(count, viewports);
+}
+
+void HL_NAME(command_list_rs_set_scissor_rects)( ID3D12GraphicsCommandList *l, int count, D3D12_RECT *rects ) {
+	l->RSSetScissorRects(count, rects);
+}
+
 DEFINE_PRIM(_RES, command_allocator_create, _I32);
 DEFINE_PRIM(_VOID, command_allocator_reset, _RES);
 DEFINE_PRIM(_RES, command_list_create, _I32 _RES _RES);
@@ -372,3 +453,15 @@ 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);
+DEFINE_PRIM(_VOID, command_list_clear_depth_stencil_view, _RES _I64 _I32 _F32 _I32);
+DEFINE_PRIM(_VOID, command_list_draw_instanced, _RES _I32 _I32 _I32 _I32);
+DEFINE_PRIM(_VOID, command_list_draw_indexed_instanced, _RES _I32 _I32 _I32 _I32 _I32);
+DEFINE_PRIM(_VOID, command_list_set_graphics_root_signature, _RES _RES);
+DEFINE_PRIM(_VOID, command_list_set_pipeline_state, _RES _RES);
+DEFINE_PRIM(_VOID, command_list_ia_set_vertex_buffers, _RES _I32 _I32 _STRUCT);
+DEFINE_PRIM(_VOID, command_list_ia_set_index_buffer, _RES _STRUCT);
+DEFINE_PRIM(_VOID, command_list_ia_set_primitive_topology, _RES _I32);
+DEFINE_PRIM(_VOID, command_list_copy_buffer_region, _RES _RES _I64 _RES _I64 _I64);
+DEFINE_PRIM(_VOID, command_list_om_set_render_targets, _RES _I32 _BYTES _I32 _BYTES);
+DEFINE_PRIM(_VOID, command_list_rs_set_viewports, _RES _I32 _STRUCT);
+DEFINE_PRIM(_VOID, command_list_rs_set_scissor_rects, _RES _I32 _STRUCT);

+ 0 - 31
libs/directx/dx12.sln

@@ -1,31 +0,0 @@
-
-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

+ 17 - 15
libs/directx/dx12.vcxproj

@@ -9,12 +9,12 @@
       <Configuration>Debug</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseVS2017|Win32">
-      <Configuration>ReleaseVS2017</Configuration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
-    <ProjectConfiguration Include="ReleaseVS2017|x64">
-      <Configuration>ReleaseVS2017</Configuration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
   </ItemGroup>
@@ -22,7 +22,7 @@
     <ClCompile Include="dx12.cpp" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
-    <ProjectGuid>{EC79BC9F-9947-4BCC-92F9-14F90CDE4B04}</ProjectGuid>
+    <ProjectGuid>{F9A2435E-D545-43EB-B471-A4497D96A71B}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>directx</RootNamespace>
     <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
@@ -34,7 +34,7 @@
     <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'" Label="Configuration">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v142</PlatformToolset>
@@ -47,7 +47,7 @@
     <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'" Label="Configuration">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v142</PlatformToolset>
@@ -62,13 +62,13 @@
   <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">
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|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">
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|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" />
@@ -77,26 +77,28 @@
     <TargetExt>.hdll</TargetExt>
     <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../$(Configuration)</LibraryPath>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../src</IncludePath>
+    <IntDir>$(Configuration)\dx12\</IntDir>
   </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>
+    <IntDir>$(Configuration)\dx12\</IntDir>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|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>
+    <IntDir>$(Configuration)\dx12\</IntDir>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|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>
+    <IntDir>$(Configuration)\dx12\</IntDir>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -127,7 +129,7 @@
       <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib;dxcompiler.lib</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|Win32'">
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <PrecompiledHeader>
@@ -146,7 +148,7 @@
       <AdditionalDependencies>libhl.lib;D3D12.lib;dxgi.lib;dxcompiler.lib</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseVS2017|x64'">
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <PrecompiledHeader>