Skip to content

Commit

Permalink
GPU/SW: Remove polygon size checks from backend
Browse files Browse the repository at this point in the history
It's already checked before the draw is handed off.
  • Loading branch information
stenzek committed Dec 30, 2024
1 parent 4d4523d commit 3c5db39
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/core/gpu_sw_rasterizer.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1399,13 +1399,8 @@ static void DrawTriangle(const GPUBackendDrawCommand* RESTRICT cmd,
tl = tl >> 1;

// Invalid size early culling.
if (static_cast<u32>(std::abs(v2->x - v0->x)) >= MAX_PRIMITIVE_WIDTH ||
static_cast<u32>(std::abs(v2->x - v1->x)) >= MAX_PRIMITIVE_WIDTH ||
static_cast<u32>(std::abs(v1->x - v0->x)) >= MAX_PRIMITIVE_WIDTH ||
static_cast<u32>(v2->y - v0->y) >= MAX_PRIMITIVE_HEIGHT || v0->y == v2->y)
{
if (v0->y == v2->y)
return;
}

// Same as line rasterization, use higher precision for position.
static constexpr auto makefp_xy = [](s32 x) { return (static_cast<s64>(x) << 32) + ((1LL << 32) - (1 << 11)); };
Expand Down

0 comments on commit 3c5db39

Please sign in to comment.