mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-21 08:58:10 +02:00
Bifrost (and Valhall) separate early-ZS configuration into two fields: when does the depth/stencil buffer update happen? and when are pixels killed by the depth/stencil tests? The driver separately configures these to occur early (before the shader executes) or late (after the ATEST instruction executes at the end of the shader). Early tests are generally more efficient, but various combinations of API state and fragment shader properties can require late updates and/or late kills for correctness. Determining how to configure these fields is nontrivial. Our current implementation (on Bifrost) configures these fields at fragment shader compile time and bakes the settings into the RSD. This is both wrong (using early testing when late testing is required) and suboptimal (using late testing when early testing would suffice). We need to defer this configuration until draw time, when we know rasterizer and Z/S state. Reclassifying at draw time (as we currently do on Valhall) would be expensive, especially with the extra terms added in here. To cope, decouple the shader classification from the draw-time configuration. Since there are only a few bits of draw state involved, this implementation just calculates all possible states. Then the draw time classification is just indexing into a lookup table. The actual algorithm used to classify is written with correctness and clarity in mind. Unlike the current classification algorithm (which tries to match what the DDK does, poorly), this algorithm embeds its proofs of correctness. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428> |
||
|---|---|---|
| .. | ||
| genxml | ||
| tests | ||
| .gitignore | ||
| meson.build | ||
| pan_afbc.c | ||
| pan_attributes.c | ||
| pan_blend.c | ||
| pan_blend.h | ||
| pan_blitter.c | ||
| pan_blitter.h | ||
| pan_bo.c | ||
| pan_bo.h | ||
| pan_clear.c | ||
| pan_cs.c | ||
| pan_cs.h | ||
| pan_device.h | ||
| pan_earlyzs.c | ||
| pan_earlyzs.h | ||
| pan_encoder.h | ||
| pan_format.c | ||
| pan_format.h | ||
| pan_indirect_dispatch.c | ||
| pan_indirect_dispatch.h | ||
| pan_indirect_draw.c | ||
| pan_indirect_draw.h | ||
| pan_layout.c | ||
| pan_pool.h | ||
| pan_props.c | ||
| pan_samples.c | ||
| pan_scoreboard.h | ||
| pan_scratch.c | ||
| pan_shader.c | ||
| pan_shader.h | ||
| pan_texture.c | ||
| pan_texture.h | ||
| pan_tiler.c | ||
| pan_util.c | ||
| pan_util.h | ||
| wrap.h | ||