mesa/src/panfrost/lib
Alyssa Rosenzweig e96292bc07 panfrost: Add decoupled early-ZS helpers
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>
2022-07-13 21:05:35 +00:00
..
genxml panfrost: Protect pandecode by a mutex 2022-07-13 19:15:13 +00:00
tests panfrost: Add 1x1 layout unit tests 2022-05-26 15:56:32 +00:00
.gitignore panfrost: Add panloader/ to .gitignore 2020-08-06 23:54:24 +00:00
meson.build panfrost: Add decoupled early-ZS helpers 2022-07-13 21:05:35 +00:00
pan_afbc.c panfrost: Pass arch instead of dev into afbc_format 2022-06-01 19:44:31 +00:00
pan_attributes.c panfrost: Move panfrost_vertex/instance_id to per-gen 2021-07-12 23:12:29 +00:00
pan_blend.c panfrost: Copy blend constant into variant even when reusing it 2022-05-20 23:17:07 +00:00
pan_blend.h panfrost: Increase the limit for blend shader variants 2022-05-20 23:17:07 +00:00
pan_blitter.c panfrost: Disable CRC at <16x16 tile sizes 2022-06-13 15:46:12 +00:00
pan_blitter.h panfrost: Move genxml related files to a subdir 2021-09-30 10:30:19 +00:00
pan_bo.c panfrost: Remove BO mapping from import 2022-04-10 01:51:04 +00:00
pan_bo.h panfrost: Stop using sparse_array for batch BOs 2022-06-14 23:44:02 +00:00
pan_clear.c panfrost: Move genxml related files to a subdir 2021-09-30 10:30:19 +00:00
pan_cs.c panfrost: Use implementation-specific tile size 2022-07-13 19:00:41 +00:00
pan_cs.h panfrost: Separate core ID range from core count 2022-07-08 01:14:55 +00:00
pan_device.h panfrost: Use implementation-specific tile size 2022-07-13 19:00:41 +00:00
pan_earlyzs.c panfrost: Add decoupled early-ZS helpers 2022-07-13 21:05:35 +00:00
pan_earlyzs.h panfrost: Add decoupled early-ZS helpers 2022-07-13 21:05:35 +00:00
pan_encoder.h panfrost: Separate core ID range from core count 2022-07-08 01:14:55 +00:00
pan_format.c panfrost: Handle stencil texturing on Valhall 2022-04-07 15:11:04 +00:00
pan_format.h panfrost: Add Valhall compressed formats 2022-03-30 17:29:12 +00:00
pan_indirect_dispatch.c panfrost: Remove is_64b assignments 2022-06-08 13:42:42 +00:00
pan_indirect_dispatch.h panfrost: Deduplicate indirect dispatch structs 2022-06-08 13:42:42 +00:00
pan_indirect_draw.c panfrost: Remove is_64b assignments 2022-06-08 13:42:42 +00:00
pan_indirect_draw.h panfrost: Move genxml related files to a subdir 2021-09-30 10:30:19 +00:00
pan_layout.c panfrost: Advertise 16x16 tiled AFBC 2022-05-26 15:56:32 +00:00
pan_pool.h panfrost: Move genxml related files to a subdir 2021-09-30 10:30:19 +00:00
pan_props.c panfrost: Use implementation-specific tile size 2022-07-13 19:00:41 +00:00
pan_samples.c panfrost: Label all BOs in userspace 2021-05-18 19:19:01 +00:00
pan_scoreboard.h panfrost: Handle Valhall IDVS in job_uses_tiling 2022-03-30 17:29:12 +00:00
pan_scratch.c panfrost: Separate core ID range from core count 2022-07-08 01:14:55 +00:00
pan_shader.c panfrost: Simplify sample_shading 2022-07-13 20:28:42 +00:00
pan_shader.h panfrost: Allow pixels using discard to be killed 2022-06-13 14:23:55 +00:00
pan_texture.c panfrost: Handle texturing from AFBC on Valhall 2022-06-01 19:44:31 +00:00
pan_texture.h panfrost: Add pan_afbc_compression_mode on Valhall 2022-06-01 19:44:31 +00:00
pan_tiler.c panfrost: Centralize our model list 2022-01-28 17:47:46 +00:00
pan_util.c panfrost: Centralize our model list 2022-01-28 17:47:46 +00:00
pan_util.h panfrost: Add PAN_MESA_DEBUG=dump option 2022-03-01 19:43:22 +00:00
wrap.h panfrost: Prepare pandecode to per-gen XML 2021-09-20 15:11:30 +02:00