mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-25 22:12:23 -05:00
Move solution and projects to src
This commit is contained in:
33
src/Ryujinx.Graphics.Vic/Image/SurfaceCommon.cs
Normal file
33
src/Ryujinx.Graphics.Vic/Image/SurfaceCommon.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Graphics.Texture;
|
||||
|
||||
namespace Ryujinx.Graphics.Vic.Image
|
||||
{
|
||||
static class SurfaceCommon
|
||||
{
|
||||
public static int GetPitch(int width, int bytesPerPixel)
|
||||
{
|
||||
return BitUtils.AlignUp(width * bytesPerPixel, 256);
|
||||
}
|
||||
|
||||
public static int GetBlockLinearSize(int width, int height, int bytesPerPixel, int gobBlocksInY)
|
||||
{
|
||||
return SizeCalculator.GetBlockLinearTextureSize(width, height, 1, 1, 1, 1, 1, bytesPerPixel, gobBlocksInY, 1, 1).TotalSize;
|
||||
}
|
||||
|
||||
public static ulong ExtendOffset(uint offset)
|
||||
{
|
||||
return (ulong)offset << 8;
|
||||
}
|
||||
|
||||
public static ushort Upsample(byte value)
|
||||
{
|
||||
return (ushort)(value << 2);
|
||||
}
|
||||
|
||||
public static byte Downsample(ushort value)
|
||||
{
|
||||
return (byte)(value >> 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user