2022-03-02 21:57:30 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace MoonWorks.Graphics
|
2021-01-20 03:33:27 +00:00
|
|
|
|
{
|
2022-02-23 05:14:32 +00:00
|
|
|
|
/// <summary>
|
2022-03-02 19:42:26 +00:00
|
|
|
|
/// Information that the pipeline needs about a shader.
|
2022-02-23 05:14:32 +00:00
|
|
|
|
/// </summary>
|
2022-03-02 19:42:26 +00:00
|
|
|
|
public struct GraphicsShaderInfo
|
2022-02-23 05:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
public ShaderModule ShaderModule;
|
|
|
|
|
public string EntryPointName;
|
|
|
|
|
public uint UniformBufferSize;
|
2022-03-02 19:42:26 +00:00
|
|
|
|
public uint SamplerBindingCount;
|
2022-03-02 21:57:30 +00:00
|
|
|
|
|
|
|
|
|
public static GraphicsShaderInfo Create<T>(
|
|
|
|
|
ShaderModule shaderModule,
|
|
|
|
|
string entryPointName,
|
|
|
|
|
uint samplerBindingCount
|
|
|
|
|
) where T : unmanaged
|
|
|
|
|
{
|
|
|
|
|
return new GraphicsShaderInfo
|
|
|
|
|
{
|
|
|
|
|
ShaderModule = shaderModule,
|
|
|
|
|
EntryPointName = entryPointName,
|
|
|
|
|
UniformBufferSize = (uint) Marshal.SizeOf<T>(),
|
|
|
|
|
SamplerBindingCount = samplerBindingCount
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static GraphicsShaderInfo Create(
|
|
|
|
|
ShaderModule shaderModule,
|
|
|
|
|
string entryPointName,
|
|
|
|
|
uint samplerBindingCount
|
|
|
|
|
) {
|
|
|
|
|
return new GraphicsShaderInfo
|
|
|
|
|
{
|
|
|
|
|
ShaderModule = shaderModule,
|
|
|
|
|
EntryPointName = entryPointName,
|
|
|
|
|
UniformBufferSize = 0,
|
|
|
|
|
SamplerBindingCount = samplerBindingCount
|
|
|
|
|
};
|
|
|
|
|
}
|
2022-02-23 05:14:32 +00:00
|
|
|
|
}
|
2021-01-20 03:33:27 +00:00
|
|
|
|
}
|