Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
cosmonaut | b92ecb60e3 | |
cosmonaut | 995a54fa2d | |
cosmonaut | 1bf28f4397 | |
cosmonaut | 8f42783fd1 | |
cosmonaut | 029f19196a | |
cosmonaut | 22b6a83aea | |
cosmonaut | 55acf6ee18 | |
cosmonaut | 859675dbab | |
cosmonaut | 7465d4d4de | |
cosmonaut | 86cc5fa142 | |
cosmonaut | 4268db4616 | |
cosmonaut | 020e76782a | |
cosmonaut | 031ad4c047 | |
cosmonaut | 2e346d8401 | |
cosmonaut | ad0b168c47 |
|
@ -4,7 +4,6 @@
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<RootNamespace>RefreshCS</RootNamespace>
|
<RootNamespace>RefreshCS</RootNamespace>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Platforms>x64</Platforms>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
492
src/Refresh.cs
492
src/Refresh.cs
|
@ -35,8 +35,8 @@ namespace RefreshCS
|
||||||
|
|
||||||
/* Version */
|
/* Version */
|
||||||
|
|
||||||
public const uint REFRESH_MAJOR_VERSION = 1;
|
public const uint REFRESH_MAJOR_VERSION = 2;
|
||||||
public const uint REFRESH_MINOR_VERSION = 15;
|
public const uint REFRESH_MINOR_VERSION = 0;
|
||||||
public const uint REFRESH_PATCH_VERSION = 0;
|
public const uint REFRESH_PATCH_VERSION = 0;
|
||||||
|
|
||||||
public const uint REFRESH_COMPILED_VERSION = (
|
public const uint REFRESH_COMPILED_VERSION = (
|
||||||
|
@ -308,10 +308,29 @@ namespace RefreshCS
|
||||||
IntOpaqueWhite
|
IntOpaqueWhite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum TransferUsage
|
||||||
|
{
|
||||||
|
Buffer,
|
||||||
|
Texture
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TransferOptions
|
||||||
|
{
|
||||||
|
Cycle,
|
||||||
|
Unsafe
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum WriteOptions
|
||||||
|
{
|
||||||
|
Cycle,
|
||||||
|
Unsafe,
|
||||||
|
Safe
|
||||||
|
}
|
||||||
|
|
||||||
public enum Backend
|
public enum Backend
|
||||||
{
|
{
|
||||||
DontCare,
|
|
||||||
Vulkan,
|
Vulkan,
|
||||||
|
D3D11,
|
||||||
PS5,
|
PS5,
|
||||||
Invalid
|
Invalid
|
||||||
}
|
}
|
||||||
|
@ -358,10 +377,36 @@ namespace RefreshCS
|
||||||
public struct TextureSlice
|
public struct TextureSlice
|
||||||
{
|
{
|
||||||
public IntPtr texture;
|
public IntPtr texture;
|
||||||
public Rect rectangle;
|
public uint mipLevel;
|
||||||
public uint depth;
|
|
||||||
public uint layer;
|
public uint layer;
|
||||||
public uint level;
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct TextureRegion
|
||||||
|
{
|
||||||
|
public TextureSlice textureSlice;
|
||||||
|
public uint x;
|
||||||
|
public uint y;
|
||||||
|
public uint z;
|
||||||
|
public uint w;
|
||||||
|
public uint h;
|
||||||
|
public uint d;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct BufferImageCopy
|
||||||
|
{
|
||||||
|
public uint bufferOffset;
|
||||||
|
public uint bufferStride;
|
||||||
|
public uint bufferImageHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct BufferCopy
|
||||||
|
{
|
||||||
|
public uint srcOffset;
|
||||||
|
public uint dstOffset;
|
||||||
|
public uint size;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
@ -425,9 +470,6 @@ namespace RefreshCS
|
||||||
public StencilOp passOp;
|
public StencilOp passOp;
|
||||||
public StencilOp depthFailOp;
|
public StencilOp depthFailOp;
|
||||||
public CompareOp compareOp;
|
public CompareOp compareOp;
|
||||||
public uint compareMask;
|
|
||||||
public uint writeMask;
|
|
||||||
public uint reference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
@ -457,6 +499,7 @@ namespace RefreshCS
|
||||||
public uint height;
|
public uint height;
|
||||||
public uint depth;
|
public uint depth;
|
||||||
public byte isCube;
|
public byte isCube;
|
||||||
|
public uint layerCount;
|
||||||
public uint levelCount;
|
public uint levelCount;
|
||||||
public SampleCount sampleCount;
|
public SampleCount sampleCount;
|
||||||
public TextureFormat format;
|
public TextureFormat format;
|
||||||
|
@ -469,7 +512,7 @@ namespace RefreshCS
|
||||||
public IntPtr shaderModule;
|
public IntPtr shaderModule;
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
public string entryPointName;
|
public string entryPointName;
|
||||||
public ulong uniformBufferSize;
|
public uint uniformBufferSize;
|
||||||
public uint samplerBindingCount;
|
public uint samplerBindingCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +522,7 @@ namespace RefreshCS
|
||||||
public IntPtr shaderModule;
|
public IntPtr shaderModule;
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
public string entryPointName;
|
public string entryPointName;
|
||||||
public ulong uniformBufferSize;
|
public uint uniformBufferSize;
|
||||||
public uint bufferBindingCount;
|
public uint bufferBindingCount;
|
||||||
public uint imageBindingCount;
|
public uint imageBindingCount;
|
||||||
}
|
}
|
||||||
|
@ -511,8 +554,11 @@ namespace RefreshCS
|
||||||
public CompareOp compareOp;
|
public CompareOp compareOp;
|
||||||
public byte depthBoundsTestEnable;
|
public byte depthBoundsTestEnable;
|
||||||
public byte stencilTestEnable;
|
public byte stencilTestEnable;
|
||||||
public StencilOpState frontStencilState;
|
|
||||||
public StencilOpState backStencilState;
|
public StencilOpState backStencilState;
|
||||||
|
public StencilOpState frontStencilState;
|
||||||
|
public uint compareMask;
|
||||||
|
public uint writeMask;
|
||||||
|
public uint reference;
|
||||||
public float minDepthBounds;
|
public float minDepthBounds;
|
||||||
public float maxDepthBounds;
|
public float maxDepthBounds;
|
||||||
}
|
}
|
||||||
|
@ -547,28 +593,54 @@ namespace RefreshCS
|
||||||
public fixed float blendConstants[4];
|
public fixed float blendConstants[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct ColorAttachmentInfo
|
public struct ColorAttachmentInfo
|
||||||
{
|
{
|
||||||
public IntPtr texture;
|
public TextureSlice textureSlice;
|
||||||
public uint depth;
|
|
||||||
public uint layer;
|
|
||||||
public uint level;
|
|
||||||
public Vec4 clearColor;
|
public Vec4 clearColor;
|
||||||
public LoadOp loadOp;
|
public LoadOp loadOp;
|
||||||
public StoreOp storeOp;
|
public StoreOp storeOp;
|
||||||
|
public WriteOptions writeOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct DepthStencilAttachmentInfo
|
public struct DepthStencilAttachmentInfo
|
||||||
{
|
{
|
||||||
public IntPtr texture;
|
public TextureSlice textureSlice;
|
||||||
public uint depth;
|
|
||||||
public uint layer;
|
|
||||||
public uint level;
|
|
||||||
public DepthStencilValue depthStencilClearValue;
|
public DepthStencilValue depthStencilClearValue;
|
||||||
public LoadOp loadOp;
|
public LoadOp loadOp;
|
||||||
public StoreOp storeOp;
|
public StoreOp storeOp;
|
||||||
public LoadOp stencilLoadOp;
|
public LoadOp stencilLoadOp;
|
||||||
public StoreOp stencilStoreOp;
|
public StoreOp stencilStoreOp;
|
||||||
|
public WriteOptions writeOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct BufferBinding
|
||||||
|
{
|
||||||
|
public IntPtr gpuBuffer;
|
||||||
|
public uint offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct TextureSamplerBinding
|
||||||
|
{
|
||||||
|
public IntPtr texture;
|
||||||
|
public IntPtr sampler;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct ComputeBufferBinding
|
||||||
|
{
|
||||||
|
public IntPtr gpuBuffer;
|
||||||
|
public WriteOptions writeOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct ComputeTextureBinding
|
||||||
|
{
|
||||||
|
public TextureSlice textureSlice;
|
||||||
|
public WriteOptions writeOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Logging */
|
/* Logging */
|
||||||
|
@ -586,8 +658,9 @@ namespace RefreshCS
|
||||||
/* Init/Quit */
|
/* Init/Quit */
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern Backend Refresh_SelectBackend(
|
public static unsafe extern Backend Refresh_SelectBackend(
|
||||||
Backend preferredBackend,
|
Backend* preferredBackends,
|
||||||
|
uint preferredBackendCount,
|
||||||
out uint flags
|
out uint flags
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -599,64 +672,7 @@ namespace RefreshCS
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_DestroyDevice(IntPtr device);
|
public static extern void Refresh_DestroyDevice(IntPtr device);
|
||||||
|
|
||||||
/* Drawing */
|
/* State Creation */
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_DrawInstancedPrimitives(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
uint baseVertex,
|
|
||||||
uint startIndex,
|
|
||||||
uint primitiveCount,
|
|
||||||
uint instanceCount,
|
|
||||||
uint vertexParamOffset,
|
|
||||||
uint fragmentParamOffset
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_DrawIndexedPrimitives(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
uint baseVertex,
|
|
||||||
uint startIndex,
|
|
||||||
uint primitiveCount,
|
|
||||||
uint vertexParamOffset,
|
|
||||||
uint fragmentParamOffset
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_DrawPrimitives(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
uint vertexStart,
|
|
||||||
uint primitiveCount,
|
|
||||||
uint vertexParamOffset,
|
|
||||||
uint fragmentParamOffset
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_DrawPrimitivesIndirect(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr buffer,
|
|
||||||
uint offsetInBytes,
|
|
||||||
uint drawCount,
|
|
||||||
uint stride,
|
|
||||||
uint vertexParamOffset,
|
|
||||||
uint fragmentParamOffset
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_DispatchCompute(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
uint groupCountX,
|
|
||||||
uint groupCountY,
|
|
||||||
uint groupCountZ,
|
|
||||||
uint computeParamOffset
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Creates */
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Refresh_CreateComputePipeline(
|
public static extern IntPtr Refresh_CreateComputePipeline(
|
||||||
|
@ -689,100 +705,33 @@ namespace RefreshCS
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Refresh_CreateBuffer(
|
public static extern IntPtr Refresh_CreateGpuBuffer(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
BufferUsageFlags usageFlags,
|
BufferUsageFlags usageFlags,
|
||||||
uint sizeInBytes
|
uint sizeInBytes
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Setters */
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_SetTextureData(
|
public static extern IntPtr Refresh_CreateTransferBuffer(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
TransferUsage usage,
|
||||||
in TextureSlice textureSlice,
|
uint sizeInBytes
|
||||||
IntPtr data,
|
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
/* Debug Naming */
|
||||||
public static extern void Refresh_SetTextureDataYUV(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr y,
|
|
||||||
IntPtr u,
|
|
||||||
IntPtr v,
|
|
||||||
uint yWidth,
|
|
||||||
uint yHeight,
|
|
||||||
uint uvWidth,
|
|
||||||
uint uvHeight,
|
|
||||||
IntPtr yDataPtr,
|
|
||||||
IntPtr uDataPtr,
|
|
||||||
IntPtr vDataPtr,
|
|
||||||
uint yDataLength,
|
|
||||||
uint uvDataLength,
|
|
||||||
uint yStride,
|
|
||||||
uint uvStride
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_CopyTextureToTexture(
|
public static extern void Refresh_SetGpuBufferName(
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
in TextureSlice sourceTextureSlice,
|
|
||||||
in TextureSlice destinationTextureSlice,
|
|
||||||
Filter filter
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_CopyTextureToBuffer(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
in TextureSlice textureSlice,
|
|
||||||
IntPtr buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_GetBufferData(
|
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr buffer,
|
IntPtr buffer,
|
||||||
IntPtr data,
|
[MarshalAs(UnmanagedType.LPUTF8Str)] string text
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_SetBufferData(
|
public static extern void Refresh_SetTextureName(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr texture,
|
||||||
IntPtr buffer,
|
[MarshalAs(UnmanagedType.LPUTF8Str)] string text
|
||||||
uint offsetInBytes,
|
|
||||||
IntPtr data,
|
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern uint Refresh_PushVertexShaderUniforms(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr data,
|
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern uint Refresh_PushFragmentShaderUniforms(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr data,
|
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern uint Refresh_PushComputeShaderUniforms(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr data,
|
|
||||||
uint dataLengthInBytes
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Disposal */
|
/* Disposal */
|
||||||
|
@ -800,9 +749,15 @@ namespace RefreshCS
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_QueueDestroyBuffer(
|
public static extern void Refresh_QueueDestroyGpuBuffer(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr buffer
|
IntPtr gpuBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_QueueDestroyTransferBuffer(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr transferBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -843,12 +798,6 @@ namespace RefreshCS
|
||||||
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_EndRenderPass(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindGraphicsPipeline(
|
public static extern void Refresh_BindGraphicsPipeline(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
|
@ -871,38 +820,92 @@ namespace RefreshCS
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindVertexBuffers(
|
public static extern unsafe void Refresh_BindVertexBuffers(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
uint firstBinding,
|
uint firstBinding,
|
||||||
uint bindingCount,
|
uint bindingCount,
|
||||||
IntPtr pBuffers,
|
BufferBinding* pBindings
|
||||||
IntPtr pOffsets
|
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindIndexBuffer(
|
public static extern void Refresh_BindIndexBuffer(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
IntPtr buffer,
|
in BufferBinding pBinding,
|
||||||
uint offset,
|
|
||||||
IndexElementSize indexElementSize
|
IndexElementSize indexElementSize
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindVertexSamplers(
|
public static extern unsafe void Refresh_BindVertexSamplers(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
IntPtr pTextures,
|
TextureSamplerBinding* pBindings
|
||||||
IntPtr pSamplers
|
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindFragmentSamplers(
|
public static extern unsafe void Refresh_BindFragmentSamplers(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
IntPtr pTextures,
|
TextureSamplerBinding* pBindings
|
||||||
IntPtr pSamplers
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_PushVertexShaderUniforms(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr data,
|
||||||
|
uint dataLengthInBytes
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_PushFragmentShaderUniforms(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr data,
|
||||||
|
uint dataLengthInBytes
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DrawInstancedPrimitives(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
uint baseVertex,
|
||||||
|
uint startIndex,
|
||||||
|
uint primitiveCount,
|
||||||
|
uint instanceCount
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DrawPrimitives(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
uint vertexStart,
|
||||||
|
uint primitiveCount
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DrawPrimitivesIndirect(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr gpuBuffer,
|
||||||
|
uint offsetInBytes,
|
||||||
|
uint drawCount,
|
||||||
|
uint stride
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_EndRenderPass(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/* Compute Pass */
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_BeginComputePass(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -913,17 +916,119 @@ namespace RefreshCS
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindComputeBuffers(
|
public static extern unsafe void Refresh_BindComputeBuffers(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
IntPtr pBuffers
|
ComputeBufferBinding* pBindings
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_BindComputeTextures(
|
public static extern unsafe void Refresh_BindComputeTextures(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
IntPtr pTextures
|
ComputeTextureBinding* pBindings
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_PushComputeShaderUniforms(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr data,
|
||||||
|
uint dataLengthInBytes
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DispatchCompute(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
uint groupCountX,
|
||||||
|
uint groupCountY,
|
||||||
|
uint groupCountZ
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_EndComputePass(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/* TransferBuffer Set/Get */
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern IntPtr Refresh_SetTransferData(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr data,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
in BufferCopy copyParams,
|
||||||
|
TransferOptions option
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_GetTransferData(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
IntPtr data,
|
||||||
|
in BufferCopy copyParams
|
||||||
|
);
|
||||||
|
|
||||||
|
/* Copy Pass */
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_BeginCopyPass(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_UploadToTexture(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
in TextureRegion textureRegion,
|
||||||
|
in BufferImageCopy copyParams,
|
||||||
|
WriteOptions writeOption
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_UploadToBuffer(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
IntPtr gpuBuffer,
|
||||||
|
in BufferCopy copyParams,
|
||||||
|
WriteOptions writeOption
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_CopyTextureToTexture(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
in TextureRegion source,
|
||||||
|
in TextureRegion destination,
|
||||||
|
WriteOptions writeOption
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_CopyBufferToBuffer(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr source,
|
||||||
|
IntPtr destination,
|
||||||
|
in BufferCopy copyParams,
|
||||||
|
WriteOptions writeOption
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_GenerateMipmaps(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer,
|
||||||
|
IntPtr texture
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_EndCopyPass(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Submission/Presentation */
|
/* Submission/Presentation */
|
||||||
|
@ -1005,6 +1110,24 @@ namespace RefreshCS
|
||||||
IntPtr fence
|
IntPtr fence
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DownloadFromTexture(
|
||||||
|
IntPtr device,
|
||||||
|
in TextureRegion textureRegion,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
in BufferImageCopy copyParams,
|
||||||
|
TransferOptions transferOption
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_DownloadFromBuffer(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr gpuBuffer,
|
||||||
|
IntPtr transferBuffer,
|
||||||
|
in BufferCopy copyParams,
|
||||||
|
TransferOptions transferOption
|
||||||
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Refresh_Image_Load(
|
public static extern IntPtr Refresh_Image_Load(
|
||||||
IntPtr bufferPtr,
|
IntPtr bufferPtr,
|
||||||
|
@ -1014,6 +1137,15 @@ namespace RefreshCS
|
||||||
out int len
|
out int len
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern byte Refresh_Image_Info(
|
||||||
|
IntPtr bufferPtr,
|
||||||
|
int bufferLength,
|
||||||
|
out int w,
|
||||||
|
out int h,
|
||||||
|
out int len
|
||||||
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_Image_Free(IntPtr mem);
|
public static extern void Refresh_Image_Free(IntPtr mem);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue