mesa/docs/gallium
Christian Gmeiner 9c972a61d5 gallium: Add pipe cap for masked clears and support stencil masking
Add a new PIPE_CAP_CLEAR_MASKED capability that allows drivers to
handle buffer clears with color and stencil masks directly, instead
of falling back to drawing a quad in Mesa.

This patch introduces several changes:

1. Add the new pipe cap PIPE_CAP_CLEAR_MASKED to pipe_defines.h and
   document it in the Gallium screen documentation.

2. Add color_clear_mask and stencil_clear_mask parameters to the
   pipe_context::clear() hook:
   - color_clear_mask (uint32_t): contains 4 color mask bits per draw buffer
     (max 8 buffers = 32 bits)
   - stencil_clear_mask (uint8_t): contains the stencil write mask (8 bits)

3. Update the state tracker to use the masked clear path when the
   driver supports it:
   - Pass ctx->Color.ColorMask for color buffer clears
   - Pass ctx->Stencil.WriteMask for stencil clears
   - Allow both color and stencil clears to avoid the quad path when
     masks are present and the driver advertises support

4. Update all existing driver clear() hooks to accept the new
   color_clear_mask and stencil_clear_mask parameter.

This optimization allows drivers that can efficiently handle masked
clears in hardware to do so, improving performance for applications
that frequently clear buffers with masks enabled.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31512>
2026-01-27 00:57:26 +00:00
..
cso gallium: remove polygon_offset_units_unscaled pipe cap 2025-05-26 17:01:03 +00:00
buffermapping.rst docs,src: replace doc and comments for PIPE_CAP with pipe_caps 2025-01-17 04:39:47 +00:00
context.rst docs/gallium: Clarify ordering requiremenets on fence_server_signal and fence_server_sync 2025-08-31 13:12:16 +00:00
cso.rst
debugging.rst docs: move generic gallium envvars to root doc 2022-11-15 11:25:05 +01:00
format.rst docs: apply some redirects 2022-11-10 17:26:19 +01:00
glossary.rst docs/gallium: move period out of quotes 2022-11-15 10:01:15 +00:00
index.rst docs: Drop distro unmaintained and deprecated file. 2025-04-19 15:52:12 +02:00
intro.rst
pipeline.txt
postprocess.rst docs: apply permanent redirect 2023-11-16 20:30:08 +00:00
resources.rst docs,src: replace doc and comments for PIPE_CAP with pipe_caps 2025-01-17 04:39:47 +00:00
screen.rst gallium: Add pipe cap for masked clears and support stencil masking 2026-01-27 00:57:26 +00:00
tgsi.rst tgsi: Drop TGSI_SEMANTIC_TESS_DEFAULT_OUTER/INNER_LEVEL 2025-08-13 13:55:01 +00:00