forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicsStateCollection.cs
More file actions
58 lines (53 loc) · 2.06 KB
/
Copy pathGraphicsStateCollection.cs
File metadata and controls
58 lines (53 loc) · 2.06 KB
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
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering
{
public sealed partial class GraphicsStateCollection : Object
{
[StructLayout(LayoutKind.Sequential)]
public struct GraphicsState
{
public VertexAttributeDescriptor[] vertexAttributes;
public AttachmentDescriptor[] attachments;
public SubPassDescriptor[] subPasses;
public RenderStateBlock renderState;
public MeshTopology topology;
public CullMode forceCullMode;
public float depthBias;
public float slopeDepthBias;
public int depthAttachmentIndex;
public int subPassIndex;
public int shadingRateIndex;
public int multiviewCount;
public int sampleCount;
public bool wireframe;
public bool invertCulling;
public bool negativeScale;
public bool invertProjection;
}
[StructLayout(LayoutKind.Sequential)]
public struct ShaderVariant
{
public Shader shader;
public PassIdentifier passId;
public LocalKeyword[] keywords;
}
}
public sealed partial class GraphicsStateCollection : Object
{
public GraphicsStateCollection() { Internal_Create(this); }
public GraphicsStateCollection(string filePath) { Internal_Create(this); LoadFromFile(filePath); }
public void GetGraphicsStatesForVariant(ShaderVariant variant, List<GraphicsState> results)
{
GetGraphicsStatesForVariant(variant.shader, variant.passId, variant.keywords, results);
}
public int GetGraphicsStateCountForVariant(ShaderVariant variant)
{
return GetGraphicsStateCountForVariant(variant.shader, variant.passId, variant.keywords);
}
}
}