forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShaderData.cs
59 lines (44 loc) · 1.23 KB
/
ShaderData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using Microsoft.Xna.Framework.Graphics;
namespace TwoMGFX
{
internal partial class ShaderData
{
public ShaderData(bool isVertexShader, int sharedIndex, byte[] bytecode)
{
IsVertexShader = isVertexShader;
SharedIndex = sharedIndex;
Bytecode = (byte[])bytecode.Clone();
}
public bool IsVertexShader { get; private set; }
public struct Sampler
{
public MojoShader.MOJOSHADER_samplerType type;
public int textureSlot;
public int samplerSlot;
public string samplerName;
public string parameterName;
public int parameter;
public SamplerState state;
}
public struct Attribute
{
public string name;
public VertexElementUsage usage;
public int index;
public int location;
}
/// <summary>
/// The index to the constant buffers which are
/// required by this shader at runtime.
/// </summary>
public int[] _cbuffers;
public Sampler[] _samplers;
public Attribute[] _attributes;
public byte[] ShaderCode { get; set; }
#region Non-Serialized Stuff
public byte[] Bytecode { get; private set; }
// The index of the shader in the shared list.
public int SharedIndex { get; private set; }
#endregion // Non-Serialized Stuff
}
}