From 66d71f817c91c22bcf822667a4986fcb51e6b490 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:37:46 +0300 Subject: [PATCH] Fix triangle fans --- src/core/PICA/gpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PICA/gpu.cpp b/src/core/PICA/gpu.cpp index 9be28bde..9ee574a8 100644 --- a/src/core/PICA/gpu.cpp +++ b/src/core/PICA/gpu.cpp @@ -111,11 +111,11 @@ void GPU::drawArrays() { // Configures the type of primitive and the number of vertex shader outputs const u32 primConfig = regs[PICA::InternalRegs::PrimitiveConfig]; const PICA::PrimType primType = static_cast(Helpers::getBits<8, 2>(primConfig)); - if (primType == PICA::PrimType::TriangleFan) Helpers::panic("[PICA] Tried to draw unimplemented shape %d\n", primType); if (vertexCount > Renderer::vertexBufferSize) Helpers::panic("[PICA] vertexCount > vertexBufferSize"); if ((primType == PICA::PrimType::TriangleList && vertexCount % 3) || - (primType == PICA::PrimType::TriangleStrip && vertexCount < 3)) { + (primType == PICA::PrimType::TriangleStrip && vertexCount < 3) || + (primType == PICA::PrimType::TriangleFan && vertexCount < 3)) { Helpers::panic("Invalid vertex count for primitive. Type: %d, vert count: %d\n", primType, vertexCount); }