Render Pass Streamlining #1
110
src/Refresh.cs
110
src/Refresh.cs
|
@ -463,33 +463,6 @@ namespace RefreshCS
|
|||
public uint fragmentSamplerBindingCount;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ColorTargetDescription
|
||||
{
|
||||
public TextureFormat format;
|
||||
public SampleCount multisampleCount;
|
||||
public LoadOp loadOp;
|
||||
public StoreOp storeOp;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct DepthStencilTargetDescription
|
||||
{
|
||||
public TextureFormat format;
|
||||
public LoadOp loadOp;
|
||||
public StoreOp storeOp;
|
||||
public LoadOp stencilLoadOp;
|
||||
public StoreOp stencilStoreOp;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RenderPassCreateInfo
|
||||
{
|
||||
public IntPtr colorTargetDescriptions; /* Refresh_ColorTargetDescription */
|
||||
public uint colorTargetCount;
|
||||
public IntPtr depthStencilTargetDescription;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ShaderModuleCreateInfo
|
||||
{
|
||||
|
@ -580,6 +553,22 @@ namespace RefreshCS
|
|||
public ComputePipelineLayoutCreateInfo pipelineLayoutCreateInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ColorAttachmentDescription
|
||||
{
|
||||
public TextureFormat format;
|
||||
public SampleCount sampleCount;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GraphicsPipelineAttachmentInfo
|
||||
{
|
||||
public IntPtr colorAttachmentDescriptions; /* Max size 4 */
|
||||
public uint colorAttachmentCount;
|
||||
public byte hasDepthStencilAttachment;
|
||||
public TextureFormat depthStencilFormat;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GraphicsPipelineCreateInfo
|
||||
{
|
||||
|
@ -593,18 +582,25 @@ namespace RefreshCS
|
|||
public DepthStencilState depthStencilState;
|
||||
public ColorBlendState colorBlendState;
|
||||
public GraphicsPipelineLayoutCreateInfo pipelineLayoutCreateInfo;
|
||||
public IntPtr renderPass;
|
||||
public GraphicsPipelineAttachmentInfo attachmentInfo;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct FramebufferCreateInfo
|
||||
public struct ColorAttachmentInfo
|
||||
{
|
||||
public IntPtr renderTarget;
|
||||
public Vec4 clearColor;
|
||||
public LoadOp loadOp;
|
||||
public StoreOp storeOp;
|
||||
}
|
||||
|
||||
public struct DepthStencilAttachmentInfo
|
||||
{
|
||||
public IntPtr renderPass;
|
||||
public IntPtr pColorTargets;
|
||||
public uint colorTargetCount;
|
||||
public IntPtr depthStencilTarget;
|
||||
public uint width;
|
||||
public uint height;
|
||||
public DepthStencilValue depthStencilValue;
|
||||
public LoadOp loadOp;
|
||||
public StoreOp storeOp;
|
||||
public LoadOp stencilLoadOp;
|
||||
public StoreOp stencilStoreOp;
|
||||
}
|
||||
|
||||
/* Logging */
|
||||
|
@ -688,12 +684,6 @@ namespace RefreshCS
|
|||
|
||||
/* Creates */
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Refresh_CreateRenderPass(
|
||||
IntPtr device,
|
||||
in RenderPassCreateInfo renderPassCreateInfo
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Refresh_CreateComputePipeline(
|
||||
IntPtr device,
|
||||
|
@ -712,12 +702,6 @@ namespace RefreshCS
|
|||
in SamplerStateCreateInfo samplerStateCreateInfo
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Refresh_CreateFramebuffer(
|
||||
IntPtr device,
|
||||
in FramebufferCreateInfo framebufferCreateInfo
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Refresh_CreateShaderModule(
|
||||
IntPtr device,
|
||||
|
@ -859,13 +843,6 @@ namespace RefreshCS
|
|||
IntPtr renderTarget
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Refresh_QueueDestroyFramebuffer(
|
||||
IntPtr device,
|
||||
IntPtr commandBuffer,
|
||||
IntPtr framebuffer
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Refresh_QueueDestroyShaderModule(
|
||||
IntPtr device,
|
||||
|
@ -873,13 +850,6 @@ namespace RefreshCS
|
|||
IntPtr shaderModule
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Refresh_QueueDestroyRenderPass(
|
||||
IntPtr device,
|
||||
IntPtr commandBuffer,
|
||||
IntPtr renderPass
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Refresh_QueueDestroyComputePipeline(
|
||||
IntPtr device,
|
||||
|
@ -900,24 +870,20 @@ namespace RefreshCS
|
|||
public static extern void Refresh_BeginRenderPass(
|
||||
IntPtr device,
|
||||
IntPtr commandBuffer,
|
||||
IntPtr renderPass,
|
||||
IntPtr framebuffer,
|
||||
in Rect renderArea,
|
||||
IntPtr pColorClearValues,
|
||||
uint colorClearCount,
|
||||
in DepthStencilValue depthStencilClearValue
|
||||
IntPtr colorAttachmentInfos,
|
||||
uint colorAttachmentCount,
|
||||
IntPtr depthStencilAttachmentInfo /* can be NULL */
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Refresh_BeginRenderPass(
|
||||
public static unsafe extern void Refresh_BeginRenderPass(
|
||||
IntPtr device,
|
||||
IntPtr commandBuffer,
|
||||
IntPtr renderPass,
|
||||
IntPtr framebuffer,
|
||||
in Rect renderArea,
|
||||
IntPtr pColorClearValues,
|
||||
uint colorClearCount,
|
||||
IntPtr depthStencilClearValue /* NULL */
|
||||
ColorAttachmentInfo* colorAttachmentInfos,
|
||||
uint colorAttachmentCount,
|
||||
DepthStencilAttachmentInfo* depthStencilAttachmentInfo /* can be NULL */
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
|
|
Loading…
Reference in New Issue