The operation of DrawPixels was described in section 3.6.3, except if the format argument was STENCIL_INDEX. In this case, all operations described for DrawPixels take place, but window coordinates, each with the corresponding stencil index, are produced in lieu of fragments. Each coordinate-stencil index pair is sent directly to the per-fragment operations, bypassing the texture, fog, and antialiasing application stages of rasterization. Each pair is then treated as a fragment for purposes of the pixel ownership and scissor tests; all other per-fragment operations are bypassed. Finally, each stencil index is written to its indicated location in the framebuffer, subject to the current setting of StencilMask .
The error INVALID_OPERATION results if there is no stencil buffer.