Move code to Ryujinx.Common
This commit is contained in:
parent
782ee5ceca
commit
a103fb0025
6 changed files with 14 additions and 6 deletions
|
@ -3,7 +3,7 @@ using System.Diagnostics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace LibHac.Common
|
namespace Ryujinx.Common.Utilities
|
||||||
{
|
{
|
||||||
[DebuggerDisplay("{ToString()}")]
|
[DebuggerDisplay("{ToString()}")]
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 16)]
|
[StructLayout(LayoutKind.Sequential, Size = 16)]
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace LibHac.Common
|
namespace Ryujinx.Common.Utilities
|
||||||
{
|
{
|
||||||
public static class SpanHelpers
|
public static class SpanHelpers
|
||||||
{
|
{
|
|
@ -7,6 +7,7 @@ using Ryujinx.Graphics.Texture.Astc;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Gpu.Image
|
namespace Ryujinx.Graphics.Gpu.Image
|
||||||
{
|
{
|
||||||
|
@ -245,7 +246,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
|
|
||||||
if (!_context.Capabilities.SupportsAstcCompression && _info.FormatInfo.Format.IsAstc())
|
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(),
|
data.ToArray(),
|
||||||
_info.FormatInfo.BlockWidth,
|
_info.FormatInfo.BlockWidth,
|
||||||
_info.FormatInfo.BlockHeight,
|
_info.FormatInfo.BlockHeight,
|
||||||
|
@ -258,6 +262,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
// TODO: Error.
|
// TODO: Error.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch.Stop();
|
||||||
|
|
||||||
|
Logger.PrintInfo(LogClass.Gpu, $"Decoded texture in {watch.Elapsed.TotalSeconds} seconds");
|
||||||
|
|
||||||
data = decoded;
|
data = decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using LibHac.Common;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using LibHac.Common;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using LibHac.Common;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue