Move code to Ryujinx.Common

This commit is contained in:
Alex Barney 2019-12-15 21:45:38 -06:00
parent 782ee5ceca
commit a103fb0025
6 changed files with 14 additions and 6 deletions

View file

@ -3,7 +3,7 @@ using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace LibHac.Common
namespace Ryujinx.Common.Utilities
{
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 16)]

View file

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace LibHac.Common
namespace Ryujinx.Common.Utilities
{
public static class SpanHelpers
{

View file

@ -7,6 +7,7 @@ using Ryujinx.Graphics.Texture.Astc;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Ryujinx.Common.Logging;
namespace Ryujinx.Graphics.Gpu.Image
{
@ -245,7 +246,10 @@ namespace Ryujinx.Graphics.Gpu.Image
if (!_context.Capabilities.SupportsAstcCompression && _info.FormatInfo.Format.IsAstc())
{
if (!AstcDecoder.TryDecodeToRgba8P(
Logger.PrintInfo(LogClass.Gpu, "Decoding ASTC texture");
var watch = Stopwatch.StartNew();
if (!AstcDecoder.TryDecodeToRgba8(
data.ToArray(),
_info.FormatInfo.BlockWidth,
_info.FormatInfo.BlockHeight,
@ -258,6 +262,10 @@ namespace Ryujinx.Graphics.Gpu.Image
// TODO: Error.
}
watch.Stop();
Logger.PrintInfo(LogClass.Gpu, $"Decoded texture in {watch.Elapsed.TotalSeconds} seconds");
data = decoded;
}

View file

@ -1,4 +1,4 @@
using LibHac.Common;
using Ryujinx.Common.Utilities;
using System;
using System.Diagnostics;
using System.Linq;

View file

@ -1,4 +1,4 @@
using LibHac.Common;
using Ryujinx.Common.Utilities;
using System;
using System.Diagnostics;

View file

@ -1,4 +1,4 @@
using LibHac.Common;
using Ryujinx.Common.Utilities;
using System;
using System.Diagnostics;
using System.Numerics;