mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
gallium: use hardcoded cliptest code for fixed planes
This commit is contained in:
parent
f2feb2e4c7
commit
0a79c65073
1 changed files with 12 additions and 1 deletions
|
|
@ -51,7 +51,18 @@ compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr)
|
|||
unsigned mask = 0;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < nr; i++) {
|
||||
/* Do the hardwired planes first:
|
||||
*/
|
||||
if (-clip[0] + clip[3] < 0) mask |= CLIP_RIGHT_BIT;
|
||||
if ( clip[0] + clip[3] < 0) mask |= CLIP_LEFT_BIT;
|
||||
if (-clip[1] + clip[3] < 0) mask |= CLIP_TOP_BIT;
|
||||
if ( clip[1] + clip[3] < 0) mask |= CLIP_BOTTOM_BIT;
|
||||
if (-clip[2] + clip[3] < 0) mask |= CLIP_FAR_BIT;
|
||||
if ( clip[2] + clip[3] < 0) mask |= CLIP_NEAR_BIT;
|
||||
|
||||
/* Followed by any remaining ones:
|
||||
*/
|
||||
for (i = 6; i < nr; i++) {
|
||||
if (dot4(clip, plane[i]) < 0)
|
||||
mask |= (1<<i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue