1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-11 04:16:38 +00:00
Ryujinx/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/SourceProgramRequest.cs
gdkchan 3bd357045f
Do not allow render targets not explicitly written by the fragment shader to be modified (#3063)
* Do not allow render targets not explicitly written by the fragment shader to be modified

* Shader cache version bump

* Remove blank lines

* Avoid redundant color mask updates

* HostShaderCacheEntry can be null

* Avoid more redundant glColorMask calls

* nit: Mask -> Masks

* Fix currentComponentMask

* More efficient way to update _currentComponentMasks
2022-02-16 23:15:39 +01:00

32 lines
854 B
C#

using System.Linq;
namespace Ryujinx.Graphics.GAL.Multithreading.Resources.Programs
{
class SourceProgramRequest : IProgramRequest
{
public ThreadedProgram Threaded { get; set; }
private IShader[] _shaders;
private ShaderInfo _info;
public SourceProgramRequest(ThreadedProgram program, IShader[] shaders, ShaderInfo info)
{
Threaded = program;
_shaders = shaders;
_info = info;
}
public IProgram Create(IRenderer renderer)
{
IShader[] shaders = _shaders.Select(shader =>
{
var threaded = (ThreadedShader)shader;
threaded?.EnsureCreated();
return threaded?.Base;
}).ToArray();
return renderer.CreateProgram(shaders, _info);
}
}
}