Handle empty scissors correctly.

This commit is contained in:
Dario 2024-07-28 16:35:08 -03:00
parent c6e50be61a
commit 09f7ac21d0
2 changed files with 6 additions and 2 deletions

View File

@ -544,8 +544,8 @@ namespace RT64 {
const auto &triangles = drawCall.triangles;
assert(triangles.pipeline != nullptr);
// Draw calls can sometimes end up with empty viewports and cause validation errors. We just skip them.
if (triangles.viewport.isEmpty()) {
// Draw calls can sometimes end up with empty viewports or scissors and cause validation errors. We just skip them.
if (triangles.viewport.isEmpty() || triangles.scissor.isEmpty()) {
continue;
}

View File

@ -1485,6 +1485,10 @@ namespace RT64 {
bool operator!=(const RenderRect &v) const {
return (left != v.left) || (top != v.top) || (right != v.right) || (bottom != v.bottom);
}
bool isEmpty() const {
return (left >= right) || (top >= bottom);
}
};
struct RenderBox {