mesa/src
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
..
amd radeonsi/vcn: Add low latency decode debug option 2026-01-26 15:00:06 +00:00
android_stub android_stub: fix missing prototypes issues 2025-12-02 20:03:02 +00:00
asahi asahi/clc: call nir_opt_remove_phis after nir_opt_loop 2026-01-26 12:02:49 +00:00
broadcom broadcom/ci: remove duplicate entries 2026-01-23 10:44:30 +00:00
c11 c11/threads: fix build on c23 2025-11-10 07:01:50 +10:00
compiler nir: add cmat call to propogate invariants 2026-01-26 22:39:40 +00:00
drm-shim drm-shim: handle DRM_CAP_ADDFB2_MODIFIERS 2025-11-24 12:34:08 +00:00
egl egl/surfaceless,device: Support RGB[A]16_UNORM formats for pbuffers. 2026-01-21 12:29:03 +00:00
etnaviv etnaviv/ci: Add gitlab-ci-inc.yml to file list 2026-01-19 20:46:38 +00:00
freedreno tu: Implement bin skipping for zero-density regions 2026-01-26 18:58:25 +00:00
gallium gallium: Add pipe cap for masked clears and support stencil masking 2026-01-27 00:57:26 +00:00
gbm gbm: Make documentation for gbm_bo_map more explicit 2025-12-29 10:05:38 +00:00
getopt
gfxstream gfxstream: fix build after vk.xml update 2026-01-26 18:25:51 +00:00
glx driconf: add a way to override GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 2025-12-17 23:35:24 +00:00
gtest
imagination pvr/ci: document last night's flakes 2026-01-23 19:37:20 +00:00
imgui imgui: Silence build warnings for imgui 2025-09-16 06:16:19 +00:00
intel brw: hoist fsat lower OOTL 2026-01-26 23:24:49 +00:00
kosmickrisp kk: Use pipeline_layout.dynamic_descriptor_offset 2026-01-22 17:04:19 +00:00
loader loader: fix UB in wayland helper code. 2026-01-03 07:56:38 +00:00
mesa gallium: Add pipe cap for masked clears and support stencil masking 2026-01-27 00:57:26 +00:00
microsoft vk: descriptors: sort bindings along with flags 2026-01-20 15:55:47 +00:00
nouveau nvk: Ignore meta ops in occlusion queries 2026-01-26 18:41:54 +00:00
panfrost panfrost/clc: call nir_opt_remove_phis after nir_opt_loop 2026-01-26 12:02:49 +00:00
poly panvk/csf: implement VK_EXT_primitives_generated_query primitive restart 2026-01-21 09:03:34 +00:00
tool pps/meson: minor refactor for pps_deps 2025-11-08 18:39:00 -08:00
util util: add BITSET_LINEAR_ZALLOC 2026-01-26 20:15:43 +00:00
virtio venus: refactor Android ANB tracking to avoid confusions with WSI 2026-01-21 23:15:42 +00:00
vulkan lavapipe: add NV_cooperative_matrix2 reductions support 2026-01-26 22:39:40 +00:00
x11 treewide: strip unneeded inc_gallium inc_gallium_aux 2025-11-13 22:01:43 +00:00
.clang-format util: Add sparse bitset data structure 2025-11-06 21:34:33 +00:00
meson.build kk: Add KosmicKrisp 2025-10-20 17:46:38 +00:00