-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFXInterfaces.cs
64 lines (50 loc) · 1.61 KB
/
FXInterfaces.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
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDX;
using SharpDX.Direct3D11;
using SharpDX.D3DCompiler;
// resolve conflict - DXGI.Device & Direct3D10.Device
using Device = SharpDX.Direct3D11.Device;
using Buffer = SharpDX.Direct3D11.Buffer;
using Effect = SharpDX.Direct3D11.Effect;
using EffectFlags = SharpDX.D3DCompiler.EffectFlags;
namespace FXFramework
{
[Flags]
public enum ShaderType { None = 0x00, Pixel = 0x01, Vertex = 0x02, Compute = 0x04, Geometry = 0x08 };
/// <summary>
/// The type of the buffer
/// </summary>
[Flags]
public enum AccessViewType { SRV = 0x00, UAV = 0x01 };
public interface IFXResources
{
/// <summary>
/// Commit any memmory changes and set the buffers
/// </summary>
/// <param name="deviceContext"></param>
/// <param name="type"></param>
void Commit( DeviceContext deviceContext, ShaderType type );
/// <summary>
/// Clean the resource binding
/// </summary>
/// <param name="deviceContext"></param>
/// <param name="type"></param>
void CleanBind(DeviceContext deviceContext, ShaderType type);
void Dispose();
}
public interface IFXVariable
{
/// <summary>
/// Update the data in datastream of the constant buffer if the data are dirty.
/// </summary>
/// <returns>If we have change</returns>
Boolean Commit();
/// <summary>
/// We have changes to the buffer ?
/// </summary>
Boolean isDirty { get; }
}
}