move uniform pushes to pipeline

main
cosmonaut 2021-02-05 19:51:10 -08:00
parent 0daf548fd3
commit 29a86c2040
4 changed files with 47 additions and 46 deletions

@ -1 +1 @@
Subproject commit fcb16a6121f556b2aebfbb7e72b71e94041dc1d1
Subproject commit a92549a91395900f30fe9010dfe86e19fedd4e85

View File

@ -69,21 +69,6 @@ namespace MoonWorks.Graphics
);
}
public unsafe uint PushComputeShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushComputeShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
public unsafe void BindComputeBuffers(
params Buffer[] buffers
) {
@ -128,36 +113,6 @@ namespace MoonWorks.Graphics
);
}
public unsafe uint PushVertexShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushVertexShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
public unsafe uint PushFragmentShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushFragmentShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
public unsafe void BindVertexBuffers(
uint firstBinding,
params BufferBinding[] bufferBindings

View File

@ -1,5 +1,6 @@
using RefreshCS;
using System;
using System.Runtime.InteropServices;
namespace MoonWorks.Graphics
{
@ -39,5 +40,20 @@ namespace MoonWorks.Graphics
ComputeShaderState = computeShaderState;
}
public unsafe uint PushComputeShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushComputeShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
}
}

View File

@ -124,5 +124,35 @@ namespace MoonWorks.Graphics
FragmentShaderState = fragmentShaderState;
RenderPass = renderPass;
}
public unsafe uint PushVertexShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushVertexShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
public unsafe uint PushFragmentShaderUniforms<T>(
params T[] uniforms
) where T : unmanaged
{
fixed (T* ptr = &uniforms[0])
{
return Refresh.Refresh_PushFragmentShaderUniforms(
Device.Handle,
Handle,
(IntPtr) ptr,
(uint) (uniforms.Length * Marshal.SizeOf<T>())
);
}
}
}
}