2019-11-08 12:29:41 -08:00
|
|
|
using System;
|
|
|
|
|
2019-10-12 23:02:07 -07:00
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
|
|
{
|
|
|
|
public class ShaderProgram
|
|
|
|
{
|
|
|
|
public ShaderStage Stage { get; }
|
|
|
|
|
|
|
|
public string Code { get; private set; }
|
2021-07-18 03:49:39 -07:00
|
|
|
public byte[] BinaryCode { get; }
|
2019-10-12 23:02:07 -07:00
|
|
|
|
2021-07-18 03:49:39 -07:00
|
|
|
private ShaderProgram(ShaderStage stage)
|
2019-10-12 23:02:07 -07:00
|
|
|
{
|
|
|
|
Stage = stage;
|
2021-07-18 03:49:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public ShaderProgram(ShaderStage stage, string code) : this(stage)
|
|
|
|
{
|
|
|
|
Code = code;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ShaderProgram(ShaderStage stage, byte[] binaryCode) : this(stage)
|
|
|
|
{
|
|
|
|
BinaryCode = binaryCode;
|
2019-10-12 23:02:07 -07:00
|
|
|
}
|
|
|
|
|
2019-11-08 12:29:41 -08:00
|
|
|
public void Prepend(string line)
|
|
|
|
{
|
|
|
|
Code = line + Environment.NewLine + Code;
|
|
|
|
}
|
2019-10-12 23:02:07 -07:00
|
|
|
}
|
|
|
|
}
|