From 4dc98d6ed838a3ed71add2db921d9f0ec7397b22 Mon Sep 17 00:00:00 2001 From: Misaki Date: Tue, 4 Nov 2025 14:20:22 +0900 Subject: [PATCH] Change .net version from 10 to 9; --- Ghost.Core/Ghost.Core.csproj | 2 +- Ghost.Data/Ghost.Data.csproj | 2 +- Ghost.Editor.Core/Ghost.Editor.Core.csproj | 2 +- Ghost.Editor/Ghost.Editor.csproj | 2 +- Ghost.Engine/Ghost.Engine.csproj | 2 +- .../Ghost.Entities.Test.csproj | 2 +- Ghost.Entities/Ghost.Entities.csproj | 2 +- .../Ghost.Graphics.Test.csproj | 2 +- .../D3D12/Utilities/D3D12Utility.cs | 36 +++++++++++++++++++ Ghost.Graphics/Ghost.Graphics.csproj | 2 +- Ghost.Shader.Test/Ghost.Shader.Test.csproj | 2 +- Ghost.Shader/Ghost.SDL.csproj | 2 +- Ghost.Test.Core/Ghost.Test.Core.csproj | 2 +- 13 files changed, 48 insertions(+), 12 deletions(-) diff --git a/Ghost.Core/Ghost.Core.csproj b/Ghost.Core/Ghost.Core.csproj index 59187ee..166879d 100644 --- a/Ghost.Core/Ghost.Core.csproj +++ b/Ghost.Core/Ghost.Core.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable True diff --git a/Ghost.Data/Ghost.Data.csproj b/Ghost.Data/Ghost.Data.csproj index 18d864b..1a7614c 100644 --- a/Ghost.Data/Ghost.Data.csproj +++ b/Ghost.Data/Ghost.Data.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable diff --git a/Ghost.Editor.Core/Ghost.Editor.Core.csproj b/Ghost.Editor.Core/Ghost.Editor.Core.csproj index d89cac8..cf4ff40 100644 --- a/Ghost.Editor.Core/Ghost.Editor.Core.csproj +++ b/Ghost.Editor.Core/Ghost.Editor.Core.csproj @@ -1,6 +1,6 @@ - net10.0-windows10.0.22621.0 + net9.0-windows10.0.22621.0 10.0.17763.0 Ghost.Editor.Core win-x86;win-x64;win-arm64 diff --git a/Ghost.Editor/Ghost.Editor.csproj b/Ghost.Editor/Ghost.Editor.csproj index c7e8e33..a825bb6 100644 --- a/Ghost.Editor/Ghost.Editor.csproj +++ b/Ghost.Editor/Ghost.Editor.csproj @@ -1,7 +1,7 @@ WinExe - net10.0-windows10.0.22621.0 + net9.0-windows10.0.22621.0 10.0.17763.0 x86;x64;ARM64 win-x86;win-x64;win-arm64 diff --git a/Ghost.Engine/Ghost.Engine.csproj b/Ghost.Engine/Ghost.Engine.csproj index 2ccebb2..7a444fe 100644 --- a/Ghost.Engine/Ghost.Engine.csproj +++ b/Ghost.Engine/Ghost.Engine.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable True diff --git a/Ghost.Entities.Test/Ghost.Entities.Test.csproj b/Ghost.Entities.Test/Ghost.Entities.Test.csproj index 65612d3..1f9b96d 100644 --- a/Ghost.Entities.Test/Ghost.Entities.Test.csproj +++ b/Ghost.Entities.Test/Ghost.Entities.Test.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 enable enable diff --git a/Ghost.Entities/Ghost.Entities.csproj b/Ghost.Entities/Ghost.Entities.csproj index 6569555..f534d1f 100644 --- a/Ghost.Entities/Ghost.Entities.csproj +++ b/Ghost.Entities/Ghost.Entities.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable True diff --git a/Ghost.Graphics.Test/Ghost.Graphics.Test.csproj b/Ghost.Graphics.Test/Ghost.Graphics.Test.csproj index adb8546..f418fad 100644 --- a/Ghost.Graphics.Test/Ghost.Graphics.Test.csproj +++ b/Ghost.Graphics.Test/Ghost.Graphics.Test.csproj @@ -1,7 +1,7 @@ WinExe - net10.0-windows10.0.22621.0 + net9.0-windows10.0.22621.0 10.0.17763.0 Ghost.UnitTest app.manifest diff --git a/Ghost.Graphics/D3D12/Utilities/D3D12Utility.cs b/Ghost.Graphics/D3D12/Utilities/D3D12Utility.cs index 884fe7d..f2a5dbc 100644 --- a/Ghost.Graphics/D3D12/Utilities/D3D12Utility.cs +++ b/Ghost.Graphics/D3D12/Utilities/D3D12Utility.cs @@ -208,4 +208,40 @@ internal unsafe static class D3D12Utility _ => throw new ArgumentException($"Unknown resource state: {state}") }; } + + + + public static D3D12_RASTERIZER_DESC D3D12_RASTERIZER_DESC_CREATE( + D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + bool frontCounterClockwise = false, + int depthBias = D3D12_DEFAULT_DEPTH_BIAS, + float depthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP, + float slopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS, + bool depthClipEnable = true, + bool multisampleEnable = true, + bool antialiasedLineEnable = false, + uint forcedSampleCount = 0, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF) + { + return new D3D12_RASTERIZER_DESC + { + FillMode = fillMode, + CullMode = cullMode, + FrontCounterClockwise = frontCounterClockwise ? TRUE : FALSE, + DepthBias = depthBias, + DepthBiasClamp = depthBiasClamp, + SlopeScaledDepthBias = slopeScaledDepthBias, + DepthClipEnable = depthClipEnable ? TRUE : FALSE, + MultisampleEnable = multisampleEnable ? TRUE : FALSE, + AntialiasedLineEnable = antialiasedLineEnable ? TRUE : FALSE, + ForcedSampleCount = forcedSampleCount, + ConservativeRaster = conservativeRaster + }; + } + + public static D3D12_RASTERIZER_DESC D3D12_RASTERIZER_DESC_CULL_NONE => D3D12_RASTERIZER_DESC_CREATE(D3D12_FILL_MODE_SOLID, D3D12_CULL_MODE_NONE); + public static D3D12_RASTERIZER_DESC D3D12_RASTERIZER_DESC_CULL_CLOCKWISE => D3D12_RASTERIZER_DESC_CREATE(D3D12_FILL_MODE_SOLID, D3D12_CULL_MODE_FRONT); + public static D3D12_RASTERIZER_DESC D3D12_RASTERIZER_DESC_CULL_COUNTER_CLOCKWISE => D3D12_RASTERIZER_DESC_CREATE(D3D12_FILL_MODE_SOLID, D3D12_CULL_MODE_BACK); + public static D3D12_RASTERIZER_DESC D3D12_RASTERIZER_DESC_WIREFRAME => D3D12_RASTERIZER_DESC_CREATE(D3D12_FILL_MODE_WIREFRAME, D3D12_CULL_MODE_NONE); } diff --git a/Ghost.Graphics/Ghost.Graphics.csproj b/Ghost.Graphics/Ghost.Graphics.csproj index ab03445..fc4fcc9 100644 --- a/Ghost.Graphics/Ghost.Graphics.csproj +++ b/Ghost.Graphics/Ghost.Graphics.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable True diff --git a/Ghost.Shader.Test/Ghost.Shader.Test.csproj b/Ghost.Shader.Test/Ghost.Shader.Test.csproj index b2c8a6a..f0cda3d 100644 --- a/Ghost.Shader.Test/Ghost.Shader.Test.csproj +++ b/Ghost.Shader.Test/Ghost.Shader.Test.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net9.0 enable enable True diff --git a/Ghost.Shader/Ghost.SDL.csproj b/Ghost.Shader/Ghost.SDL.csproj index fd3a7a1..e5e20c1 100644 --- a/Ghost.Shader/Ghost.SDL.csproj +++ b/Ghost.Shader/Ghost.SDL.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable diff --git a/Ghost.Test.Core/Ghost.Test.Core.csproj b/Ghost.Test.Core/Ghost.Test.Core.csproj index 9ed914b..0d2df0d 100644 --- a/Ghost.Test.Core/Ghost.Test.Core.csproj +++ b/Ghost.Test.Core/Ghost.Test.Core.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0 enable enable