The Voodoo Graphics hardware maintains a set of five counters that collect statistics about the fate of pixels as they move through the pixel pipeline. Glide provides access to these counters through the GrSstPerfStats_tstructure and grSstPerfStats().
typedef struct GrSstPerfStats_s {
FxU32 pixelsIn; /* # pixels processed (minus buffer clears) */
FxU32 chromaFail; /* # pixels not drawn due to chroma key test failure */
FxU32 zFuncFail; /* # pixels not drawn due to depth test failure */
FxU32 aFuncFail; /* # pixels not drawn due to alpha test failure */
FxU32 pixelsOut; /* # pixels drawn (including buffer clears and LFB writes) */
} GrSstPerfStats_t;
void grSstPerfStats(GrSstPerfStats_t *pStats)
In order to account for every pixel counted and saved in pixelsOut, one must use the following equation:
pixelsOut = LfbWritePixels + bufferClearPixels + (pixelsIn – zFuncFail – chromaFail – aFuncFail)
bufferClearPixels represents the number of pixels written as a result of calls to grBufferClear() and can be calculated as:
bufferClearPixels = (# of times the buffer was cleared)* (clip window width) * (clip window height)
grSstPerfStats() does not wait for the system to be idle, and hence does not include statistics for commands that are still in the FIFO. Call grSstIdle() to empty the FIFO.
All five counters are reset whenever grSstResetPerfStats() is called. The hardware counters are only 24‑bits wide, so regular calls to grSstResetPerfStats() are required to avoid overflow. Alternatively, counter overflows can be detected and accounted for without calling grSstResetPerfStats().
void grSstResetPerfStats( void )