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