Skip to content

Commit

Permalink
GPU: Temporarily skip draws if they're too big instead of panicking
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat authored Aug 20, 2024
1 parent 2debced commit 471bdd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/PICA/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ 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<PICA::PrimType>(Helpers::getBits<8, 2>(primConfig));
if (vertexCount > Renderer::vertexBufferSize) Helpers::panic("[PICA] vertexCount > vertexBufferSize");
if (vertexCount > Renderer::vertexBufferSize) [[unlikely]] {
Helpers::warn("[PICA] vertexCount > vertexBufferSize");
return;
}

if ((primType == PICA::PrimType::TriangleList && vertexCount % 3) || (primType == PICA::PrimType::TriangleStrip && vertexCount < 3) ||
(primType == PICA::PrimType::TriangleFan && vertexCount < 3)) {
Expand Down

0 comments on commit 471bdd6

Please sign in to comment.