buffer setData tweak and pin depthstenciltargetdescription

pull/14/head
cosmonaut 2021-01-28 21:49:33 -08:00
parent 55d8e5a1df
commit 9e4007f9f0
2 changed files with 20 additions and 7 deletions

View File

@ -22,8 +22,8 @@ namespace MoonWorks.Graphics
}
public unsafe void SetData<T>(
uint offsetInBytes,
T[] data,
uint offsetInBytes,
uint dataLengthInBytes
) where T : unmanaged
{
@ -55,12 +55,11 @@ namespace MoonWorks.Graphics
}
}
public void SetData<T>(
uint offsetInBytes,
public void SetData(
IntPtr data,
uint offsetInBytes,
uint dataLengthInBytes
) where T : unmanaged
{
) {
Refresh.Refresh_SetBufferData(
Device.Handle,
Handle,
@ -70,6 +69,20 @@ namespace MoonWorks.Graphics
);
}
public unsafe void SetData<T>(
T* data,
uint offsetInBytes,
uint dataLengthInBytes
) where T : unmanaged {
Refresh.Refresh_SetBufferData(
Device.Handle,
Handle,
offsetInBytes,
(IntPtr) data,
dataLengthInBytes
);
}
// NOTE: You want to wait on the device before calling this
public unsafe void GetData<T>(
T[] data,

View File

@ -25,12 +25,12 @@ namespace MoonWorks.Graphics
public unsafe RenderPass(
GraphicsDevice device,
DepthStencilTargetDescription depthStencilTargetDescription,
in DepthStencilTargetDescription depthStencilTargetDescription,
params ColorTargetDescription[] colorTargetDescriptions
) : base(device)
{
DepthStencilTargetDescription* depthStencilPtr = &depthStencilTargetDescription;
fixed (DepthStencilTargetDescription* depthStencilPtr = &depthStencilTargetDescription)
fixed (ColorTargetDescription* colorPtr = colorTargetDescriptions)
{
Refresh.RenderPassCreateInfo renderPassCreateInfo;