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