Commit graph

7474 commits

Author SHA1 Message Date
Christian Gmeiner
fff1410c8a panvk: Use per-queue shader core count for CSF group creation
Extract VkDeviceQueueShaderCoreControlCreateInfoARM from the queue
create info pNext chain and use shaderCoreCount to limit
max_compute_cores and max_fragment_cores in the panthor group create
ioctl. The core masks remain unchanged, letting the kernel pick which
cores to schedule on.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40063>
2026-03-02 20:22:07 +00:00
Yiwei Zhang
69734bb903 pan/fb: fix return type for mali_to_glsl_dim
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: e3dc3dccd6 ("pan/fb: Add a common FB load shader builder")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40110>
2026-02-27 16:50:00 +00:00
Loïc Molinari
16c9cc9d08 panfrost: Fix -Wunused-but-set-variable warnings using ASSERTED
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39994>
2026-02-26 17:09:34 +00:00
Loïc Molinari
51c953cea0 panfrost: Fix -Wunused-variable warnings using ASSERTED
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39994>
2026-02-26 17:09:33 +00:00
Lars-Ivar Hesselberg Simonsen
9cea0fd973 pan: Move buffer functions to pan_buffer
These don't really fit in pan_texture anymore, so move them to a
separate pan_buffer-file.

Acked-by: Eric R. Smith <eric.smith@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39294>
2026-02-26 13:27:12 +00:00
Lars-Ivar Hesselberg Simonsen
448354e792 pan: Drop ASTC support for v5 texel buffers building
The function pan_emit_bview_surface_with_stride is only used by
pan_buffer_texture_emit, which cannot use ASTC compressed formats
(already disabled in the format list).

As well as dropping this functionality, also inline the static function
in its only caller.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39294>
2026-02-26 13:27:12 +00:00
Faith Ekstrand
01ba87a7fc panvk: Relax ms2ss afbc disablement
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:31 +00:00
Christoph Pillmayer
05326726a9 panvk: Don't create MS2SS views for internal views
We never use MS2SS from meta.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:31 +00:00
Faith Ekstrand
c015759629 pan/fb: Force pre-frame shaders to ALWAYS for clean tiles
If we set clean_tile_enable but don't also force-enable pre-frame
shaders, we have a problem.

Fixes: 6a56d35705 ("pan/fb: Fill out our own descriptors")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:31 +00:00
Faith Ekstrand
0c4f2aba51 pan/fb: Set clean_tile_write for mismatched superblock/tile sizes
Originally, I thought I could get away with not doing this because we
were sizing up the framebuffer boundary to include the superblocks.
However, that's not actually good enough because it's not just about
when we do a clear.  It's actually required for AFBC writes to work
properly with small tiles.

Fixes: 6a56d35705 ("pan/fb: Fill out our own descriptors")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:31 +00:00
Faith Ekstrand
2fcee05abf pan/fb: Figure out clean tile enables up-front
Fixes: 6a56d35705 ("pan/fb: Fill out our own descriptors")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:30 +00:00
Faith Ekstrand
deb8b5c9c7 panvk: Avoid direct MSAA resolves to AFBC on v6 and earlier
Fixes: b8de34da2b ("panvk: Use resolve shaders for color resolves")
Fixes: 46f611c932 ("panvk: Also use resolve shaders for Z/S")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:30 +00:00
Faith Ekstrand
98a6e6e7bb pan/fb: Set reverse_issue_order when needed
When the the tile size is not a multiple of a superblock for the given
render target, there's a potential race condition between the write at
the end of one tile and reads in some other tile where the reads may
access a superblock in a partially updated state.  If the tile size is a
multiple of a superblock, this shouldn't happen because no superblock is
ever used by more than one tile.  But for small tiles, this can happen.

The hardware provides us an escape hatch: the reverse_issue_order bit.
This bit comes with a bit of a performance cost but it's necessary to
ensure rendering correctness.

Fixes: 6a56d35705 ("pan/fb: Fill out our own descriptors")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:30 +00:00
Faith Ekstrand
655f7588de pan/desc: Pass emit_*_attachments args through a struct
Every time we need to adjust what goes to these helpers, it's a giant
pain because of all the function prototypes and the mode table.  Just
put everything in a struct and pass that around.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:29 +00:00
Faith Ekstrand
5093b3fe0a pan/fb: Improve depth format asserts
Fixes: e3dc3dccd6 ("pan/fb: Add a common FB load shader builder")
Fixes: 6a56d35705 ("pan/fb: Fill out our own descriptors")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
2026-02-26 11:15:29 +00:00
Erik Faye-Lund
745f69aa1e pan/ci: add a slow test to the skip-list
Just something I noticed while looking over test-results...

Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40090>
2026-02-25 21:58:38 +00:00
Erik Faye-Lund
f109f38881 pan/ci: update missed expectation
These changes to the nightly results were missed. We're now passing one
more test, and the trace renders ever so slightly differently. The
differences doesn't seem to suggest anything wrong, so let's just accept
the change.

Fixes: 399c0d22f3 ("panfrost: blending fixes for Midgard")
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40090>
2026-02-25 21:58:38 +00:00
Erik Faye-Lund
e111422f7f pan/ci: correct syntax for flakes
These shouldn't have the result at the end, silly me.

Fixes: 6eeede8a52 ("pan/ci: add missing t720-flakes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40065>
2026-02-24 15:02:17 +00:00
Christian Gmeiner
8dc8a2eec4 panvk: Support VK_EXT_legacy_dithering
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Wire up the existing Panfrost dithering infrastructure to the Vulkan
extension. The library already supports dithered formats via
pan_dithered_format_from_pipe_format(), so this plumbs the
VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT flag through to the blend
descriptor emission and color attachment internal conversion paths.

Dithering is only applied to color attachments, not depth or framebuffer
preloads.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39781>
2026-02-24 11:34:19 +00:00
Faith Ekstrand
e166027e52 pan/ci: Mark couple of WSI crashes as flakes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
I don't know why but these seem to fail only intermittantly now.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
1f51daf309 panvk: Optimize resolves if possible
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
22a98b2445 pan: Add a pan_format_supports_hw_blend() helper
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
46f611c932 panvk: Also use resolve shaders for Z/S
As a side-effect, we're now also respecting storeOp for separate Z/S.
For interleaved, we still always store because interleaved is annoyingly
complicated.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
b8de34da2b panvk: Use resolve shaders for color resolves
This massively improves the performance of the Sascha Willems
multisampling example:

 - With 2x MSAA: 590 -> 2605 (4.4x speedup)
 - With 4x MSAA: 347 -> 2570 (7.4x speedup)
 - With 8x MSAA: 188 FPS -> 2494 FPS (13.2x speedup)
 - With 16x MSAA: 96.7 FPS -> 2483 FPS (25.7x speedup)

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
0d78b72f91 panvk: Respect storeOp for color attachments
The new framebuffer code properly handles attachments without a store
and the incremental rendering code doesn't rely on the store, either, so
we don't need to always store.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:17 +00:00
Faith Ekstrand
82ee60d375 panvk/frame_shaders: Add support for resolve shaders
This is mostly a matter of reworking the frame shader code to pull image
views from a temp struct instead of always reaching for the pan_fb_load.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:16 +00:00
Faith Ekstrand
d598424f80 panvk/frame_shaders: Only allow preload shaders to be killed
We already have this check for the JM back-end but the CSF back-end
based the choice on whether or not the shader is writing color which
isn't quite what we want.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:16 +00:00
Faith Ekstrand
72fb84c213 panvk/frame_shaders: Set modes in cmd_preload_*_attachments()
This makes cmd_emit_dcd() about actually emitting the DCD and moves the
bit that's operation-specific to the operation-specific function.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:16 +00:00
Faith Ekstrand
3fd9071070 panvk/frame_shaders: Set no_shader_depth/stencil_read
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:16 +00:00
Faith Ekstrand
ae2fc52cfd panvk: Move cmd_fb_preload to cmd_frame_shaders
Also rename some stuff internally to stop using the word "preload".

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:16 +00:00
Faith Ekstrand
aacbfc9da2 panvk: Always set pan_fb_layout.rt_count to at least 1
Instead of having the pan_fb code have to `max(rt_count, 1)` add then
constantly be doing the same in the driver, just make the condition an
assert and do the `max(colorAttachmentCount, 1)` up-front.  This way
we're not constantly worried if everyone has the same count or not.  The
pan_fb code will handle having an empty render target just fine.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
fee3c420b3 panvk/meta: Set color_attachment_count based on bound attachments
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
1b2fe6831a pan/fb: Add a concept of resolve ops and resolve shaders
The resolve sits between the render pass and the write at the end.  This
adds the resolve ops themselves, support in the shader builder for
building the post-frame shaders to handle them, and an optimization pass
that attempts to fold the resolve op into the store and potentially
eliminate the post-frame shader.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
d777656b97 pan/fb: Add an option to only write sample0 of a render target
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
0ffb5c3425 pan/fb: Add new shader ops for copying from RTs
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
23b5d40052 pan/fb: Separate MSAA ops into in_bounds and border
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
90abb2d94d pan/fb: Add support for more MSAA modes in shaders
This commit both adds a couple more MSAA modes and adds support for them
in shaders.  While resolving an image into a framebuffer isn't that
interesting, most of the code to do it will be reused for resolving
render targets, which we do want.  The refactor is also nice.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
e26dc4c613 pan/fb: Refactor load shader building
This generalizes the shader building code at the cost of an additional
level of abstraction through the pan_fb_shader_op enum.  This will let
us share code between load and resolve shaders while keeping the client
interfaces to both of those clean and idiomatic.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
6a56d35705 pan/fb: Fill out our own descriptors
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
eb2a1063c1 pan/genxml: Make sections more typesafe
Right now, we have this concept of sections where one packet can be
broken up into multiple sub-packets.  Currently, we handle ths by every
packet's `_packed` struct is just an array of `uint32_t` and we do
pointer math and cast to get at the subset of the `uint32_t` array
belonging to the given section.  This works okay if we're operating on
`void *` but it blows up on strict aliasing rules if we're ever trying
to pack sections into a `struct foo_packed` on the stack.

To work around this, make it so that anything with sections emits
something like this:

    struct foo_packed {
       union {
          uint32_t packed[N];
          struct {
             struct foo_sec1_packed sec1;
             struct foo_sec2_packed sec2;
          };
       };
    };

This is entirely safe because C allows unions and structs to overlap as
long as the members that have the same base type end up on top of each
other.  Since everything is a `uint32_t` internally, this is safe
according to the C pointer rules.  And now that everything is a
substruct, everything is nicely named and we can easily get to sections
without pointer magic.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
85e312cffa pan/desc: Set Z/S MSAA averaging mode in common code
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:15 +00:00
Faith Ekstrand
cb2651fead pan/desc: Drop cbuf_offset from emit_*_color_attachment()
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:14 +00:00
Faith Ekstrand
13448fd3aa pan/desc: Pass image views directly to attachment helpers
Now that we're doing a merge to fill out the various enable bits, we
don't actually need the pan_fb_info in the attachment helpers.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:14 +00:00
Faith Ekstrand
7d12f11c84 panvk: Use partial FB preloads to deal with alignments
Previously, when we had an unaligned render area, we would flush to
force a full FB load and then clear the render area manually after
loading.  This means we're doing a full FB load and then throwing most
of that data away.

The new FB load shaders, however, are capable of doing partial loads,
with the inside of the render area loaded or cleared as we wish and the
border pixels loaded.  This way we can handle partial clears directly in
the load shaders instead of having to do this dance.  This should
improve perf whenever a non-trivial render area is used.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:14 +00:00
Faith Ekstrand
44ff0c4707 panvk: Also load output attachments with LOAD_OP_NONE+STORE_OP_NONE
We already had this for LOAD_OP_DONT_CARE but we also need it for
LOAD_OP_NONE.

Cc: mesa-stable
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:13 +00:00
Faith Ekstrand
b0b6ca0035 panvk: Insert a pipeline barrier if we have any FB loads
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:13 +00:00
Faith Ekstrand
e2e1c3b8b7 panvk/jm: Rework load/store/spill
The current code looks a lot like how you might do this in GL.  We start
off with the load, which might be loads or clears.  Then, after the
first flush, we replace that with the spill load.  This doesn't really
fit the load/spill/store that the new pan_fb code wants.

Instead, this commit add a couple of separate tracker bits to keep track
of whether or not we've loaded yet and whether or not we're in the final
EndRendering and want to do the "real" store.  This allows us to track
where we are in the render pass and do the right load/spill/store
operations.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:13 +00:00
Faith Ekstrand
962d1f33e1 panvk/jm: Refactor BeginRendering()
The old code was all out of order and made no sense.  There's a reason
it made no sense. It was wrong.  Cleaning this up fixes a solid 1/3 of
the remaining Bifrost CTS fails in CI.

Cc: mesa-stable
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:13 +00:00
Faith Ekstrand
df98b6e3b2 panvk: Drop pan_fb_info
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:12 +00:00
Faith Ekstrand
779d88dc54 panvk: Use pan_fb_load to decide when we have a clear
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39759>
2026-02-23 21:00:12 +00:00