From cc2dda5a931623417f4ea85a559fe5dda55c5347 Mon Sep 17 00:00:00 2001 From: Amer Koleci Date: Mon, 8 Jul 2024 16:51:55 +0200 Subject: [PATCH] Update to latest SharpGen.Runtime, fix #450 --- Directory.Build.props | 2 +- Directory.Packages.props | 4 +- global.json | 2 +- src/Vortice.D3DCompiler/Compiler.cs | 38 ++-- src/Vortice.DXGI/Debug/IDXGIInfoQueue.cs | 22 +-- src/Vortice.DXGI/Mappings.xml | 7 +- .../Debug/ID3D11InfoQueue.cs | 20 +- src/Vortice.Direct3D11/Debug/Message.cs | 2 +- src/Vortice.Direct3D11/ID3D11Device.cs | 42 ++--- .../ComputePipelineStateDescription.cs | 6 +- src/Vortice.Direct3D12/D3D12.cs | 12 +- .../Debug/ID3D12InfoQueue.cs | 20 +- src/Vortice.Direct3D12/Debug/Message.cs | 2 +- .../GraphicsPipelineStateDescription.cs | 6 +- src/Vortice.Direct3D12/ID3D12Device.cs | 177 ++++++++++-------- src/Vortice.Direct3D12/ID3D12Device1.cs | 8 +- src/Vortice.Direct3D12/ID3D12Device2.cs | 10 +- .../ID3D12DeviceConfiguration.cs | 8 +- .../ID3D12GraphicsCommandList4.cs | 4 +- .../ID3D12PipelineLibrary1.cs | 4 +- .../PipelineStateStreamSubObject.cs | 5 +- src/Vortice.Direct3D12/Range.cs | 2 +- .../Video/ID3D12VideoDevice2.cs | 8 +- src/Vortice.DirectX/DXCore/IDXCoreAdapter.cs | 22 +-- src/Vortice.DirectX/Direct3D/Blob.cs | 6 +- src/Vortice.Dxc/IDxcBlob.cs | 8 +- src/Vortice.Dxc/IDxcCompiler3.cs | 4 +- src/Vortice.Dxc/IDxcUtils.cs | 4 +- src/Vortice.Dxc/Mappings.xml | 1 + .../HelloDirect3D12/D3D12GraphicsDevice.cs | 2 +- .../HelloDirect3D12/PipelineStateStream.cs | 2 +- src/samples/HelloDirect3D12/Program.cs | 70 ++++++- .../HelloDirect3D12/ShaderIncludeHandler.cs | 2 +- 33 files changed, 314 insertions(+), 218 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index acb68e20..dc1888a2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,7 +16,7 @@ - 3.5.9 + 3.5.10 beta diff --git a/Directory.Packages.props b/Directory.Packages.props index ebfb9db8..f739ce35 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,11 +1,11 @@ - 2.1.2-beta + 2.2.0-beta - + diff --git a/global.json b/global.json index 73ba56aa..8251c776 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.302", "rollForward": "latestFeature", "allowPrerelease": false } diff --git a/src/Vortice.D3DCompiler/Compiler.cs b/src/Vortice.D3DCompiler/Compiler.cs index bacdaf83..25cbd57d 100644 --- a/src/Vortice.D3DCompiler/Compiler.cs +++ b/src/Vortice.D3DCompiler/Compiler.cs @@ -26,7 +26,7 @@ public static ReadOnlyMemory Compile( { Result result = Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, null, null, @@ -82,7 +82,7 @@ public static ReadOnlyMemory Compile( { Result result = Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, macros, null, @@ -137,7 +137,7 @@ public static ReadOnlyMemory Compile( { Result result = Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, macros, include, @@ -192,7 +192,7 @@ public static Blob Compile( { Result result = Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, macros, include, @@ -243,7 +243,7 @@ public static Result Compile( { return Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, null, null, @@ -280,7 +280,7 @@ public static Result Compile( { return Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, defines, null, @@ -318,7 +318,7 @@ public static Result Compile( { return Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, defines, include, @@ -357,7 +357,7 @@ public static Result Compile( { return Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, defines, include, @@ -397,7 +397,7 @@ public static Result Compile( { return Compile( shaderSourcePtr.ToPointer(), - shaderSource.Length, + (nuint)shaderSource.Length, sourceName, defines, include, @@ -432,7 +432,7 @@ public static Result Compile( { return Compile( sourcePtr, - source.Length, + (nuint)source.Length, sourceName, null, null, @@ -463,7 +463,7 @@ public static Result Compile( { return Compile( sourcePtr, - source.Length, + (nuint)source.Length, sourceName, defines, null, @@ -495,7 +495,7 @@ public static Result Compile( { return Compile( sourcePtr, - source.Length, + (nuint)source.Length, sourceName, defines, include, @@ -528,7 +528,7 @@ public static Result Compile( { return Compile( sourcePtr, - source.Length, + (nuint)source.Length, sourceName, defines, include, @@ -562,7 +562,7 @@ public static Result Compile( { return Compile( sourcePtr, - source.Length, + (nuint)source.Length, sourceName, defines, include, @@ -771,7 +771,7 @@ public static ReadOnlyMemory CompileFromFile( } #endregion - public static Blob CreateBlob(PointerSize size) + public static Blob CreateBlob(nuint size) { CreateBlob(size, out Blob blob).CheckError(); return blob; @@ -781,7 +781,7 @@ public static Blob CreateBlob(PointerSize size) { fixed (byte* shaderBytecodePtr = shaderBytecode) { - Reflect(shaderBytecodePtr, shaderBytecode.Length, typeof(T).GUID, out IntPtr nativePtr).CheckError(); + Reflect(shaderBytecodePtr, (nuint)shaderBytecode.Length, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; } } @@ -790,7 +790,7 @@ public static Blob CreateBlob(PointerSize size) { fixed (byte* shaderBytecodePtr = shaderBytecode) { - Result result = Reflect(shaderBytecodePtr, shaderBytecode.Length, typeof(T).GUID, out IntPtr nativePtr); + Result result = Reflect(shaderBytecodePtr, (nuint)shaderBytecode.Length, typeof(T).GUID, out IntPtr nativePtr); if (result.Success) { reflection = MarshallingHelpers.FromPointer(nativePtr); @@ -829,7 +829,7 @@ public static Blob GetInputSignatureBlob(ReadOnlySpan srcData) { fixed (byte* pSrcData = srcData) { - GetInputSignatureBlob((IntPtr)pSrcData, srcData.Length, out Blob signatureBlob).CheckError(); + GetInputSignatureBlob((IntPtr)pSrcData, (nuint)srcData.Length, out Blob signatureBlob).CheckError(); return signatureBlob; } } @@ -849,7 +849,7 @@ public static Blob GetOutputSignatureBlob(ReadOnlySpan srcData) { fixed (byte* pSrcData = srcData) { - GetOutputSignatureBlob((IntPtr)pSrcData, srcData.Length, out Blob signatureBlob).CheckError(); + GetOutputSignatureBlob((IntPtr)pSrcData, (nuint)srcData.Length, out Blob signatureBlob).CheckError(); return signatureBlob; } } diff --git a/src/Vortice.DXGI/Debug/IDXGIInfoQueue.cs b/src/Vortice.DXGI/Debug/IDXGIInfoQueue.cs index 4842f28a..6dfb358a 100644 --- a/src/Vortice.DXGI/Debug/IDXGIInfoQueue.cs +++ b/src/Vortice.DXGI/Debug/IDXGIInfoQueue.cs @@ -3,11 +3,11 @@ namespace Vortice.DXGI.Debug; -public partial class IDXGIInfoQueue +public unsafe partial class IDXGIInfoQueue { - public unsafe InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) + public InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) { - PointerSize messageSize = 0; + PointerUSize messageSize = 0; GetMessage(producer, messageIndex, IntPtr.Zero, ref messageSize); if (messageSize == 0) @@ -15,7 +15,7 @@ public unsafe InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) return new InfoQueueMessage(); } - var messagePtr = stackalloc byte[messageSize]; + byte* messagePtr = stackalloc byte[(int)((uint)messageSize)]; GetMessage(producer, messageIndex, new IntPtr(messagePtr), ref messageSize); var message = new InfoQueueMessage(); @@ -23,10 +23,9 @@ public unsafe InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) return message; } - - public unsafe InfoQueueFilter? GetStorageFilter(Guid producer) + public InfoQueueFilter? GetStorageFilter(Guid producer) { - PointerSize sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetStorageFilter(producer, IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) @@ -34,7 +33,7 @@ public unsafe InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) return null; } - byte* filter = stackalloc byte[(int)sizeFilter]; + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetStorageFilter(producer, (IntPtr)filter, ref sizeFilter); var queueNative = new InfoQueueFilter(); @@ -43,16 +42,17 @@ public unsafe InfoQueueMessage GetMessage(Guid producer, ulong messageIndex) return queueNative; } - public unsafe InfoQueueFilter? GetRetrievalFilter(Guid producer) + public InfoQueueFilter? GetRetrievalFilter(Guid producer) { - var sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetRetrievalFilter(producer, IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) { return null; } - var filter = stackalloc byte[(int)sizeFilter]; + + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetRetrievalFilter(producer, (IntPtr)filter, ref sizeFilter); var queueNative = new InfoQueueFilter(); diff --git a/src/Vortice.DXGI/Mappings.xml b/src/Vortice.DXGI/Mappings.xml index 8071a9de..38af77d6 100644 --- a/src/Vortice.DXGI/Mappings.xml +++ b/src/Vortice.DXGI/Mappings.xml @@ -2,7 +2,7 @@ Vortice.DXGI Vortice.DirectX - + $(THIS_CONFIG_PATH)/../native/include/directx @@ -105,11 +105,6 @@ - - - - - diff --git a/src/Vortice.Direct3D11/Debug/ID3D11InfoQueue.cs b/src/Vortice.Direct3D11/Debug/ID3D11InfoQueue.cs index 332b1a45..b46cac26 100644 --- a/src/Vortice.Direct3D11/Debug/ID3D11InfoQueue.cs +++ b/src/Vortice.Direct3D11/Debug/ID3D11InfoQueue.cs @@ -3,11 +3,11 @@ namespace Vortice.Direct3D11.Debug; -public partial class ID3D11InfoQueue +public unsafe partial class ID3D11InfoQueue { - public unsafe Message GetMessage(ulong messageIndex) + public Message GetMessage(ulong messageIndex) { - PointerSize messageSize = 0; + PointerUSize messageSize = 0; GetMessage(messageIndex, IntPtr.Zero, ref messageSize); if (messageSize == 0) @@ -15,7 +15,7 @@ public unsafe Message GetMessage(ulong messageIndex) return new Message(); } - byte* messagePtr = stackalloc byte[messageSize]; + byte* messagePtr = stackalloc byte[(int)((uint)messageSize)]; GetMessage(messageIndex, new IntPtr(messagePtr), ref messageSize); Message message = new Message(); @@ -23,9 +23,9 @@ public unsafe Message GetMessage(ulong messageIndex) return message; } - public unsafe InfoQueueFilter? GetStorageFilter() + public InfoQueueFilter? GetStorageFilter() { - PointerSize sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetStorageFilter(IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) @@ -33,7 +33,7 @@ public unsafe Message GetMessage(ulong messageIndex) return default; } - byte* filter = stackalloc byte[sizeFilter]; + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetStorageFilter((IntPtr)filter, ref sizeFilter); InfoQueueFilter queueNative = new InfoQueueFilter(); @@ -41,9 +41,9 @@ public unsafe Message GetMessage(ulong messageIndex) return queueNative; } - public unsafe InfoQueueFilter? GetRetrievalFilter() + public InfoQueueFilter? GetRetrievalFilter() { - PointerSize sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetRetrievalFilter(IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) @@ -51,7 +51,7 @@ public unsafe Message GetMessage(ulong messageIndex) return default; } - byte* filter = stackalloc byte[sizeFilter]; + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetRetrievalFilter((IntPtr)filter, ref sizeFilter); InfoQueueFilter queueNative = new InfoQueueFilter(); diff --git a/src/Vortice.Direct3D11/Debug/Message.cs b/src/Vortice.Direct3D11/Debug/Message.cs index b2842cd3..28a43d8f 100644 --- a/src/Vortice.Direct3D11/Debug/Message.cs +++ b/src/Vortice.Direct3D11/Debug/Message.cs @@ -19,7 +19,7 @@ internal struct __Native public MessageSeverity Severity; public MessageId Id; public unsafe sbyte* pDescription; - public PointerSize DescriptionByteLength; + public nuint DescriptionByteLength; } internal unsafe void __MarshalFrom(ref __Native @ref) diff --git a/src/Vortice.Direct3D11/ID3D11Device.cs b/src/Vortice.Direct3D11/ID3D11Device.cs index c5d5c50e..404fee8f 100644 --- a/src/Vortice.Direct3D11/ID3D11Device.cs +++ b/src/Vortice.Direct3D11/ID3D11Device.cs @@ -382,7 +382,7 @@ public ID3D11VertexShader CreateVertexShader(Span shaderBytecode, ID3D11Cl { fixed (byte* pBuffer = shaderBytecode) { - return CreateVertexShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateVertexShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -390,7 +390,7 @@ public ID3D11VertexShader CreateVertexShader(ReadOnlySpan shaderBytecode, { fixed (byte* pBuffer = shaderBytecode) { - return CreateVertexShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateVertexShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -398,7 +398,7 @@ public ID3D11VertexShader CreateVertexShader(byte[] shaderBytecode, ID3D11ClassL { fixed (byte* pBuffer = shaderBytecode) { - return CreateVertexShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateVertexShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -411,7 +411,7 @@ public ID3D11PixelShader CreatePixelShader(Span shaderBytecode, ID3D11Clas { fixed (byte* pBuffer = shaderBytecode) { - return CreatePixelShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreatePixelShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -419,7 +419,7 @@ public ID3D11PixelShader CreatePixelShader(ReadOnlySpan shaderBytecode, ID { fixed (byte* pBuffer = shaderBytecode) { - return CreatePixelShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreatePixelShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -427,7 +427,7 @@ public ID3D11PixelShader CreatePixelShader(byte[] shaderBytecode, ID3D11ClassLin { fixed (byte* pBuffer = shaderBytecode) { - return CreatePixelShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreatePixelShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -440,7 +440,7 @@ public ID3D11GeometryShader CreateGeometryShader(Span shaderBytecode, ID3D { fixed (byte* pBuffer = shaderBytecode) { - return CreateGeometryShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateGeometryShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -448,7 +448,7 @@ public ID3D11GeometryShader CreateGeometryShader(ReadOnlySpan shaderByteco { fixed (byte* pBuffer = shaderBytecode) { - return CreateGeometryShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateGeometryShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -456,7 +456,7 @@ public ID3D11GeometryShader CreateGeometryShader(byte[] shaderBytecode, ID3D11Cl { fixed (byte* pBuffer = shaderBytecode) { - return CreateGeometryShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateGeometryShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -469,7 +469,7 @@ public ID3D11HullShader CreateHullShader(Span shaderBytecode, ID3D11ClassL { fixed (byte* pBuffer = shaderBytecode) { - return CreateHullShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateHullShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -477,7 +477,7 @@ public ID3D11HullShader CreateHullShader(ReadOnlySpan shaderBytecode, ID3D { fixed (byte* pBuffer = shaderBytecode) { - return CreateHullShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateHullShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -485,7 +485,7 @@ public ID3D11HullShader CreateHullShader(byte[] shaderBytecode, ID3D11ClassLinka { fixed (byte* pBuffer = shaderBytecode) { - return CreateHullShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateHullShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -498,7 +498,7 @@ public ID3D11DomainShader CreateDomainShader(Span shaderBytecode, ID3D11Cl { fixed (byte* pBuffer = shaderBytecode) { - return CreateDomainShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateDomainShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -506,7 +506,7 @@ public ID3D11DomainShader CreateDomainShader(ReadOnlySpan shaderBytecode, { fixed (byte* pBuffer = shaderBytecode) { - return CreateDomainShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateDomainShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -514,7 +514,7 @@ public ID3D11DomainShader CreateDomainShader(byte[] shaderBytecode, ID3D11ClassL { fixed (byte* pBuffer = shaderBytecode) { - return CreateDomainShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateDomainShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -527,7 +527,7 @@ public ID3D11ComputeShader CreateComputeShader(Span shaderBytecode, ID3D11 { fixed (byte* pBuffer = shaderBytecode) { - return CreateComputeShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateComputeShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -535,7 +535,7 @@ public ID3D11ComputeShader CreateComputeShader(ReadOnlySpan shaderBytecode { fixed (byte* pBuffer = shaderBytecode) { - return CreateComputeShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateComputeShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -543,7 +543,7 @@ public ID3D11ComputeShader CreateComputeShader(byte[] shaderBytecode, ID3D11Clas { fixed (byte* pBuffer = shaderBytecode) { - return CreateComputeShader(pBuffer, shaderBytecode.Length, classLinkage); + return CreateComputeShader(pBuffer, (nuint)shaderBytecode.Length, classLinkage); } } @@ -562,7 +562,7 @@ public ID3D11InputLayout CreateInputLayout(InputElementDescription[] inputElemen { fixed (byte* pBuffer = shaderBytecode) { - return CreateInputLayout(inputElements, inputElements.Length, pBuffer, shaderBytecode.Length); + return CreateInputLayout(inputElements, inputElements.Length, pBuffer, (nuint)shaderBytecode.Length); } } @@ -576,7 +576,7 @@ public ID3D11InputLayout CreateInputLayout(InputElementDescription[] inputElemen { fixed (byte* pBuffer = shaderBytecode) { - return CreateInputLayout(inputElements, inputElements.Length, pBuffer, shaderBytecode.Length); + return CreateInputLayout(inputElements, inputElements.Length, pBuffer, (nuint)shaderBytecode.Length); } } @@ -590,7 +590,7 @@ public ID3D11InputLayout CreateInputLayout(InputElementDescription[] inputElemen { fixed (byte* pBuffer = shaderBytecode) { - return CreateInputLayout(inputElements, inputElements.Length, pBuffer, shaderBytecode.Length); + return CreateInputLayout(inputElements, inputElements.Length, pBuffer, (nuint)shaderBytecode.Length); } } diff --git a/src/Vortice.Direct3D12/ComputePipelineStateDescription.cs b/src/Vortice.Direct3D12/ComputePipelineStateDescription.cs index 6550983c..98194463 100644 --- a/src/Vortice.Direct3D12/ComputePipelineStateDescription.cs +++ b/src/Vortice.Direct3D12/ComputePipelineStateDescription.cs @@ -22,7 +22,7 @@ internal struct __Native public IntPtr RootSignature; public ShaderBytecode.__Native CS; public uint NodeMask; - public CachedPipelineState.__Native CachedPSO; + public CachedPipelineState CachedPSO; public PipelineStateFlags Flags; } @@ -30,7 +30,7 @@ internal unsafe void __MarshalFree(ref __Native @ref) { GC.KeepAlive(RootSignature); Free(@ref.CS.pShaderBytecode); - CachedPSO.__MarshalFree(ref @ref.CachedPSO); + @ref.CachedPSO = CachedPSO; } internal unsafe void __MarshalTo(ref __Native @ref) @@ -39,7 +39,7 @@ internal unsafe void __MarshalTo(ref __Native @ref) @ref.CS.pShaderBytecode = AllocWithData(ComputeShader.Span); @ref.CS.BytecodeLength = (nuint)ComputeShader.Length; @ref.NodeMask = NodeMask; - CachedPSO.__MarshalTo(ref @ref.CachedPSO); + @ref.CachedPSO = CachedPSO; @ref.Flags = Flags; } #endregion diff --git a/src/Vortice.Direct3D12/D3D12.cs b/src/Vortice.Direct3D12/D3D12.cs index 4c990280..af378b6c 100644 --- a/src/Vortice.Direct3D12/D3D12.cs +++ b/src/Vortice.Direct3D12/D3D12.cs @@ -252,7 +252,11 @@ public static void D3D12EnableExperimentalFeatures(params Guid[] features) D3D12EnableExperimentalFeatures(features.Length, features, IntPtr.Zero, null); } - private static Result D3D12CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(void* signatureData, PointerSize signatureDataLength, out T? rootSignatureDeserializer) where T : ID3D12VersionedRootSignatureDeserializer + private static Result D3D12CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>( + void* signatureData, + nuint signatureDataLength, + out T? rootSignatureDeserializer) + where T : ID3D12VersionedRootSignatureDeserializer { Result result = D3D12CreateVersionedRootSignatureDeserializer(signatureData, signatureDataLength, typeof(T).GUID, @@ -268,7 +272,7 @@ public static void D3D12EnableExperimentalFeatures(params Guid[] features) return result; } - private static T D3D12CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(void* signatureData, PointerSize signatureDataLength) where T : ID3D12VersionedRootSignatureDeserializer + private static T D3D12CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(void* signatureData, nuint signatureDataLength) where T : ID3D12VersionedRootSignatureDeserializer { D3D12CreateVersionedRootSignatureDeserializer(signatureData, signatureDataLength, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; @@ -278,7 +282,7 @@ public static void D3D12EnableExperimentalFeatures(params Guid[] features) { fixed (byte* dataPtr = signatureData) { - return D3D12CreateVersionedRootSignatureDeserializer(dataPtr, signatureData.Length, out rootSignatureDeserializer); + return D3D12CreateVersionedRootSignatureDeserializer(dataPtr, (nuint)signatureData.Length, out rootSignatureDeserializer); } } @@ -291,7 +295,7 @@ public static void D3D12EnableExperimentalFeatures(params Guid[] features) { fixed (byte* dataPtr = signatureData) { - return D3D12CreateVersionedRootSignatureDeserializer(dataPtr, signatureData.Length); + return D3D12CreateVersionedRootSignatureDeserializer(dataPtr, (nuint)signatureData.Length); } } diff --git a/src/Vortice.Direct3D12/Debug/ID3D12InfoQueue.cs b/src/Vortice.Direct3D12/Debug/ID3D12InfoQueue.cs index 2b9d52eb..9dc703dd 100644 --- a/src/Vortice.Direct3D12/Debug/ID3D12InfoQueue.cs +++ b/src/Vortice.Direct3D12/Debug/ID3D12InfoQueue.cs @@ -3,11 +3,11 @@ namespace Vortice.Direct3D12.Debug; -public partial class ID3D12InfoQueue +public unsafe partial class ID3D12InfoQueue { - public unsafe Message GetMessage(ulong messageIndex) + public Message GetMessage(ulong messageIndex) { - PointerSize messageSize = 0; + PointerUSize messageSize = 0; GetMessage(messageIndex, IntPtr.Zero, ref messageSize); if (messageSize == 0) @@ -15,7 +15,7 @@ public unsafe Message GetMessage(ulong messageIndex) return new Message(); } - byte* messagePtr = stackalloc byte[(int)messageSize]; + byte* messagePtr = stackalloc byte[(int)((uint)messageSize)]; GetMessage(messageIndex, new IntPtr(messagePtr), ref messageSize); Message message = new Message(); @@ -23,9 +23,9 @@ public unsafe Message GetMessage(ulong messageIndex) return message; } - public unsafe InfoQueueFilter? GetStorageFilter() + public InfoQueueFilter? GetStorageFilter() { - PointerSize sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetStorageFilter(IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) @@ -33,7 +33,7 @@ public unsafe Message GetMessage(ulong messageIndex) return null; } - byte* filter = stackalloc byte[(int)sizeFilter]; + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetStorageFilter((IntPtr)filter, ref sizeFilter); InfoQueueFilter queueNative = new InfoQueueFilter(); @@ -41,9 +41,9 @@ public unsafe Message GetMessage(ulong messageIndex) return queueNative; } - public unsafe InfoQueueFilter? GetRetrievalFilter() + public InfoQueueFilter? GetRetrievalFilter() { - PointerSize sizeFilter = PointerSize.Zero; + PointerUSize sizeFilter = PointerUSize.Zero; GetRetrievalFilter(IntPtr.Zero, ref sizeFilter); if (sizeFilter == 0) @@ -51,7 +51,7 @@ public unsafe Message GetMessage(ulong messageIndex) return null; } - byte* filter = stackalloc byte[(int)sizeFilter]; + byte* filter = stackalloc byte[(int)((uint)sizeFilter)]; GetRetrievalFilter((IntPtr)filter, ref sizeFilter); InfoQueueFilter queueNative = new InfoQueueFilter(); diff --git a/src/Vortice.Direct3D12/Debug/Message.cs b/src/Vortice.Direct3D12/Debug/Message.cs index 37d69263..e53102f4 100644 --- a/src/Vortice.Direct3D12/Debug/Message.cs +++ b/src/Vortice.Direct3D12/Debug/Message.cs @@ -19,7 +19,7 @@ internal unsafe struct __Native public MessageSeverity Severity; public MessageId Id; public sbyte* pDescription; - public PointerSize DescriptionByteLength; + public nuint DescriptionByteLength; } internal unsafe void __MarshalFrom(ref __Native @ref) diff --git a/src/Vortice.Direct3D12/GraphicsPipelineStateDescription.cs b/src/Vortice.Direct3D12/GraphicsPipelineStateDescription.cs index 8b1ce030..afc27166 100644 --- a/src/Vortice.Direct3D12/GraphicsPipelineStateDescription.cs +++ b/src/Vortice.Direct3D12/GraphicsPipelineStateDescription.cs @@ -84,7 +84,7 @@ internal struct __Native public Format DepthStencilFormat; public SampleDescription SampleDescription; public int NodeMask; - public CachedPipelineState.__Native CachedPSO; + public CachedPipelineState CachedPSO; public PipelineStateFlags Flags; } @@ -104,7 +104,7 @@ internal unsafe void __MarshalFree(ref __Native @ref) StreamOutput?.__MarshalFree(ref @ref.StreamOutput); BlendState = @ref.BlendState; InputLayout?.__MarshalFree(ref @ref.InputLayout); - CachedPSO.__MarshalFree(ref @ref.CachedPSO); + @ref.CachedPSO = CachedPSO; } internal unsafe void __MarshalTo(ref __Native @ref) @@ -162,7 +162,7 @@ internal unsafe void __MarshalTo(ref __Native @ref) @ref.DepthStencilFormat = DepthStencilFormat; @ref.SampleDescription = SampleDescription; @ref.NodeMask = NodeMask; - CachedPSO.__MarshalTo(ref @ref.CachedPSO); + @ref.CachedPSO = CachedPSO; @ref.Flags = Flags; } #endregion diff --git a/src/Vortice.Direct3D12/ID3D12Device.cs b/src/Vortice.Direct3D12/ID3D12Device.cs index 06789e45..1c7c9a34 100644 --- a/src/Vortice.Direct3D12/ID3D12Device.cs +++ b/src/Vortice.Direct3D12/ID3D12Device.cs @@ -763,79 +763,95 @@ public Result CreateFence(ulong initialValue, FenceFlags flags, out ID3D12Fence? #endregion #region CreateRootSignature - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, IntPtr blobWithRootSignature, PointerSize blobLengthInBytes, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(int nodeMask, nint blobWithRootSignature, nuint blobLengthInBytes, out ID3D12RootSignature? rootSignature) { - Result result = CreateRootSignature(nodeMask, blobWithRootSignature, blobLengthInBytes, typeof(T).GUID, out IntPtr nativePtr); + Result result = CreateRootSignature(nodeMask, blobWithRootSignature, blobLengthInBytes, typeof(ID3D12RootSignature).GUID, out IntPtr nativePtr); if (result.Failure) { rootSignature = default; return default; } - rootSignature = MarshallingHelpers.FromPointer(nativePtr); + rootSignature = new(nativePtr); return result; } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, Blob blob, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(int nodeMask, Blob blob, out ID3D12RootSignature? rootSignature) { return CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize, out rootSignature); } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, byte[] blobWithRootSignature, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(int nodeMask, byte[] blobWithRootSignature, out ID3D12RootSignature? rootSignature) { fixed (void* pBuffer = blobWithRootSignature) { - return CreateRootSignature(nodeMask, (IntPtr)pBuffer, blobWithRootSignature.Length, out rootSignature); + return CreateRootSignature(nodeMask, (nint)pBuffer, (nuint)blobWithRootSignature.Length, out rootSignature); } } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, IntPtr blobWithRootSignature, PointerSize blobLengthInBytes) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, nint blobWithRootSignature, nuint blobLengthInBytes) { - CreateRootSignature(nodeMask, blobWithRootSignature, blobLengthInBytes, typeof(T).GUID, out IntPtr nativePtr).CheckError(); - return MarshallingHelpers.FromPointer(nativePtr)!; + CreateRootSignature(nodeMask, blobWithRootSignature, blobLengthInBytes, typeof(ID3D12RootSignature).GUID, out IntPtr nativePtr).CheckError(); + return new(nativePtr)!; } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, Blob blob) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, Blob blob) { - return CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize); + return CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize); + } + + public ID3D12RootSignature CreateRootSignature(int nodeMask, byte[] blobWithRootSignature) + { + fixed (void* pBuffer = blobWithRootSignature) + { + return CreateRootSignature(nodeMask, (nint)pBuffer, (nuint)blobWithRootSignature.Length); + } } - public unsafe T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, byte[] blobWithRootSignature) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, Span blobWithRootSignature) { fixed (void* pBuffer = blobWithRootSignature) { - return CreateRootSignature(nodeMask, (IntPtr)pBuffer, blobWithRootSignature.Length); + return CreateRootSignature(nodeMask, (nint)pBuffer, (nuint)blobWithRootSignature.Length); } } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IntPtr blobWithRootSignature, PointerSize blobLengthInBytes) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(nint blobWithRootSignature, nuint blobLengthInBytes) where T : ID3D12RootSignature { CreateRootSignature(0, blobWithRootSignature, blobLengthInBytes, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(Blob blob) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(Blob blob) + { + return CreateRootSignature(0, blob.BufferPointer, blob.BufferSize); + } + + public ID3D12RootSignature CreateRootSignature(byte[] blobWithRootSignature) { - return CreateRootSignature(0, blob.BufferPointer, blob.BufferSize); + fixed (void* pBuffer = blobWithRootSignature) + { + return CreateRootSignature(0, (IntPtr)pBuffer, (nuint)blobWithRootSignature.Length); + } } - public unsafe T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(byte[] blobWithRootSignature) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(Span blobWithRootSignature) { fixed (void* pBuffer = blobWithRootSignature) { - return CreateRootSignature(0, (IntPtr)pBuffer, blobWithRootSignature.Length); + return CreateRootSignature(0, (nint)pBuffer, (nuint)blobWithRootSignature.Length); } } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(in RootSignatureDescription description, RootSignatureVersion version) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(in RootSignatureDescription description, RootSignatureVersion version) { - return CreateRootSignature(0, description, version); + return CreateRootSignature(0, description, version); } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in RootSignatureDescription description, RootSignatureVersion version) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, in RootSignatureDescription description, RootSignatureVersion version) { Result result = D3D12.D3D12SerializeRootSignature(description, version, out Blob blob, out Blob errorBlob); - if (result.Failure) + if (result.Failure || blob is null) { if (errorBlob != null) { @@ -847,8 +863,8 @@ public Result CreateFence(ulong initialValue, FenceFlags flags, out ID3D12Fence? try { - CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize, typeof(T).GUID, out IntPtr nativePtr).CheckError(); - return MarshallingHelpers.FromPointer(nativePtr)!; + CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize, typeof(ID3D12RootSignature).GUID, out IntPtr nativePtr).CheckError(); + return new(nativePtr)!; } finally { @@ -857,11 +873,16 @@ public Result CreateFence(ulong initialValue, FenceFlags flags, out ID3D12Fence? } } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in RootSignatureDescription description, RootSignatureVersion version, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(int nodeMask, in RootSignatureDescription description, RootSignatureVersion version, out ID3D12RootSignature? rootSignature) { Result result = D3D12.D3D12SerializeRootSignature(description, version, out Blob blob, out Blob errorBlob); - if (result.Failure) + if (result.Failure || blob is null) { + if (errorBlob != null) + { + throw new SharpGenException(result, errorBlob.AsString()); + } + errorBlob?.Dispose(); rootSignature = default; return result; @@ -869,14 +890,14 @@ public Result CreateFence(ulong initialValue, FenceFlags flags, out ID3D12Fence? try { - result = CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize, typeof(T).GUID, out IntPtr nativePtr); + result = CreateRootSignature(nodeMask, blob.BufferPointer, blob.BufferSize, typeof(ID3D12RootSignature).GUID, out IntPtr nativePtr); if (result.Failure) { rootSignature = default; return default; } - rootSignature = MarshallingHelpers.FromPointer(nativePtr); + rootSignature = MarshallingHelpers.FromPointer(nativePtr); return result; } finally @@ -886,59 +907,85 @@ public Result CreateFence(ulong initialValue, FenceFlags flags, out ID3D12Fence? } } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(in RootSignatureDescription1 description) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(in RootSignatureDescription1 description) { - return CreateRootSignature(0, new VersionedRootSignatureDescription(description)); + return CreateRootSignature(0, new VersionedRootSignatureDescription(description)); } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in RootSignatureDescription1 description) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, in RootSignatureDescription1 description) { - return CreateRootSignature(nodeMask, new VersionedRootSignatureDescription(description)); + return CreateRootSignature(nodeMask, new VersionedRootSignatureDescription(description)); } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(in VersionedRootSignatureDescription description) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(in VersionedRootSignatureDescription description) { - return CreateRootSignature(0, description); + return CreateRootSignature(0, description); } - public T CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in VersionedRootSignatureDescription description) where T : ID3D12RootSignature + public ID3D12RootSignature CreateRootSignature(int nodeMask, in VersionedRootSignatureDescription description) { - CreateRootSignature(nodeMask, description, out T? rootSignature).CheckError(); + CreateRootSignature(nodeMask, description, out ID3D12RootSignature? rootSignature).CheckError(); return rootSignature!; } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(in RootSignatureDescription1 description, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(in RootSignatureDescription1 description, out ID3D12RootSignature? rootSignature) { - return CreateRootSignature(0, new VersionedRootSignatureDescription(description), out rootSignature); + return CreateRootSignature(0, new VersionedRootSignatureDescription(description), out rootSignature); } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in RootSignatureDescription1 description, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(int nodeMask, in RootSignatureDescription1 description, out ID3D12RootSignature? rootSignature) { - return CreateRootSignature(0, new VersionedRootSignatureDescription(description), out rootSignature); + return CreateRootSignature(0, new VersionedRootSignatureDescription(description), out rootSignature); } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(in VersionedRootSignatureDescription description, out T? rootSignature) where T : ID3D12RootSignature + public Result CreateRootSignature(in VersionedRootSignatureDescription description, out ID3D12RootSignature? rootSignature) { - return CreateRootSignature(0, description, out rootSignature); + return CreateRootSignature(0, description, out rootSignature); } - public ID3D12RootSignature CreateRootSignature(in RootSignatureDescription1 description) + public Result CreateRootSignature(int nodeMask, in VersionedRootSignatureDescription description, out ID3D12RootSignature? rootSignature) { - return CreateRootSignature(0, new VersionedRootSignatureDescription(description)); - } + Result result = SerializeRootSignature(in description, out Blob? signature, out Blob? errorBlob); - public ID3D12RootSignature CreateRootSignature(int nodeMask, in VersionedRootSignatureDescription description) - { - CreateRootSignature(nodeMask, description, out ID3D12RootSignature? rootSignature).CheckError(); - return rootSignature!; + if (result.Failure || signature is null) + { + if (errorBlob is not null) + { + throw new SharpGenException(result, errorBlob.AsString()); + } + + errorBlob?.Dispose(); + rootSignature = default; + return result; + } + + try + { + result = CreateRootSignature(nodeMask, signature!.BufferPointer, signature.BufferSize, typeof(ID3D12RootSignature).GUID, out IntPtr nativePtr); + if (result.Failure) + { + rootSignature = default; + return default; + } + + rootSignature = new(nativePtr); + return result; + } + finally + { + errorBlob?.Dispose(); + signature.Dispose(); + } } - public Result CreateRootSignature<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(int nodeMask, in VersionedRootSignatureDescription description, out T? rootSignature) where T : ID3D12RootSignature + public Result SerializeRootSignature( + in VersionedRootSignatureDescription description, + out Blob? signature, out Blob? errorBlob) { Result result = Result.Ok; - Blob? signature = null; - Blob? errorBlob = null; + signature = default; + errorBlob = default; // D3DX12SerializeVersionedRootSignature switch (HighestRootSignatureVersion) @@ -1003,31 +1050,7 @@ public ID3D12RootSignature CreateRootSignature(int nodeMask, in VersionedRootSig break; } - if (result.Failure || signature == null) - { - errorBlob?.Dispose(); - - rootSignature = default; - return result; - } - - try - { - result = CreateRootSignature(nodeMask, signature.BufferPointer, signature.BufferSize, typeof(T).GUID, out IntPtr nativePtr); - if (result.Failure) - { - rootSignature = default; - return default; - } - - rootSignature = MarshallingHelpers.FromPointer(nativePtr); - return result; - } - finally - { - errorBlob?.Dispose(); - signature.Dispose(); - } + return result; } #endregion diff --git a/src/Vortice.Direct3D12/ID3D12Device1.cs b/src/Vortice.Direct3D12/ID3D12Device1.cs index 3286440b..3204d371 100644 --- a/src/Vortice.Direct3D12/ID3D12Device1.cs +++ b/src/Vortice.Direct3D12/ID3D12Device1.cs @@ -7,20 +7,20 @@ namespace Vortice.Direct3D12; public unsafe partial class ID3D12Device1 { - public ID3D12PipelineLibrary CreatePipelineLibrary(byte[] blob) + public ID3D12PipelineLibrary CreatePipelineLibrary(Span blob) { fixed (byte* pBlob = blob) { - CreatePipelineLibrary(pBlob, blob.Length, typeof(ID3D12PipelineLibrary).GUID, out IntPtr nativePtr).CheckError(); + CreatePipelineLibrary(pBlob, (nuint)blob.Length, typeof(ID3D12PipelineLibrary).GUID, out IntPtr nativePtr).CheckError(); return new ID3D12PipelineLibrary(nativePtr); } } - public Result CreatePipelineLibrary(byte[] blob, out ID3D12PipelineLibrary? pipelineLibrary) + public Result CreatePipelineLibrary(Span blob, out ID3D12PipelineLibrary? pipelineLibrary) { fixed (byte* pBlob = blob) { - Result result = CreatePipelineLibrary(pBlob, blob.Length, typeof(ID3D12PipelineLibrary).GUID, out IntPtr nativePtr); + Result result = CreatePipelineLibrary(pBlob, (nuint)blob.Length, typeof(ID3D12PipelineLibrary).GUID, out IntPtr nativePtr); if (result.Failure) { pipelineLibrary = default; diff --git a/src/Vortice.Direct3D12/ID3D12Device2.cs b/src/Vortice.Direct3D12/ID3D12Device2.cs index b03453b7..049935cc 100644 --- a/src/Vortice.Direct3D12/ID3D12Device2.cs +++ b/src/Vortice.Direct3D12/ID3D12Device2.cs @@ -10,11 +10,11 @@ public ID3D12PipelineState CreatePipelineState(TData data) where TData : PipelineStateStreamDescription description = new() { - SizeInBytes = sizeof(TData), + SizeInBytes = (nuint)sizeof(TData), SubObjectStream = new IntPtr(&data) }; - CreatePipelineState(ref description, typeof(ID3D12PipelineState).GUID, out IntPtr nativePtr).CheckError(); + CreatePipelineState(description, typeof(ID3D12PipelineState).GUID, out IntPtr nativePtr).CheckError(); return new ID3D12PipelineState(nativePtr); } @@ -24,7 +24,7 @@ public ID3D12PipelineState CreatePipelineState(TData data) where TData : { PipelineStateStreamDescription description = new() { - SizeInBytes = sizeof(TData), + SizeInBytes = (nuint)sizeof(TData), SubObjectStream = new IntPtr(&data) }; @@ -33,13 +33,13 @@ public ID3D12PipelineState CreatePipelineState(TData data) where TData : public T CreatePipelineState<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(PipelineStateStreamDescription description) where T : ID3D12PipelineState { - CreatePipelineState(ref description, typeof(T).GUID, out IntPtr nativePtr).CheckError(); + CreatePipelineState(description, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; } public Result CreatePipelineState<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(PipelineStateStreamDescription description, out T? pipelineState) where T : ID3D12PipelineState { - Result result = CreatePipelineState(ref description, typeof(T).GUID, out IntPtr nativePtr); + Result result = CreatePipelineState(description, typeof(T).GUID, out IntPtr nativePtr); if (result.Failure) { pipelineState = default; diff --git a/src/Vortice.Direct3D12/ID3D12DeviceConfiguration.cs b/src/Vortice.Direct3D12/ID3D12DeviceConfiguration.cs index d65c4f74..763def50 100644 --- a/src/Vortice.Direct3D12/ID3D12DeviceConfiguration.cs +++ b/src/Vortice.Direct3D12/ID3D12DeviceConfiguration.cs @@ -5,13 +5,13 @@ namespace Vortice.Direct3D12; public unsafe partial class ID3D12DeviceConfiguration { - public ID3D12VersionedRootSignatureDeserializer CreateVersionedRootSignatureDeserializer(IntPtr blob, PointerSize size) + public ID3D12VersionedRootSignatureDeserializer CreateVersionedRootSignatureDeserializer(IntPtr blob, nuint size) { CreateVersionedRootSignatureDeserializer(blob.ToPointer(), size, typeof(ID3D12VersionedRootSignatureDeserializer).GUID, out IntPtr nativePtr).CheckError(); return new(nativePtr)!; } - public Result CreateVersionedRootSignatureDeserializer(IntPtr blob, PointerSize size, out ID3D12VersionedRootSignatureDeserializer? deserializer) + public Result CreateVersionedRootSignatureDeserializer(IntPtr blob, nuint size, out ID3D12VersionedRootSignatureDeserializer? deserializer) { Result result = CreateVersionedRootSignatureDeserializer(blob.ToPointer(), size, typeof(ID3D12VersionedRootSignatureDeserializer).GUID, out IntPtr nativePtr); @@ -25,13 +25,13 @@ public Result CreateVersionedRootSignatureDeserializer(IntPtr blob, PointerSize return result; } - public T CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IntPtr blob, PointerSize size) where T : ID3D12VersionedRootSignatureDeserializer + public T CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IntPtr blob, nuint size) where T : ID3D12VersionedRootSignatureDeserializer { CreateVersionedRootSignatureDeserializer(blob.ToPointer(), size, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; } - public Result CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IntPtr blob, PointerSize size, out T? deserializer) where T : ID3D12VersionedRootSignatureDeserializer + public Result CreateVersionedRootSignatureDeserializer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IntPtr blob, nuint size, out T? deserializer) where T : ID3D12VersionedRootSignatureDeserializer { Result result = CreateVersionedRootSignatureDeserializer(blob.ToPointer(), size, typeof(T).GUID, out IntPtr nativePtr); diff --git a/src/Vortice.Direct3D12/ID3D12GraphicsCommandList4.cs b/src/Vortice.Direct3D12/ID3D12GraphicsCommandList4.cs index ad0b0695..a2fa9141 100644 --- a/src/Vortice.Direct3D12/ID3D12GraphicsCommandList4.cs +++ b/src/Vortice.Direct3D12/ID3D12GraphicsCommandList4.cs @@ -114,7 +114,7 @@ public void BuildRaytracingAccelerationStructure(BuildRaytracingAccelerationStru public void InitializeMetaCommand(ID3D12MetaCommand metaCommand) { - InitializeMetaCommand(metaCommand, IntPtr.Zero, PointerSize.Zero); + InitializeMetaCommand(metaCommand, nint.Zero, nuint.Zero); } public void InitializeMetaCommand(ID3D12MetaCommand metaCommand, Blob initializationParametersData) @@ -124,7 +124,7 @@ public void InitializeMetaCommand(ID3D12MetaCommand metaCommand, Blob initializa public void ExecuteMetaCommand(ID3D12MetaCommand metaCommand) { - ExecuteMetaCommand(metaCommand, IntPtr.Zero, PointerSize.Zero); + ExecuteMetaCommand(metaCommand, nint.Zero, nuint.Zero); } public void ExecuteMetaCommand(ID3D12MetaCommand metaCommand, Blob executionParametersData) diff --git a/src/Vortice.Direct3D12/ID3D12PipelineLibrary1.cs b/src/Vortice.Direct3D12/ID3D12PipelineLibrary1.cs index 4f3bf4a1..5c522165 100644 --- a/src/Vortice.Direct3D12/ID3D12PipelineLibrary1.cs +++ b/src/Vortice.Direct3D12/ID3D12PipelineLibrary1.cs @@ -7,11 +7,11 @@ public partial class ID3D12PipelineLibrary1 { public ID3D12PipelineState LoadPipeline(string name, PipelineStateStreamDescription description) { - return LoadPipeline(name, ref description, typeof(ID3D12PipelineState).GUID); + return LoadPipeline(name, description, typeof(ID3D12PipelineState).GUID); } public ID3D12PipelineState LoadPipeline(string name, ref PipelineStateStreamDescription description) { - return LoadPipeline(name, ref description, typeof(ID3D12PipelineState).GUID); + return LoadPipeline(name, description, typeof(ID3D12PipelineState).GUID); } } diff --git a/src/Vortice.Direct3D12/PipelineStateStreamSubObject.cs b/src/Vortice.Direct3D12/PipelineStateStreamSubObject.cs index 478fd9ed..4343f376 100644 --- a/src/Vortice.Direct3D12/PipelineStateStreamSubObject.cs +++ b/src/Vortice.Direct3D12/PipelineStateStreamSubObject.cs @@ -703,7 +703,7 @@ public PipelineStateStreamFlags(PipelineStateFlags flags) : this() public readonly struct PipelineStateSubObjectTypeCachedPipelineState : IPipelineStateStreamSubObject { [FieldOffset(0)] - internal readonly AlignedSubObjectType _type; + internal readonly AlignedSubObjectType _type; [FieldOffset(0)] internal readonly PointerSize _pad; @@ -712,8 +712,7 @@ public PipelineStateSubObjectTypeCachedPipelineState(in CachedPipelineState desc { _pad = default; _type._type = PipelineStateSubObjectType.CachedPipelineStateObject; - _type._inner = new CachedPipelineState.__Native(); - description.__MarshalTo(ref _type._inner); + _type._inner = description; } public static implicit operator PipelineStateSubObjectTypeCachedPipelineState(in CachedPipelineState description) diff --git a/src/Vortice.Direct3D12/Range.cs b/src/Vortice.Direct3D12/Range.cs index 575be8c3..e3ec8308 100644 --- a/src/Vortice.Direct3D12/Range.cs +++ b/src/Vortice.Direct3D12/Range.cs @@ -16,7 +16,7 @@ public partial struct Range : IEquatable /// /// End is one-past-the-end. When Begin equals End, the range is empty. The size of the range is (End - Begin). /// - public Range(PointerSize begin, PointerSize end) + public Range(nuint begin, nuint end) { Begin = begin; End = end; diff --git a/src/Vortice.Direct3D12/Video/ID3D12VideoDevice2.cs b/src/Vortice.Direct3D12/Video/ID3D12VideoDevice2.cs index 1993d1a4..db10d9d0 100644 --- a/src/Vortice.Direct3D12/Video/ID3D12VideoDevice2.cs +++ b/src/Vortice.Direct3D12/Video/ID3D12VideoDevice2.cs @@ -64,13 +64,13 @@ public ID3D12VideoDecoderHeap1 CreateVideoDecoderHeap1(VideoDecoderHeapDescripti #endregion #region CreateVideoExtensionCommand - public ID3D12VideoExtensionCommand CreateVideoExtensionCommand(VideoExtensionCommandDescription description, IntPtr creationParameters, PointerSize creationParametersDataSizeInBytes, ID3D12ProtectedResourceSession protectedResourceSession) + public ID3D12VideoExtensionCommand CreateVideoExtensionCommand(VideoExtensionCommandDescription description, IntPtr creationParameters, nuint creationParametersDataSizeInBytes, ID3D12ProtectedResourceSession protectedResourceSession) { CreateVideoExtensionCommand(ref description, creationParameters, creationParametersDataSizeInBytes, protectedResourceSession, typeof(ID3D12VideoExtensionCommand).GUID, out IntPtr nativePtr).CheckError(); return new ID3D12VideoExtensionCommand(nativePtr); } - public T CreateVideoExtensionCommand<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(VideoExtensionCommandDescription description, IntPtr creationParameters, PointerSize creationParametersDataSizeInBytes, ID3D12ProtectedResourceSession protectedResourceSession) where T : ID3D12VideoExtensionCommand + public T CreateVideoExtensionCommand<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(VideoExtensionCommandDescription description, IntPtr creationParameters, nuint creationParametersDataSizeInBytes, ID3D12ProtectedResourceSession protectedResourceSession) where T : ID3D12VideoExtensionCommand { CreateVideoExtensionCommand(ref description, creationParameters, creationParametersDataSizeInBytes, protectedResourceSession, typeof(T).GUID, out IntPtr nativePtr).CheckError(); return MarshallingHelpers.FromPointer(nativePtr)!; @@ -78,8 +78,8 @@ public ID3D12VideoExtensionCommand CreateVideoExtensionCommand(VideoExtensionCom public Result CreateVideoExtensionCommand<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>( VideoExtensionCommandDescription description, - IntPtr creationParameters, - PointerSize creationParametersDataSizeInBytes, + nint creationParameters, + nuint creationParametersDataSizeInBytes, ID3D12ProtectedResourceSession protectedResourceSession, out T? videoExtensionCommand) where T : ID3D12VideoExtensionCommand { diff --git a/src/Vortice.DirectX/DXCore/IDXCoreAdapter.cs b/src/Vortice.DirectX/DXCore/IDXCoreAdapter.cs index c9b5935d..efacf5f6 100644 --- a/src/Vortice.DirectX/DXCore/IDXCoreAdapter.cs +++ b/src/Vortice.DirectX/DXCore/IDXCoreAdapter.cs @@ -49,9 +49,9 @@ public HardwareIDParts? HardwareIDParts return result; } - public PointerSize GetPropertySize(AdapterProperty property) + public nuint GetPropertySize(AdapterProperty property) { - GetPropertySize(property, out PointerSize propertySize).CheckError(); + GetPropertySize(property, out PointerUSize propertySize).CheckError(); return propertySize; } @@ -64,16 +64,16 @@ public bool GetBoolProperty(AdapterProperty property) public string GetStringProperty(AdapterProperty property) { - GetPropertySize(property, out PointerSize propertySize).CheckError(); - byte* strBytes = stackalloc byte[propertySize]; + GetPropertySize(property, out PointerUSize propertySize).CheckError(); + byte* strBytes = stackalloc byte[(int)((uint)propertySize)]; GetProperty(property, propertySize, strBytes).CheckError(); - return System.Text.Encoding.UTF8.GetString(strBytes, propertySize - 1); + return System.Text.Encoding.UTF8.GetString(strBytes, (int)((uint)propertySize - 1)); } public unsafe T GetProperty(AdapterProperty property) where T : unmanaged { T result = default; - GetProperty(property, sizeof(T), &result).CheckError(); + GetProperty(property, unchecked((uint)sizeof(T)), &result).CheckError(); return result; } @@ -81,7 +81,7 @@ public unsafe Result GetProperty(AdapterProperty property, out T propertyData { fixed (void* pPropertyData = &propertyData) { - Result result = GetProperty(property, sizeof(T), pPropertyData); + Result result = GetProperty(property, unchecked((uint)sizeof(T)), pPropertyData); return result; } } @@ -91,8 +91,8 @@ public unsafe Result SetState(AdapterState state, T1 inputStateDetails, where T2 : unmanaged { return SetState(state, - sizeof(T1), &inputStateDetails, - sizeof(T2), &inputData); + unchecked((uint)sizeof(T1)), &inputStateDetails, + unchecked((uint)sizeof(T2)), &inputData); } public unsafe Result QueryState(AdapterState state, T1 inputStateDetails, out T2 outputData) @@ -102,8 +102,8 @@ public unsafe Result QueryState(AdapterState state, T1 inputStateDetails fixed (void* outputBuffer = &outputData) { return QueryState(state, - sizeof(T1), &inputStateDetails, - sizeof(T2), outputBuffer + unchecked((uint)sizeof(T1)), &inputStateDetails, + unchecked((uint)sizeof(T2)), outputBuffer ); } } diff --git a/src/Vortice.DirectX/Direct3D/Blob.cs b/src/Vortice.DirectX/Direct3D/Blob.cs index 299ec908..d47ef23a 100644 --- a/src/Vortice.DirectX/Direct3D/Blob.cs +++ b/src/Vortice.DirectX/Direct3D/Blob.cs @@ -25,11 +25,13 @@ public byte[] AsBytes() public ReadOnlySpan AsSpan() { - return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)GetBufferSize()); + nuint bufferSize = GetBufferSize(); + return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)bufferSize); } public ReadOnlyMemory AsMemory() { - return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)GetBufferSize()).ToArray(); + nuint bufferSize = GetBufferSize(); + return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)bufferSize).ToArray(); } } diff --git a/src/Vortice.Dxc/IDxcBlob.cs b/src/Vortice.Dxc/IDxcBlob.cs index 39d040da..2dad7de7 100644 --- a/src/Vortice.Dxc/IDxcBlob.cs +++ b/src/Vortice.Dxc/IDxcBlob.cs @@ -7,6 +7,8 @@ namespace Vortice.Dxc; public unsafe partial class IDxcBlob { + private nuint BufferSize { get => GetBufferSize(); } + public byte[] AsBytes() { byte[] result = new byte[GetBufferSize()]; @@ -19,11 +21,13 @@ public byte[] AsBytes() public ReadOnlySpan AsSpan() { - return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)GetBufferSize()); + nuint bufferSize = GetBufferSize(); + return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)bufferSize); } public ReadOnlyMemory AsMemory() { - return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)GetBufferSize()).ToArray(); + nuint bufferSize = GetBufferSize(); + return new ReadOnlySpan(GetBufferPointer().ToPointer(), (int)bufferSize).ToArray(); } } diff --git a/src/Vortice.Dxc/IDxcCompiler3.cs b/src/Vortice.Dxc/IDxcCompiler3.cs index 5b1653a8..6087e64d 100644 --- a/src/Vortice.Dxc/IDxcCompiler3.cs +++ b/src/Vortice.Dxc/IDxcCompiler3.cs @@ -19,7 +19,7 @@ public unsafe IDxcResult Compile(string source, string[] arguments, IDxcIncludeH DxcBuffer buffer = new() { Ptr = shaderSourcePtr, - Size = source.Length, + Size = (nuint)source.Length, Encoding = Dxc.DXC_CP_ACP }; @@ -85,7 +85,7 @@ public unsafe IDxcResult Compile(string source, string[] arguments, IDxcIncludeH DxcBuffer buffer = new() { Ptr = shaderSourcePtr, - Size = source.Length, + Size = (nuint)source.Length, Encoding = Dxc.DXC_CP_ACP }; diff --git a/src/Vortice.Dxc/IDxcUtils.cs b/src/Vortice.Dxc/IDxcUtils.cs index 7040cd7b..a8371b1d 100644 --- a/src/Vortice.Dxc/IDxcUtils.cs +++ b/src/Vortice.Dxc/IDxcUtils.cs @@ -164,10 +164,10 @@ public Result GetDxilContainerPart(string shaderSource, int dxcPart, out IntPtr { IntPtr shaderSourcePtr = Marshal.StringToHGlobalAnsi(shaderSource); - DxcBuffer buffer = new DxcBuffer + DxcBuffer buffer = new() { Ptr = shaderSourcePtr, - Size = shaderSource.Length, + Size = (nuint)shaderSource.Length, Encoding = Dxc.DXC_CP_ACP }; diff --git a/src/Vortice.Dxc/Mappings.xml b/src/Vortice.Dxc/Mappings.xml index 1fbd898d..1eb83286 100644 --- a/src/Vortice.Dxc/Mappings.xml +++ b/src/Vortice.Dxc/Mappings.xml @@ -37,6 +37,7 @@ + diff --git a/src/samples/HelloDirect3D12/D3D12GraphicsDevice.cs b/src/samples/HelloDirect3D12/D3D12GraphicsDevice.cs index 35c94017..81706752 100644 --- a/src/samples/HelloDirect3D12/D3D12GraphicsDevice.cs +++ b/src/samples/HelloDirect3D12/D3D12GraphicsDevice.cs @@ -1,4 +1,4 @@ -// Copyright (c) Amer Koleci and contributors. +// Copyright (c) Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. using System.Numerics; diff --git a/src/samples/HelloDirect3D12/PipelineStateStream.cs b/src/samples/HelloDirect3D12/PipelineStateStream.cs index 9aa51ba7..c9fac028 100644 --- a/src/samples/HelloDirect3D12/PipelineStateStream.cs +++ b/src/samples/HelloDirect3D12/PipelineStateStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Amer Koleci and contributors. +// Copyright (c) Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. using Vortice.Direct3D12; diff --git a/src/samples/HelloDirect3D12/Program.cs b/src/samples/HelloDirect3D12/Program.cs index 218a5aa4..7a3a5a80 100644 --- a/src/samples/HelloDirect3D12/Program.cs +++ b/src/samples/HelloDirect3D12/Program.cs @@ -1,6 +1,8 @@ -// Copyright (c) Amer Koleci and contributors. +// Copyright (c) Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. +using System.Numerics; +using System.Runtime.InteropServices; using SharpGen.Runtime; using Vortice; @@ -35,7 +37,73 @@ public static void Main() Configuration.EnableObjectTracking = true; #endif + using (var queue = Vortice.DXGI.DXGI.DXGIGetDebugInterface1()) + { + queue?.SetBreakOnSeverity(Vortice.DXGI.DXGI.DebugAll, Vortice.DXGI.Debug.InfoQueueMessageSeverity.Corruption, true); + queue?.SetBreakOnSeverity(Vortice.DXGI.DXGI.DebugAll, Vortice.DXGI.Debug.InfoQueueMessageSeverity.Error, true); + queue?.SetBreakOnSeverity(Vortice.DXGI.DXGI.DebugAll, Vortice.DXGI.Debug.InfoQueueMessageSeverity.Warning, true); + } + + using (var debug = Vortice.Direct3D12.D3D12.D3D12GetDebugInterface()) + { + debug?.EnableDebugLayer(); + } + + using (var factory = Vortice.DXGI.DXGI.CreateDXGIFactory2(true)) + { + var adapters = GetAdapters(factory); + + var adapter = adapters + .Where(a => !a.Description1.Flags.HasFlag(Vortice.DXGI.AdapterFlags.Software)) + .MaxBy(a => a.Description1.DedicatedVideoMemory) + ; + + using (var device = Vortice.Direct3D12.D3D12.D3D12CreateDevice(adapter, Vortice.Direct3D.FeatureLevel.Level_12_0)) + using (var infoQueue = device.QueryInterfaceOrNull()) + { + infoQueue?.SetBreakOnSeverity(Vortice.Direct3D12.Debug.MessageSeverity.Corruption, true); + infoQueue?.SetBreakOnSeverity(Vortice.Direct3D12.Debug.MessageSeverity.Error, true); + infoQueue?.SetBreakOnSeverity(Vortice.Direct3D12.Debug.MessageSeverity.Warning, true); + + infoQueue?.PushStorageFilter(new Vortice.Direct3D12.Debug.InfoQueueFilter + { + AllowList = new Vortice.Direct3D12.Debug.InfoQueueFilterDescription + { + }, + DenyList = new Vortice.Direct3D12.Debug.InfoQueueFilterDescription + { + Ids = new[] { Vortice.Direct3D12.Debug.MessageId.ClearRenderTargetViewMismatchingClearValue, Vortice.Direct3D12.Debug.MessageId.CreateResourceStateIgnored }, + Severities = new[] { Vortice.Direct3D12.Debug.MessageSeverity.Info } + } + }); + + var parameters = new List(); + parameters.Add(new Vortice.Direct3D12.RootParameter1(new Vortice.Direct3D12.RootConstants(0, 0, Marshal.SizeOf() / 4), Vortice.Direct3D12.ShaderVisibility.All)); + + var flags = Vortice.Direct3D12.RootSignatureFlags.LocalRootSignature | Vortice.Direct3D12.RootSignatureFlags.ConstantBufferViewShaderResourceViewUnorderedAccessViewHeapDirectlyIndexed; + device.CreateRootSignature(new Vortice.Direct3D12.RootSignatureDescription1(flags, parameters.ToArray())); + } + } + using TestApplication app = new(); app.Run(); } + + public static Vortice.DXGI.IDXGIAdapter1[] GetAdapters(Vortice.DXGI.IDXGIFactory5 factory) + { + var result = new List(); + for (int index = 0; factory.EnumAdapters1(index, out var adapter).Success; index++) + { + result.Add(adapter); + } + + return result.ToArray(); + } + + [StructLayout(LayoutKind.Explicit, Size = 28)] + struct Material + { + [FieldOffset(0)] + public required Vector3 Colour; + } } diff --git a/src/samples/HelloDirect3D12/ShaderIncludeHandler.cs b/src/samples/HelloDirect3D12/ShaderIncludeHandler.cs index 62471716..3197dfb3 100644 --- a/src/samples/HelloDirect3D12/ShaderIncludeHandler.cs +++ b/src/samples/HelloDirect3D12/ShaderIncludeHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) Amer Koleci and contributors. +// Copyright (c) Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. using System.Runtime.InteropServices;