mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 14:54:00 +00:00
1f554c1093
* Renaming part 1 * Renaming part 2 * Renaming part 3 * Renaming part 4 * Renaming part 5 * Renaming part 6 * Renaming part 7 * Renaming part 8 * Renaming part 9 * Renaming part 10 * General cleanup * Thought I got all of these * Apply #595 * Additional renaming * Tweaks from feedback * Rename files
45 lines
1004 B
C#
45 lines
1004 B
C#
using System;
|
|
|
|
namespace Ryujinx.Graphics.Texture
|
|
{
|
|
class LinearSwizzle : ISwizzle
|
|
{
|
|
private int _pitch;
|
|
private int _bpp;
|
|
|
|
private int _sliceSize;
|
|
|
|
public LinearSwizzle(int pitch, int bpp, int width, int height)
|
|
{
|
|
_pitch = pitch;
|
|
_bpp = bpp;
|
|
_sliceSize = width * height * bpp;
|
|
}
|
|
|
|
public void SetMipLevel(int level)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public int GetMipOffset(int level)
|
|
{
|
|
if (level == 1)
|
|
return _sliceSize;
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public int GetImageSize(int mipsCount)
|
|
{
|
|
int size = GetMipOffset(mipsCount);
|
|
|
|
size = (size + 0x1fff) & ~0x1fff;
|
|
|
|
return size;
|
|
}
|
|
|
|
public int GetSwizzleOffset(int x, int y, int z)
|
|
{
|
|
return z * _sliceSize + x * _bpp + y * _pitch;
|
|
}
|
|
}
|
|
} |