2019-11-14 13:26:40 -05:00
|
|
|
using Ryujinx.Graphics.GAL;
|
|
|
|
using Ryujinx.Graphics.Shader;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gpu.Shader
|
|
|
|
{
|
2019-12-30 23:46:57 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Cached shader code for a single shader stage.
|
|
|
|
/// </summary>
|
2020-05-05 21:02:28 -04:00
|
|
|
class ShaderCodeHolder
|
2019-11-14 13:26:40 -05:00
|
|
|
{
|
2019-12-30 23:46:57 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Shader program containing translated code.
|
|
|
|
/// </summary>
|
2019-11-14 13:26:40 -05:00
|
|
|
public ShaderProgram Program { get; }
|
|
|
|
|
2020-11-12 18:15:34 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Shader program information.
|
|
|
|
/// </summary>
|
|
|
|
public ShaderProgramInfo Info { get; }
|
|
|
|
|
2019-12-30 23:46:57 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Host shader object.
|
|
|
|
/// </summary>
|
2020-11-12 18:15:34 -05:00
|
|
|
/// <remarks>Null if the host shader program cache is in use.</remarks>
|
2019-12-31 17:09:49 -05:00
|
|
|
public IShader HostShader { get; set; }
|
2019-12-30 23:46:57 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Maxwell binary shader code.
|
|
|
|
/// </summary>
|
2020-05-05 21:02:28 -04:00
|
|
|
public byte[] Code { get; }
|
2019-11-14 13:26:40 -05:00
|
|
|
|
2019-12-30 23:46:57 -05:00
|
|
|
/// <summary>
|
2020-05-05 21:02:28 -04:00
|
|
|
/// Optional maxwell binary shader code for "Vertex A" shader.
|
|
|
|
/// </summary>
|
|
|
|
public byte[] Code2 { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new instace of the shader code holder.
|
2019-12-30 23:46:57 -05:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="program">Shader program</param>
|
2020-11-12 18:15:34 -05:00
|
|
|
/// <param name="info">Shader program information</param>
|
2019-12-30 23:46:57 -05:00
|
|
|
/// <param name="code">Maxwell binary shader code</param>
|
2020-05-05 21:02:28 -04:00
|
|
|
/// <param name="code2">Optional binary shader code of the "Vertex A" shader, when combined with "Vertex B"</param>
|
2020-11-12 18:15:34 -05:00
|
|
|
public ShaderCodeHolder(ShaderProgram program, ShaderProgramInfo info, byte[] code, byte[] code2 = null)
|
2019-11-14 13:26:40 -05:00
|
|
|
{
|
2020-01-05 20:04:37 -05:00
|
|
|
Program = program;
|
2020-11-12 18:15:34 -05:00
|
|
|
Info = info;
|
2020-01-05 20:04:37 -05:00
|
|
|
Code = code;
|
2020-05-05 21:02:28 -04:00
|
|
|
Code2 = code2;
|
2019-11-14 13:26:40 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|