Added Vertexcount to GeometryBinding and made Indexbuffer optional

This commit is contained in:
Simon Lübeß
2021-08-25 22:39:11 +02:00
parent a8bef51834
commit 099763e1e3
3 changed files with 19 additions and 4 deletions
@@ -81,8 +81,9 @@ namespace GlitchyEngine.Renderer
context.nativeContext.InputAssembler.SetVertexBuffers(0, nativeBuffers.Count, &nativeBuffers, &bufferStrides, &bufferOffsets);
context.nativeContext.InputAssembler.SetInputLayout(_vertexLayout.nativeLayout);
context.nativeContext.InputAssembler.SetPrimitiveTopology((.)_primitiveTopology);
context.nativeContext.InputAssembler.SetIndexBuffer(_indexBuffer.nativeBuffer, _indexBuffer.Format == .Index32Bit ? .R32_UInt : .R16_UInt, _indexByteOffset);
if(_indexBuffer != null)
context.nativeContext.InputAssembler.SetIndexBuffer(_indexBuffer.nativeBuffer, _indexBuffer.Format == .Index32Bit ? .R32_UInt : .R16_UInt, _indexByteOffset);
}
public void Unbind(GraphicsContext context = null)