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