PDA

View Full Version : is there an early stencil test?



Keith Z. Leonard
09-24-2009, 10:05 PM
Any of you IHV guys have thoughts on how fast a stencil test with GL_EQUAL is now-a-days? Is it possible to leverage this test to save on fragment processing? Obviously in the GL spec it happens post fragment, but is there an early stencil like there is an early Z?

Thanks,

sqrt[-1]
09-25-2009, 06:37 AM
Humus was playing around with using early stencil with D3D a few years ago (2004)
http://www.humus.name/index.php?page=3D&ID=50

Although I suggested using an incrementing stencil reference value other than clearing the buffer between lights:
http://www.humus.name/index.php?page=Comments&ID=117&start=24

I assume it is supported in most Nvidia/ATI hardware now, but if the limitations still exist for Nvidia I don't know. (Nvidia did not have early stencil if you updated the stencil while stencil testing)

AlexN
09-27-2009, 08:17 PM
Your best bet is to use GL_EQUAL and disable stencil updates. I've seen speed improvements of some form or another from this all the way back to the 9800 Pro... though it may be even more effective on more recent cards.

Pierre Boudier
11-20-2009, 09:13 AM
hi,

all HW from AMD (previously ATI) has had early stencil test since r3xx. it has similar in general the same limitation to the early depth test. (i.e., alpha test, texkill, chroma key, depth output can disable it)

regards,

Pierre B.
AMD Fellow