Optimize CommandBuffer (#35)
- remove params methods in favor of overloads and last-resort `in Span<T>` overloads - add `in` to params that take structs to reduce unnecessary copying - Buffer can now implicitly cast to BufferBinding - add render pass / graphics pipeline format match validation Reviewed-on: #35pull/36/head
parent
970517c3c2
commit
ecf1a8ed55
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using RefreshCS;
|
using RefreshCS;
|
||||||
|
|
||||||
namespace MoonWorks.Graphics
|
namespace MoonWorks.Graphics
|
||||||
|
@ -78,5 +77,10 @@ namespace MoonWorks.Graphics
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator BufferBinding(Buffer b)
|
||||||
|
{
|
||||||
|
return new BufferBinding(b, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,11 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public GraphicsShaderInfo VertexShaderInfo { get; }
|
public GraphicsShaderInfo VertexShaderInfo { get; }
|
||||||
public GraphicsShaderInfo FragmentShaderInfo { get; }
|
public GraphicsShaderInfo FragmentShaderInfo { get; }
|
||||||
internal SampleCount SampleCount { get; }
|
public SampleCount SampleCount { get; }
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
internal GraphicsPipelineAttachmentInfo AttachmentInfo { get; }
|
||||||
|
#endif
|
||||||
|
|
||||||
public unsafe GraphicsPipeline(
|
public unsafe GraphicsPipeline(
|
||||||
GraphicsDevice device,
|
GraphicsDevice device,
|
||||||
|
@ -113,6 +117,10 @@ namespace MoonWorks.Graphics
|
||||||
VertexShaderInfo = vertexShaderInfo;
|
VertexShaderInfo = vertexShaderInfo;
|
||||||
FragmentShaderInfo = fragmentShaderInfo;
|
FragmentShaderInfo = fragmentShaderInfo;
|
||||||
SampleCount = multisampleState.MultisampleCount;
|
SampleCount = multisampleState.MultisampleCount;
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
AttachmentInfo = attachmentInfo;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue