aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/BinaryProgramRequest.cs
blob: 6d250682e8756f3c409cfb5760de039f32ae795d (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
namespace Ryujinx.Graphics.GAL.Multithreading.Resources.Programs
{
    class BinaryProgramRequest : IProgramRequest
    {
        public ThreadedProgram Threaded { get; set; }

        private readonly byte[] _data;
        private readonly bool _hasFragmentShader;
        private ShaderInfo _info;

        public BinaryProgramRequest(ThreadedProgram program, byte[] data, bool hasFragmentShader, ShaderInfo info)
        {
            Threaded = program;

            _data = data;
            _hasFragmentShader = hasFragmentShader;
            _info = info;
        }

        public IProgram Create(IRenderer renderer)
        {
            return renderer.LoadProgramBinary(_data, _hasFragmentShader, _info);
        }
    }
}