blob: fb1bd0985fe8364fb00bd837731b6cc13a173670 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
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;
}
}
}
|