aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.OpenGL/FormatInfo.cs
blob: c1a97e81a2493e97d57ab9205f275b3bf877f063 (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 OpenTK.Graphics.OpenGL;

namespace Ryujinx.Graphics.OpenGL
{
    readonly struct FormatInfo
    {
        public int Components { get; }
        public bool Normalized { get; }
        public bool Scaled { get; }

        public PixelInternalFormat PixelInternalFormat { get; }
        public PixelFormat PixelFormat { get; }
        public PixelType PixelType { get; }

        public bool IsCompressed { get; }

        public FormatInfo(
            int components,
            bool normalized,
            bool scaled,
            All pixelInternalFormat,
            PixelFormat pixelFormat,
            PixelType pixelType)
        {
            Components = components;
            Normalized = normalized;
            Scaled = scaled;
            PixelInternalFormat = (PixelInternalFormat)pixelInternalFormat;
            PixelFormat = pixelFormat;
            PixelType = pixelType;
            IsCompressed = false;
        }

        public FormatInfo(int components, bool normalized, bool scaled, All pixelFormat)
        {
            Components = components;
            Normalized = normalized;
            Scaled = scaled;
            PixelInternalFormat = 0;
            PixelFormat = (PixelFormat)pixelFormat;
            PixelType = 0;
            IsCompressed = true;
        }
    }
}