mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-23 21:38:18 +02:00
We already lower discard in NIR when depth/stencil writes are used in the shader. In this patch, we extend that lowering for when depth/stencil writes are not used, in which case the discard is lowered to a sample_mask instruction. This is a step towards multisampling, since the old lowering assumed single-sample and there's no way to express a sample mask with a standard NIR discard instructions so we need to lower in NIR anyway for sample shading (i.e. if a discard_if diverges between samples in a pixel). This changes the lowering for discard_if to be free of control flow (instead executing a sample mask instruction unconditionally). This seems to be slightly faster in SuperTuxKart and slightly slower in Dolphin, but I'm not too worried right now. To make this work, we do need some extra lowering to ensure we always execute a sample_mask instruction, in case a discard_if is buried in other control flow (as occurs with Dolphin's ubershaders). So that's added too. We need that for MSAA anyway, so pardon the line count. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480> |
||
|---|---|---|
| .. | ||
| test | ||
| agx_builder.h.py | ||
| agx_compile.c | ||
| agx_compile.h | ||
| agx_compiler.h | ||
| agx_dce.c | ||
| agx_debug.h | ||
| agx_insert_waits.c | ||
| agx_internal_formats.h | ||
| agx_ir.c | ||
| agx_liveness.c | ||
| agx_lower_64bit.c | ||
| agx_lower_parallel_copy.c | ||
| agx_lower_pseudo.c | ||
| agx_lower_uniform_sources.c | ||
| agx_minifloat.h | ||
| agx_nir.h | ||
| agx_nir_algebraic.py | ||
| agx_nir_lower_address.c | ||
| agx_nir_lower_discard_zs_emit.c | ||
| agx_nir_lower_frag_sidefx.c | ||
| agx_nir_lower_load_mask.c | ||
| agx_nir_lower_sample_mask.c | ||
| agx_nir_lower_shared_bitsize.c | ||
| agx_nir_lower_texture.c | ||
| agx_nir_lower_ubo.c | ||
| agx_nir_opt_preamble.c | ||
| agx_opcodes.c.py | ||
| agx_opcodes.h.py | ||
| agx_opcodes.py | ||
| agx_opt_cse.c | ||
| agx_optimizer.c | ||
| agx_pack.c | ||
| agx_performance.c | ||
| agx_print.c | ||
| agx_register_allocate.c | ||
| agx_validate.c | ||
| meson.build | ||