diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ea02e7d4..33865739 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "nuke.globaltool": { - "version": "8.1.1", + "version": "8.1.2", "commands": [ "nuke" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 5967b1ed..d5f0db80 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,14 +9,14 @@ - - + + - - + + - - + + diff --git a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/ConstantBuffer.cs b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/ConstantBuffer.cs index 6cb07ca4..f3ad003b 100644 --- a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/ConstantBuffer.cs +++ b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/ConstantBuffer.cs @@ -22,7 +22,7 @@ protected ConstantBuffer(ID3D11RenderingEngine renderingEngine, ref T data) MiscFlags = ResourceOptionFlags.None, CPUAccessFlags = CpuAccessFlags.Write, StructureByteStride = 0, - ByteWidth = Unsafe.SizeOf(), + ByteWidth = (uint)Unsafe.SizeOf(), }) { } diff --git a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/IndexBuffer.cs b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/IndexBuffer.cs index fe32b66b..46dcc441 100644 --- a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/IndexBuffer.cs +++ b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/IndexBuffer.cs @@ -11,12 +11,12 @@ public class IndexBuffer : Buffer, IIndexBuffer where T : unmanaged { private readonly Format _format; - public int IndexCount { get; } + public uint IndexCount { get; } public IndexBuffer( ID3D11RenderingEngine renderingEngine, in T[] data, - int sizeInBytes, + uint sizeInBytes, Format format = Format.R16_UInt) : base( renderingEngine, @@ -28,11 +28,11 @@ public IndexBuffer( MiscFlags = ResourceOptionFlags.None, CPUAccessFlags = CpuAccessFlags.None, StructureByteStride = sizeInBytes, - ByteWidth = data.Length * sizeInBytes, + ByteWidth = (uint)data.Length * sizeInBytes, }) { _format = format; - IndexCount = data.Length; + IndexCount = (uint)data.Length; } public override void Bind() => _renderingEngine.DeviceContext diff --git a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/VertexBuffer.cs b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/VertexBuffer.cs index 076f153c..0c76d21f 100644 --- a/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/VertexBuffer.cs +++ b/src/Demo.Engine.Platform.DirectX/Bindable/Buffers/VertexBuffer.cs @@ -9,12 +9,12 @@ namespace Demo.Engine.Platform.DirectX.Bindable.Buffers; public class VertexBuffer : Buffer where T : unmanaged { - private readonly int _sizeInBytes; + private readonly uint _sizeInBytes; public VertexBuffer( ID3D11RenderingEngine renderingEngine, ReadOnlySpan data, - int sizeInBytes) + uint sizeInBytes) : base( renderingEngine, data, @@ -25,7 +25,7 @@ public VertexBuffer( MiscFlags = ResourceOptionFlags.None, CPUAccessFlags = CpuAccessFlags.None, StructureByteStride = sizeInBytes, - ByteWidth = data.Length * sizeInBytes, + ByteWidth = (uint)data.Length * sizeInBytes, }) => _sizeInBytes = sizeInBytes; diff --git a/src/Demo.Engine.Platform.DirectX/D3D11RenderingEngine.cs b/src/Demo.Engine.Platform.DirectX/D3D11RenderingEngine.cs index a85651d1..594cb259 100644 --- a/src/Demo.Engine.Platform.DirectX/D3D11RenderingEngine.cs +++ b/src/Demo.Engine.Platform.DirectX/D3D11RenderingEngine.cs @@ -101,8 +101,8 @@ public D3D11RenderingEngine( { BufferCount = 2, BufferDescription = new ModeDescription( - _formSettings.CurrentValue.Width, - _formSettings.CurrentValue.Height, + (uint)_formSettings.CurrentValue.Width, + (uint)_formSettings.CurrentValue.Height, Format.B8G8R8A8_UNorm), Windowed = true, OutputWindow = Control.Handle, @@ -163,8 +163,8 @@ public D3D11RenderingEngine( () => Device.CreateTexture2D( new Texture2DDescription { - Width = _formSettings.CurrentValue.Width, - Height = _formSettings.CurrentValue.Height, + Width = (uint)_formSettings.CurrentValue.Width, + Height = (uint)_formSettings.CurrentValue.Height, MipLevels = 1, ArraySize = 1, Format = Format.D32_Float, @@ -221,8 +221,8 @@ public bool EndScene() { var result = _debugLayerLogger.WrapCallInMessageExceptionHandler( () => _swapChain.Present( - _formSettings.CurrentValue.VSync - ? 1 : 0, + (uint)(_formSettings.CurrentValue.VSync + ? 1 : 0), PresentFlags.None)); return !result.Failure @@ -266,7 +266,7 @@ protected virtual void Dispose(bool disposing) DeviceContext.Flush(); DeviceContext.Dispose(); Device.Dispose(); - _swapChain.GetFullscreenState(out var fullscreen); + _ = _swapChain.GetFullscreenState(out var fullscreen); if (fullscreen == true) { _ = _swapChain.SetFullscreenState(false); diff --git a/src/Demo.Engine.Platform.DirectX/Interfaces/IIndexBuffer.cs b/src/Demo.Engine.Platform.DirectX/Interfaces/IIndexBuffer.cs index c2510571..c275fbf9 100644 --- a/src/Demo.Engine.Platform.DirectX/Interfaces/IIndexBuffer.cs +++ b/src/Demo.Engine.Platform.DirectX/Interfaces/IIndexBuffer.cs @@ -5,5 +5,5 @@ namespace Demo.Engine.Platform.DirectX.Interfaces; internal interface IIndexBuffer { - int IndexCount { get; } + uint IndexCount { get; } } \ No newline at end of file diff --git a/src/Demo.Engine.Platform.DirectX/Models/DrawableBase.cs b/src/Demo.Engine.Platform.DirectX/Models/DrawableBase.cs index 0ef42dbf..fbdcc68c 100644 --- a/src/Demo.Engine.Platform.DirectX/Models/DrawableBase.cs +++ b/src/Demo.Engine.Platform.DirectX/Models/DrawableBase.cs @@ -23,7 +23,7 @@ public abstract class DrawableBase : IDrawable, IDisposable private static readonly HashSet _references = new(); - protected static int? IndexCount { get; private set; } + protected static uint? IndexCount { get; private set; } internal DrawableBase( ID3D11RenderingEngine renderingEngine, diff --git a/src/Demo.Engine.Platform.DirectX/Vertex.cs b/src/Demo.Engine.Platform.DirectX/Vertex.cs index f0f345fa..a7179281 100644 --- a/src/Demo.Engine.Platform.DirectX/Vertex.cs +++ b/src/Demo.Engine.Platform.DirectX/Vertex.cs @@ -22,7 +22,7 @@ public Vertex(Vector3 position, Color color) => public Vector3 Position { get; } public Color Color { get; } - public static readonly int SizeInBytes = Unsafe.SizeOf(); - public static readonly int PositionSizeInBytes = Unsafe.SizeOf(); + public static readonly uint SizeInBytes = (uint)Unsafe.SizeOf(); + public static readonly uint PositionSizeInBytes = (uint)Unsafe.SizeOf(); public static readonly int ColorSizeInBytes = Unsafe.SizeOf(); } \ No newline at end of file