Render Pass Streamlining (#1)

Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
main
cosmonaut 2022-02-25 05:33:45 +00:00
parent 1e8abe379a
commit 5a411e482e
1 changed files with 946 additions and 980 deletions

View File

@ -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)]