The MaskControl primitive.
This primitive will control the masking of the drawing area. Masking on the GPU is used to prevent drawing in certain areas of the screen. It can be used to create and use a sort of stencil buffer. When the mask is set to ForceSet
, the "stencil buffer" will be set to 1, and when it's set to FromSource
, it will be set to the value read from the source texel, knowing it is bit 15 of the texel or the CLUT used by the texture. Texture-less primitives will set the stencil buffer to 0 in this mode, effectively allowing subsequent drawings in the area. The mask can also be set to test the stencil buffer, and only draw if the stencil buffer is set to 0. The mechanism used here can be a little bit counter-intuitive compared with modern hardware, but it's the way the PS1 GPU works.