Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"nuke.globaltool": {
"version": "8.1.1",
"version": "8.1.2",
"commands": [
"nuke"
]
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
<PackageVersion Include="Vortice.Mathematics" Version="1.9.2" />
<PackageVersion Include="Vortice.D3DCompiler" Version="3.5.0" />
<PackageVersion Include="Vortice.Direct3D11" Version="3.5.0" />
<PackageVersion Include="Vortice.D3DCompiler" Version="3.6.2" />
<PackageVersion Include="Vortice.Direct3D11" Version="3.6.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected ConstantBuffer(ID3D11RenderingEngine renderingEngine, ref T data)
MiscFlags = ResourceOptionFlags.None,
CPUAccessFlags = CpuAccessFlags.Write,
StructureByteStride = 0,
ByteWidth = Unsafe.SizeOf<T>(),
ByteWidth = (uint)Unsafe.SizeOf<T>(),
})
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public class IndexBuffer<T> : Buffer<T>, 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,
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ namespace Demo.Engine.Platform.DirectX.Bindable.Buffers;
public class VertexBuffer<T> : Buffer<T>
where T : unmanaged
{
private readonly int _sizeInBytes;
private readonly uint _sizeInBytes;

public VertexBuffer(
ID3D11RenderingEngine renderingEngine,
ReadOnlySpan<T> data,
int sizeInBytes)
uint sizeInBytes)
: base(
renderingEngine,
data,
Expand All @@ -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;

Expand Down
14 changes: 7 additions & 7 deletions src/Demo.Engine.Platform.DirectX/D3D11RenderingEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Demo.Engine.Platform.DirectX.Interfaces;

internal interface IIndexBuffer
{
int IndexCount { get; }
uint IndexCount { get; }
}
2 changes: 1 addition & 1 deletion src/Demo.Engine.Platform.DirectX/Models/DrawableBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class DrawableBase<T> : IDrawable, IDisposable

private static readonly HashSet<Guid> _references = new();

protected static int? IndexCount { get; private set; }
protected static uint? IndexCount { get; private set; }

internal DrawableBase(
ID3D11RenderingEngine renderingEngine,
Expand Down
4 changes: 2 additions & 2 deletions src/Demo.Engine.Platform.DirectX/Vertex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vertex>();
public static readonly int PositionSizeInBytes = Unsafe.SizeOf<Vector3>();
public static readonly uint SizeInBytes = (uint)Unsafe.SizeOf<Vertex>();
public static readonly uint PositionSizeInBytes = (uint)Unsafe.SizeOf<Vector3>();
public static readonly int ColorSizeInBytes = Unsafe.SizeOf<Color>();
}