aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gpu/TextureHelper.cs
blob: d3c2ac14b5cf7b1ee0605a6e8ae8c346f4f28d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;

namespace Ryujinx.Graphics.Gpu
{
    static class TextureHelper
    {
        public static ISwizzle GetSwizzle(Texture Texture, int Width, int Bpp)
        {
            switch (Texture.Swizzle)
            {
                case TextureSwizzle.Pitch:
                case TextureSwizzle.PitchColorKey:
                     return new LinearSwizzle(Texture.Pitch, Bpp);

                case TextureSwizzle.BlockLinear:
                case TextureSwizzle.BlockLinearColorKey:
                    return new BlockLinearSwizzle(Width, Bpp, Texture.BlockHeight);
            }

            throw new NotImplementedException(Texture.Swizzle.ToString());
        }
    }
}