mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
with Y=0=top, front/back determination is negated
This commit is contained in:
parent
faa14a9ded
commit
c271078048
3 changed files with 5 additions and 5 deletions
|
|
@ -78,10 +78,10 @@ static void cull_tri( struct draw_stage *stage,
|
|||
header->det = ex * fy - ey * fx;
|
||||
|
||||
if (header->det != 0) {
|
||||
/* if (det > 0 then Z points toward camera and triangle is
|
||||
/* if (det < 0 then Z points toward camera and triangle is
|
||||
* counter-clockwise winding.
|
||||
*/
|
||||
GLuint winding = (header->det > 0) ? PIPE_WINDING_CCW : PIPE_WINDING_CW;
|
||||
GLuint winding = (header->det < 0) ? PIPE_WINDING_CCW : PIPE_WINDING_CW;
|
||||
|
||||
if ((winding & cull_stage(stage)->winding) == 0) {
|
||||
/* triangle is not culled, pass to next stage */
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ static void twoside_begin( struct draw_stage *stage )
|
|||
/*
|
||||
* We'll multiply the primitive's determinant by this sign to determine
|
||||
* if the triangle is back-facing (negative).
|
||||
* sign = 1 for CCW, -1 for CW
|
||||
* sign = -1 for CCW, +1 for CW
|
||||
*/
|
||||
twoside->sign = (stage->draw->setup.front_winding == PIPE_WINDING_CCW) ? 1 : -1;
|
||||
twoside->sign = (stage->draw->setup.front_winding == PIPE_WINDING_CCW) ? -1 : 1;
|
||||
|
||||
stage->next->begin( stage->next );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static void unfilled_tri( struct draw_stage *stage,
|
|||
struct prim_header *header )
|
||||
{
|
||||
struct unfilled_stage *unfilled = unfilled_stage(stage);
|
||||
GLuint mode = unfilled->mode[header->det > 0.0];
|
||||
GLuint mode = unfilled->mode[header->det < 0.0];
|
||||
|
||||
switch (mode) {
|
||||
case PIPE_POLYGON_MODE_FILL:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue