swr: [rasterizer core] clamp scissor rects to current tile rect
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
This commit is contained in:
parent
93fb768c7e
commit
812b45d049
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <type_traits>
|
||||
#include <algorithm>
|
||||
#include "common/os.h"
|
||||
#include "common/simdintrin.h"
|
||||
#include "common/swr_assert.h"
|
||||
|
@ -95,6 +96,23 @@ OSALIGNLINE(struct) BBOX
|
|||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
BBOX& Intersect(const BBOX& other)
|
||||
{
|
||||
this->top = std::max(this->top, other.top);
|
||||
this->bottom = std::min(this->bottom, other.bottom);
|
||||
this->left = std::max(this->left, other.left);
|
||||
this->right = std::min(this->right, other.right);
|
||||
|
||||
if (right - left < 0 ||
|
||||
bottom - top < 0)
|
||||
{
|
||||
// Zero area
|
||||
top = bottom = left = right = 0;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
struct simdBBox
|
||||
|
|
Loading…
Reference in New Issue