forked from 3DRadSpace/3D_Rad_Space
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstGPUMultiBuffer.cs
More file actions
39 lines (31 loc) · 1.12 KB
/
Copy pathInstGPUMultiBuffer.cs
File metadata and controls
39 lines (31 loc) · 1.12 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
using System.Runtime.InteropServices;
namespace Engine3DRadSpace.Graphics
{
public class InstGPUMultiBuffer : InstGPUResource, IGPUMultiBuffer
{
[DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_IGPUMultiBuffer_ReadData")]
extern static ulong _readData(IntPtr res, ulong subresource, IntPtr ppData);
[DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_IGPUMultiBuffer_SetData")]
extern static void _writeData(IntPtr res, ulong subresource, IntPtr pData, ulong dataSize);
[DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_IGPUMultiBuffer_EndRead")]
extern static void _endRead(IntPtr res, ulong subresource);
public InstGPUMultiBuffer(IntPtr handle) : base(handle)
{
}
protected InstGPUMultiBuffer(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle)
{
}
public void EndRead(ulong subresource)
{
_endRead(_handle, subresource);
}
public ulong ReadData(ulong subresource, nint ppData)
{
return _readData(_handle, subresource, ppData);
}
public void SetData(ulong subresource, nint pData, ulong buffSize)
{
_writeData(_handle, subresource, pData, buffSize);
}
}
}