aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2023-06-25 18:37:09 +0200
committerGitHub <noreply@github.com>2023-06-25 18:37:09 +0200
commitbc53d0046310293a90a4312fa9317bb698dded5c (patch)
tree1cb49891f7f116f2a872eca9a433102005007033 /src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
parentbddb2a148355ef2ce326d47e8e5217bd8af36a98 (diff)
[Ryujinx.Graphics.Vic] Address dotnet-format issues (#5374)1.1.913
* dotnet format style --severity info Some changes were manually reverted. * Restore a few unused methods and variables * Address review comments * Address most dotnet format whitespace warnings * Add comments to disabled warnings * Address IDE0251 warnings * dotnet format whitespace after rebase * Remove SuppressMessage attribute for removed rule
Diffstat (limited to 'src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs')
-rw-r--r--src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs b/src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
index 10fd9d8d..079b4ef1 100644
--- a/src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
+++ b/src/Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
@@ -21,7 +21,8 @@ namespace Ryujinx.Graphics.Vic.Image
{
switch (surfaceConfig.SlotPixelFormat)
{
- case PixelFormat.Y8___V8U8_N420: return ReadNv12(rm, ref config, ref surfaceConfig, ref offsets);
+ case PixelFormat.Y8___V8U8_N420:
+ return ReadNv12(rm, ref config, ref surfaceConfig, ref offsets);
}
Logger.Error?.Print(LogClass.Vic, $"Unsupported pixel format \"{surfaceConfig.SlotPixelFormat}\".");
@@ -46,7 +47,7 @@ namespace Ryujinx.Graphics.Vic.Image
int yStride = GetPitch(width, 1);
int uvStride = GetPitch(input.UvWidth, 2);
- Surface output = new Surface(rm.SurfacePool, width, height);
+ Surface output = new(rm.SurfacePool, width, height);
if (Sse41.IsSupported)
{
@@ -276,7 +277,7 @@ namespace Ryujinx.Graphics.Vic.Image
int bytesPerPixel,
int planes)
{
- InputSurface surface = new InputSurface();
+ InputSurface surface = new();
surface.Initialize();
@@ -458,7 +459,7 @@ namespace Ryujinx.Graphics.Vic.Image
int outSize = dstStride * height;
int bufferIndex = rm.BufferPool.RentMinimum(outSize, out byte[] buffer);
Span<byte> dst = buffer;
- dst = dst.Slice(0, outSize);
+ dst = dst[..outSize];
for (int y = 0; y < height; y++)
{
@@ -485,9 +486,9 @@ namespace Ryujinx.Graphics.Vic.Image
int outSize = dstStride * height;
int bufferIndex = rm.BufferPool.RentMinimum(outSize, out byte[] buffer);
Span<byte> dst = buffer;
- dst = dst.Slice(0, outSize);
+ dst = dst[..outSize];
- LayoutConverter.ConvertBlockLinearToLinear(dst.Slice(dstStart), width, height, dstStride, bytesPerPixel, gobBlocksInY, src);
+ LayoutConverter.ConvertBlockLinearToLinear(dst[dstStart..], width, height, dstStride, bytesPerPixel, gobBlocksInY, src);
return new RentedBuffer(dst, bufferIndex);
}