fix begin render pass

pull/14/head
cosmonaut 2021-02-10 17:15:46 -08:00
parent d1e691a02b
commit dc59b851d4
1 changed files with 22 additions and 12 deletions

View File

@ -72,22 +72,32 @@ namespace MoonWorks.Graphics
RenderPass renderPass, RenderPass renderPass,
Framebuffer framebuffer, Framebuffer framebuffer,
in Rect renderArea, in Rect renderArea,
params Color[] clearColors params Vector4[] clearColors
) { ) {
fixed (Color* clearColorPtr = &clearColors[0]) Refresh.Vec4* colors = stackalloc Refresh.Vec4[clearColors.Length];
for (var i = 0; i < clearColors.Length; i++)
{ {
colors[i] = new Refresh.Vec4
{
x = clearColors[i].X,
y = clearColors[i].Y,
z = clearColors[i].Z,
w = clearColors[i].W
};
}
Refresh.Refresh_BeginRenderPass( Refresh.Refresh_BeginRenderPass(
Device.Handle, Device.Handle,
Handle, Handle,
renderPass.Handle, renderPass.Handle,
framebuffer.Handle, framebuffer.Handle,
renderArea.ToRefresh(), renderArea.ToRefresh(),
(IntPtr) clearColorPtr, (IntPtr) colors,
(uint) clearColors.Length, (uint) clearColors.Length,
IntPtr.Zero IntPtr.Zero
); );
} }
}
public void BindComputePipeline( public void BindComputePipeline(
ComputePipeline computePipeline ComputePipeline computePipeline