Use std::span to pass vertex data

Starts utilizing
[std::span](https://en.cppreference.com/w/cpp/container/span) to
indicate a non-owning view of a contiguous array of elements rather than
`T* data, usize count`.
This commit is contained in:
Wunkolo
2023-06-16 07:28:35 -07:00
parent c6f5d19983
commit 553d23974a
5 changed files with 32 additions and 24 deletions

View File

@@ -157,7 +157,7 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
// If we've reached 3 verts, issue a draw call
// Handle rendering depending on the primitive type
if (immediateModeVertIndex == 3) {
renderer.drawVertices(OpenGL::Triangle, &immediateModeVertices[0], 3);
renderer.drawVertices(OpenGL::Triangle, immediateModeVertices);
switch (primType) {
// Triangle or geometry primitive. Draw a triangle and discard all vertices