diff --git a/src/Graphics/Resources/Buffer.cs b/src/Graphics/Resources/Buffer.cs index 3beb7656..3fbcfd7f 100644 --- a/src/Graphics/Resources/Buffer.cs +++ b/src/Graphics/Resources/Buffer.cs @@ -22,8 +22,8 @@ namespace MoonWorks.Graphics } public unsafe void SetData( - uint offsetInBytes, T[] data, + uint offsetInBytes, uint dataLengthInBytes ) where T : unmanaged { @@ -55,12 +55,11 @@ namespace MoonWorks.Graphics } } - public void SetData( - 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* 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[] data, diff --git a/src/Graphics/Resources/RenderPass.cs b/src/Graphics/Resources/RenderPass.cs index 415f26d8..81b6acbf 100644 --- a/src/Graphics/Resources/RenderPass.cs +++ b/src/Graphics/Resources/RenderPass.cs @@ -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;