text: // Copyright © Amer Koleci and Contributors.
  // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
  
  #include "Renderer/Geometry.h"
  #include "Graphics/CommandBuffer.h"
  
  namespace Alimer
  {
      void Geometry::Draw(RenderPassEncoder* passEncoder, uint32_t instanceCount, uint32_t baseInstance)
      {
          for (size_t i = 0, count = vertexBuffers.size(); i < count; ++i)
          {
              passEncoder->SetVertexBuffer((uint32_t)i, vertexBuffers[i].buffer.Get(), vertexBuffers[i].offset);
          }
  
          if (indexBuffer.buffer.IsNotNull())
          {
              passEncoder->SetIndexBuffer(indexBuffer.buffer.Get(), indexBuffer.offset, indexBuffer.indexType);
              passEncoder->DrawIndexed(drawCount, instanceCount, drawStart, 0, baseInstance);
          }
          else
          {
              passEncoder->Draw(drawCount, instanceCount, drawStart, baseInstance);
          }
      }
  }
  