浏览代码

early-out big invisible polys

David Rose 17 年之前
父节点
当前提交
2459a7ddfc
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      panda/src/tinydisplay/ztriangle_two.h

+ 8 - 0
panda/src/tinydisplay/ztriangle_two.h

@@ -178,6 +178,10 @@ static void FNAME(flat_textured) (ZBuffer *zb,
 
 #define DRAW_INIT()				\
   {						\
+    if (p2->a == 0 && !ACMP(zb, p2->a)) {       \
+      /* This alpha is zero, and we'll never get other than 0. */       \
+      return;                                   \
+    }                                           \
     texture_levels = zb->current_texture;       \
     or0 = p2->r;                                \
     og0 = p2->g;                                \
@@ -429,6 +433,10 @@ static void FNAME(flat_perspective) (ZBuffer *zb,
 
 #define DRAW_INIT() 				\
   {						\
+    if (p2->a == 0 && !ACMP(zb, p2->a)) {       \
+      /* This alpha is zero, and we'll never get other than 0. */       \
+      return;                                   \
+    }                                           \
     texture_levels = zb->current_texture;       \
     fdzdx=(float)dzdx;                          \
     fndzdx=NB_INTERP * fdzdx;                   \