Skip to content

Commit

Permalink
.net7.0 -> .net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gluschenko committed Dec 5, 2023
1 parent 6239c03 commit da5fa9c
Show file tree
Hide file tree
Showing 43 changed files with 88 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: 📂 Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: 📂 Pack RenderBox
working-directory: ${{env.ROOT}}/RenderBox/out
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Running;
using RenderBox.Benchmarks.Tests;
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Benchmarks
{
Expand Down
4 changes: 3 additions & 1 deletion src/RenderBox.Benchmarks/RenderBox.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/RenderBox.Benchmarks/Tests/Md5_Sha256.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography;
using BenchmarkDotNet.Attributes;

namespace RenderBox.Benchmarks.Tests
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox.Benchmarks/Tests/Pow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using BenchmarkDotNet.Attributes;
using RenderBox.Core;
using BenchmarkDotNet.Attributes;
using RenderBox.Shared.Core;

namespace RenderBox.Benchmarks.Tests
{
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox.Benchmarks/Tests/Sqrt_FastSqrt.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using BenchmarkDotNet.Attributes;
using RenderBox.Core;
using BenchmarkDotNet.Attributes;
using RenderBox.Shared.Core;

namespace RenderBox.Benchmarks.Tests
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Core/Color.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;

namespace RenderBox.Core
namespace RenderBox.Shared.Core
{
public struct Color
{
Expand Down
16 changes: 7 additions & 9 deletions src/RenderBox.Shared/Core/ColorHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace RenderBox.Core
namespace RenderBox.Shared.Core
{
public static class ColorHelpers
{
Expand Down Expand Up @@ -54,14 +52,14 @@ public static void ToHSV(this Color color, out double hue, out double saturation
/// </summary>
public static Color FromHSV(double hue, double saturation, double value)
{
int hi = Convert.ToInt32(Math.Floor(hue / 60)) % 6;
double f = hue / 60 - Math.Floor(hue / 60);
var hi = Convert.ToInt32(Math.Floor(hue / 60)) % 6;
var f = hue / 60 - Math.Floor(hue / 60);

//value *= 255;
float v = Convert.ToSingle(value);
float p = Convert.ToSingle(value * (1 - saturation));
float q = Convert.ToSingle(value * (1 - f * saturation));
float t = Convert.ToSingle(value * (1 - (1 - f) * saturation));
var v = Convert.ToSingle(value);
var p = Convert.ToSingle(value * (1 - saturation));
var q = Convert.ToSingle(value * (1 - f * saturation));
var t = Convert.ToSingle(value * (1 - (1 - f) * saturation));

if (hi == 0)
return new Color(v, t, p);
Expand Down
11 changes: 5 additions & 6 deletions src/RenderBox.Shared/Core/MathHelpres.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace RenderBox.Core
namespace RenderBox.Shared.Core
{
public class MathHelpres
{
Expand Down Expand Up @@ -63,7 +62,7 @@ public static bool SolveQuadratic(ref double a, ref double b, ref double c, ref
x0 = x1 = -0.5 * b / a;
else
{
var q = (b > 0) ?
var q = b > 0 ?
-0.5 * (b + FastSqrt(discr)) :
-0.5 * (b - FastSqrt(discr));
x0 = q / a;
Expand Down Expand Up @@ -106,15 +105,15 @@ public static float FastPow(float a, float b)
{
var i = (int)(BitConverter.DoubleToInt64Bits(a) >> 32);
var j = (int)(b * (i - 1072632447) + 1072632447);
return (float)BitConverter.Int64BitsToDouble(((long)j) << 32);
return (float)BitConverter.Int64BitsToDouble((long)j << 32);
}

[MethodImpl(Runtime.IMPL_OPTIONS)]
public static double FastPow(double a, double b)
{
var i = (int)(BitConverter.DoubleToInt64Bits(a) >> 32);
var j = (int)(b * (i - 1072632447) + 1072632447);
return BitConverter.Int64BitsToDouble(((long)j) << 32);
return BitConverter.Int64BitsToDouble((long)j << 32);
}

[MethodImpl(Runtime.IMPL_OPTIONS)]
Expand Down
8 changes: 3 additions & 5 deletions src/RenderBox.Shared/Core/Rand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace RenderBox.Core
namespace RenderBox.Shared.Core
{
public static class Rand
{
Expand All @@ -25,11 +23,11 @@ private static int

private static int Next()
{
var t = _x ^ (_x << 11);
var t = _x ^ _x << 11;
_x = _y;
_y = _z;
_z = _w;
return (_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)));
return _w = _w ^ _w >> 19 ^ t ^ t >> 8;
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox.Shared/Core/Vector.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace RenderBox.Core
namespace RenderBox.Shared.Core
{
public class Runtime
{
Expand Down
3 changes: 1 addition & 2 deletions src/RenderBox.Shared/Modules/Mandelbrot/Filters/Filters.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.Mandelbrot.Filters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.Mandelbrot.Filters
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/Mandelbrot/MandelbrotSet.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Runtime.CompilerServices;
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.Mandelbrot
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Camera.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Light.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Material.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Ray.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
4 changes: 1 addition & 3 deletions src/RenderBox.Shared/Modules/PathTracer/Scene.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Scenes/BigRoom.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;
using RenderBox.Shared.Modules.PathTracer.Shapes;

namespace RenderBox.Shared.Modules.PathTracer.Scenes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;
using RenderBox.Shared.Modules.PathTracer.Shapes;

namespace RenderBox.Shared.Modules.PathTracer.Scenes
Expand Down
2 changes: 1 addition & 1 deletion src/RenderBox.Shared/Modules/PathTracer/Shape.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer
{
Expand Down
4 changes: 1 addition & 3 deletions src/RenderBox.Shared/Modules/PathTracer/Shapes/Box.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using RenderBox.Core;
using RenderBox.Shared.Core;

namespace RenderBox.Shared.Modules.PathTracer.Shapes
{
Expand Down
6 changes: 2 additions & 4 deletions src/RenderBox.Shared/Modules/PathTracer/Shapes/Mesh.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using RenderBox.Core;
using static RenderBox.Core.VectorMath;
using RenderBox.Shared.Core;
using static RenderBox.Shared.Core.VectorMath;

namespace RenderBox.Shared.Modules.PathTracer.Shapes
{
Expand Down
4 changes: 2 additions & 2 deletions src/RenderBox.Shared/Modules/PathTracer/Shapes/Sphere.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using RenderBox.Core;
using static RenderBox.Core.VectorMath;
using RenderBox.Shared.Core;
using static RenderBox.Shared.Core.VectorMath;

namespace RenderBox.Shared.Modules.PathTracer.Shapes
{
Expand Down
4 changes: 1 addition & 3 deletions src/RenderBox.Shared/Modules/Perlin/PerlinNoise.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace RenderBox.Shared.Modules.Perlin
namespace RenderBox.Shared.Modules.Perlin
{
public class PerlinNoise
{
Expand Down
11 changes: 10 additions & 1 deletion src/RenderBox.Shared/RenderBox.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -15,4 +17,11 @@
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/RenderBox/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Windows;
using System.Windows;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
11 changes: 3 additions & 8 deletions src/RenderBox/RenderBox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>Resources\RenderBoxLogo.ico</ApplicationIcon>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!--
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
<TieredCompilation>false</TieredCompilation>
Expand All @@ -25,13 +27,6 @@
<ProjectReference Include="..\RenderBox.Shared\RenderBox.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox/Services/Renderers/DrawingRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using RenderBox.Core;
using RenderBox.Services.Rendering;
using RenderBox.Services.Rendering;
using RenderBox.Shared.Core;

namespace RenderBox.Services.Renderers
{
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox/Services/Renderers/MandelbrotRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Windows.Input;
using RenderBox.Core;
using RenderBox.Services.Rendering;
using RenderBox.Shared.Core;
using RenderBox.Shared.Modules.Mandelbrot;
using RenderBox.Shared.Modules.Mandelbrot.Filters;

Expand Down
8 changes: 3 additions & 5 deletions src/RenderBox/Services/Renderers/PathTraceRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Diagnostics;
using System.Windows.Input;
using RenderBox.Core;
using RenderBox.Services.Rendering;
using RenderBox.Shared.Core;
using RenderBox.Shared.Modules.PathTracer;
using RenderBox.Shared.Modules.PathTracer.Scenes;
using RenderBox.Shared.Modules.PathTracer.Shapes;
using static RenderBox.Core.VectorMath;
using static RenderBox.Shared.Core.VectorMath;

namespace RenderBox.Services.Renderers
{
Expand Down
4 changes: 2 additions & 2 deletions src/RenderBox/Services/Renderers/PerlinRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using RenderBox.Core;
using RenderBox.Services.Rendering;
using RenderBox.Services.Rendering;
using RenderBox.Shared.Core;
using RenderBox.Shared.Modules.Perlin;

namespace RenderBox.Services.Renderers
Expand Down
5 changes: 2 additions & 3 deletions src/RenderBox/Services/Renderers/RandomRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using RenderBox.Core;
using RenderBox.Services.Rendering;
using RenderBox.Services.Rendering;
using RenderBox.Shared.Core;

namespace RenderBox.Services.Renderers
{
Expand Down
Loading

0 comments on commit da5fa9c

Please sign in to comment.