forked from MoonsideGames/RefreshCS
Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
cosmonaut | b5325e6d03 | |
cosmonaut | 60a7523fac | |
cosmonaut | ebf511133a | |
cosmonaut | fb5fee5f56 | |
cosmonaut | 10f54d6b03 | |
TheSpydog | 52d3355120 | |
TheSpydog | 880bf79f3a | |
cosmonaut | 1643061386 | |
TheSpydog | e828f9b7fb | |
TheSpydog | 9068263afc | |
cosmonaut | 2880ab39a3 | |
TheSpydog | 2b6ae29053 |
110
src/Refresh.cs
110
src/Refresh.cs
|
@ -36,7 +36,7 @@ namespace RefreshCS
|
||||||
/* Version */
|
/* Version */
|
||||||
|
|
||||||
public const uint REFRESH_MAJOR_VERSION = 1;
|
public const uint REFRESH_MAJOR_VERSION = 1;
|
||||||
public const uint REFRESH_MINOR_VERSION = 8;
|
public const uint REFRESH_MINOR_VERSION = 15;
|
||||||
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 = (
|
||||||
|
@ -136,10 +136,7 @@ namespace RefreshCS
|
||||||
One,
|
One,
|
||||||
Two,
|
Two,
|
||||||
Four,
|
Four,
|
||||||
Eight,
|
Eight
|
||||||
Sixteen,
|
|
||||||
ThirtyTwo,
|
|
||||||
SixtyFour
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CubeMapFace : uint
|
public enum CubeMapFace : uint
|
||||||
|
@ -250,11 +247,7 @@ namespace RefreshCS
|
||||||
OneMinusDestinationAlpha,
|
OneMinusDestinationAlpha,
|
||||||
ConstantColor,
|
ConstantColor,
|
||||||
OneMinusConstantColor,
|
OneMinusConstantColor,
|
||||||
SourceAlphaSaturate,
|
SourceAlphaSaturate
|
||||||
SourceOneColor,
|
|
||||||
OneMinusSourceOneColor,
|
|
||||||
SourceOneAlpha,
|
|
||||||
OneMinusSourceOneAlpha
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@ -371,6 +364,15 @@ namespace RefreshCS
|
||||||
public uint level;
|
public uint level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct IndirectDrawCommand
|
||||||
|
{
|
||||||
|
public uint vertexCount;
|
||||||
|
public uint instanceCount;
|
||||||
|
public uint firstVertex;
|
||||||
|
public uint firstInstance;
|
||||||
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct SamplerStateCreateInfo
|
public struct SamplerStateCreateInfo
|
||||||
{
|
{
|
||||||
|
@ -455,8 +457,8 @@ namespace RefreshCS
|
||||||
public uint height;
|
public uint height;
|
||||||
public uint depth;
|
public uint depth;
|
||||||
public byte isCube;
|
public byte isCube;
|
||||||
public SampleCount sampleCount;
|
|
||||||
public uint levelCount;
|
public uint levelCount;
|
||||||
|
public SampleCount sampleCount;
|
||||||
public TextureFormat format;
|
public TextureFormat format;
|
||||||
public TextureUsageFlags usageFlags; /* Refresh_TextureUsageFlags */
|
public TextureUsageFlags usageFlags; /* Refresh_TextureUsageFlags */
|
||||||
}
|
}
|
||||||
|
@ -485,7 +487,6 @@ namespace RefreshCS
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct RasterizerState
|
public struct RasterizerState
|
||||||
{
|
{
|
||||||
public byte depthClampEnable;
|
|
||||||
public FillMode fillMode;
|
public FillMode fillMode;
|
||||||
public CullMode cullMode;
|
public CullMode cullMode;
|
||||||
public FrontFace frontFace;
|
public FrontFace frontFace;
|
||||||
|
@ -520,7 +521,6 @@ namespace RefreshCS
|
||||||
public struct ColorAttachmentDescription
|
public struct ColorAttachmentDescription
|
||||||
{
|
{
|
||||||
public TextureFormat format;
|
public TextureFormat format;
|
||||||
public SampleCount sampleCount;
|
|
||||||
public ColorAttachmentBlendState blendState;
|
public ColorAttachmentBlendState blendState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,7 +553,6 @@ namespace RefreshCS
|
||||||
public uint depth;
|
public uint depth;
|
||||||
public uint layer;
|
public uint layer;
|
||||||
public uint level;
|
public uint level;
|
||||||
public SampleCount sampleCount;
|
|
||||||
public Vec4 clearColor;
|
public Vec4 clearColor;
|
||||||
public LoadOp loadOp;
|
public LoadOp loadOp;
|
||||||
public StoreOp storeOp;
|
public StoreOp storeOp;
|
||||||
|
@ -718,8 +717,13 @@ namespace RefreshCS
|
||||||
uint yHeight,
|
uint yHeight,
|
||||||
uint uvWidth,
|
uint uvWidth,
|
||||||
uint uvHeight,
|
uint uvHeight,
|
||||||
IntPtr data,
|
IntPtr yDataPtr,
|
||||||
uint dataLength
|
IntPtr uDataPtr,
|
||||||
|
IntPtr vDataPtr,
|
||||||
|
uint yDataLength,
|
||||||
|
uint uvDataLength,
|
||||||
|
uint yStride,
|
||||||
|
uint uvStride
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -825,17 +829,6 @@ namespace RefreshCS
|
||||||
public static extern void Refresh_BeginRenderPass(
|
public static extern void Refresh_BeginRenderPass(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
in Rect renderArea,
|
|
||||||
IntPtr colorAttachmentInfos,
|
|
||||||
uint colorAttachmentCount,
|
|
||||||
IntPtr depthStencilAttachmentInfo /* can be NULL */
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern void Refresh_BeginRenderPass(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr renderArea, /* can be NULL */
|
|
||||||
IntPtr colorAttachmentInfos,
|
IntPtr colorAttachmentInfos,
|
||||||
uint colorAttachmentCount,
|
uint colorAttachmentCount,
|
||||||
IntPtr depthStencilAttachmentInfo /* can be NULL */
|
IntPtr depthStencilAttachmentInfo /* can be NULL */
|
||||||
|
@ -845,17 +838,6 @@ namespace RefreshCS
|
||||||
public static unsafe extern void Refresh_BeginRenderPass(
|
public static unsafe extern void Refresh_BeginRenderPass(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
IntPtr commandBuffer,
|
IntPtr commandBuffer,
|
||||||
in Rect renderArea,
|
|
||||||
ColorAttachmentInfo* colorAttachmentInfos,
|
|
||||||
uint colorAttachmentCount,
|
|
||||||
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static unsafe extern void Refresh_BeginRenderPass(
|
|
||||||
IntPtr device,
|
|
||||||
IntPtr commandBuffer,
|
|
||||||
IntPtr renderArea, /* can be NULL */
|
|
||||||
ColorAttachmentInfo* colorAttachmentInfos,
|
ColorAttachmentInfo* colorAttachmentInfos,
|
||||||
uint colorAttachmentCount,
|
uint colorAttachmentCount,
|
||||||
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
||||||
|
@ -974,8 +956,7 @@ namespace RefreshCS
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Refresh_AcquireCommandBuffer(
|
public static extern IntPtr Refresh_AcquireCommandBuffer(
|
||||||
IntPtr device,
|
IntPtr device
|
||||||
byte isFixed
|
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -990,8 +971,13 @@ namespace RefreshCS
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_Submit(
|
public static extern void Refresh_Submit(
|
||||||
IntPtr device,
|
IntPtr device,
|
||||||
uint commandBufferCount,
|
IntPtr commandBuffer
|
||||||
IntPtr pCommandBuffers
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern IntPtr Refresh_SubmitAndAcquireFence(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr commandBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -999,26 +985,44 @@ namespace RefreshCS
|
||||||
IntPtr device
|
IntPtr device
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_WaitForFences(
|
||||||
|
IntPtr device,
|
||||||
|
byte waitAll,
|
||||||
|
uint fenceCount,
|
||||||
|
IntPtr pFences
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern int Refresh_QueryFence(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr fence
|
||||||
|
);
|
||||||
|
|
||||||
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void Refresh_ReleaseFence(
|
||||||
|
IntPtr device,
|
||||||
|
IntPtr fence
|
||||||
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Refresh_Image_Load(
|
public static extern IntPtr Refresh_Image_Load(
|
||||||
[MarshalAs(UnmanagedType.LPStr)] string filename,
|
IntPtr bufferPtr,
|
||||||
out int width,
|
int bufferLength,
|
||||||
out int height,
|
out int w,
|
||||||
out int numChannels
|
out int h,
|
||||||
|
out int len
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_Image_Free(
|
public static extern void Refresh_Image_Free(IntPtr mem);
|
||||||
IntPtr mem
|
|
||||||
);
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void Refresh_Image_SavePNG(
|
public static extern IntPtr Refresh_Image_SavePNG(
|
||||||
[MarshalAs(UnmanagedType.LPStr)] string filename,
|
[MarshalAs(UnmanagedType.LPStr)] string filename,
|
||||||
|
IntPtr data,
|
||||||
int w,
|
int w,
|
||||||
int h,
|
int h
|
||||||
byte bgra,
|
|
||||||
IntPtr data
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue