shithub: tinygl

Download patch

ref: bf72bd3e49c0b313115f1635b6c17dd2c21f1f05
parent: 68c95564fc32ef6ada2e7aed5afa7b25e353b9ad
author: David <gek@katherine>
date: Wed Feb 17 21:46:07 EST 2021

Yet another micro optimization that has more performance boost

--- a/src/clip.c
+++ b/src/clip.c
@@ -230,7 +230,7 @@
 static void gl_draw_triangle_clip(GLContext* c, GLVertex* p0, GLVertex* p1, GLVertex* p2, GLint clip_bit);
 
 void gl_draw_triangle(GLContext* c, GLVertex* p0, GLVertex* p1, GLVertex* p2) {
-	GLint co, c_and, cc[3], front;
+	GLint co, cc[3], front;
 	
 
 	cc[0] = p0->clip_code;
@@ -273,8 +273,8 @@
 			}
 		}
 	} else {
-		c_and = cc[0] & cc[1] & cc[2];
-		if (c_and == 0) { // Don't draw a triangle with no points
+		//GLint c_and = cc[0] & cc[1] & cc[2];
+		if ((cc[0] & cc[1] & cc[2]) == 0) { // Don't draw a triangle with no points
 			gl_draw_triangle_clip(c, p0, p1, p2, 0);
 		}
 	}