mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added basic support for instanced rendering
This commit is contained in:
@@ -2,6 +2,8 @@ using GlitchyEngine.Math;
|
||||
|
||||
namespace GlitchyEngine.Renderer
|
||||
{
|
||||
using internal GlitchyEngine.Renderer;
|
||||
|
||||
extension RendererAPI
|
||||
{
|
||||
private GraphicsContext _context;
|
||||
@@ -28,5 +30,10 @@ namespace GlitchyEngine.Renderer
|
||||
{
|
||||
_context.DrawIndexed(geometry.IndexCount, geometry.IndexByteOffset, 0);
|
||||
}
|
||||
|
||||
public override void DrawIndexedInstanced(GeometryBinding geometry)
|
||||
{
|
||||
_context.nativeContext.DrawIndexedInstanced(geometry.IndexCount, geometry.InstanceCount, geometry.IndexByteOffset, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace GlitchyEngine.Renderer
|
||||
Debug.Assert(input.Count == output.Count);
|
||||
|
||||
for(int i < input.Count)
|
||||
output[i] = .(input[i].SemanticName, input[i].SemanticIndex, input[i].Format, input[i].InputSlot, input[i].AlignedByteOffset, (.)input[i].InputSlotClass);
|
||||
output[i] = .(input[i].SemanticName, input[i].SemanticIndex, input[i].Format, input[i].InputSlot, input[i].AlignedByteOffset, (.)input[i].InputSlotClass, input[i].InstanceDataStepRate);
|
||||
}
|
||||
|
||||
protected override void CreateNativeLayout()
|
||||
|
||||
Reference in New Issue
Block a user