Commit graph

303 commits

Author SHA1 Message Date
Erik Faye-Lund
afff4be21c pvr: encapsulate clear-state
Same story as the previous commit; this let's us store an architecture
specific structure inside an architecture agnostic structure.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38423>
2025-11-17 16:04:31 +00:00
Erik Faye-Lund
4490275332 pvr: rework pds_state array length logic
This attempts to avoid needing hwdefs in headers. It's not perfect, but
hopefully a step in the right direction.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38352>
2025-11-11 10:13:14 +01:00
Erik Faye-Lund
02b5e78f0d pvr: rename rogue_get_slc_cache_line_size
This isn't really rogue-specific, so let's rename it to not cause any
confusion.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38352>
2025-11-11 10:13:14 +01:00
Erik Faye-Lund
cf08978985 pvr: break out pvr_instance and pvr_physical_device
These files shouldn't not be per-arch, so break them out to their own
modules before we start making things multi-arch.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38352>
2025-11-11 10:13:11 +01:00
Alyssa Rosenzweig
17355f716b treewide: use UTIL_DYNARRAY_INIT
Instead of util_dynarray_init(&dynarray, NULL), just use
UTIL_DYNARRAY_INIT instead. This is more ergonomic.

Via Coccinelle patch:

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray = {0};
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray;
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(&(dynarray), NULL);
    +dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(dynarray, NULL);
    +(*dynarray) = UTIL_DYNARRAY_INIT;

Followed by sed:

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(&\(.*\), NULL)/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init( &\(.*\), NULL )/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(\(.*\), NULL)/*\1 = UTIL_DYNARRAY_INIT/g' \{} \;"

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38189>
2025-11-04 13:39:48 +00:00
Alyssa Rosenzweig
b824ef83ab util/dynarray: infer type in append
Most of the time, we can infer the type to append in
util_dynarray_append using __typeof__, which is standardized in C23 and
support in Jesse's MSMSVCV. This patch drops the type argument most of
the time, making util_dynarray a little more ergonomic to use.

This is done in four steps.

First, rename util_dynarray_append -> util_dynarray_append_typed

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_append(/util_dynarray_append_typed(/g' \{} \;"

Then, add a new append that infers the type. This is much more ergonomic
for what you want most of the time.

Next, use type-inferred append as much as possible, via Coccinelle
patch (plus manual fixup):

    @@
    expression dynarray, element;
    type type;
    @@

    -util_dynarray_append_typed(dynarray, type, element);
    +util_dynarray_append(dynarray, element);

Finally, hand fixup cases that Coccinelle missed or incorrectly
translated, of which there were several because we can't used the
untyped append with a literal (since the sizeof won't do what you want).

All four steps are squashed to produce a single patch changing every
util_dynarray_append call site in tree to either drop a type parameter
(if possible) or insert a _typed suffix (if we can't infer). As such,
the final patch is best reviewed by hand even though it was
tool-assisted.

No Long Linguine Meals were involved in the making of this patch.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38038>
2025-10-24 18:32:07 +00:00
Mel Henning
fafb81cd02 treewide: Use vk_collect_dependency_info_src_stages
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37961>
2025-10-22 19:22:17 +00:00
Erik Faye-Lund
84db809e0a pvr: kill off pvr_private.h
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
All useful bits has been moved elsewhere, so let's remove this
mega-header and replace it with more targeted includes instead.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:09 +00:00
Erik Faye-Lund
73a50e12cd pvr: break out descriptor sets to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:08 +00:00
Erik Faye-Lund
bedb90a67e pvr: break out pipelines to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:08 +00:00
Erik Faye-Lund
b51fac6212 pvr: break out queries to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:07 +00:00
Erik Faye-Lund
9d2478d353 pvr: break out cmd-buffer to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:07 +00:00
Erik Faye-Lund
8c043e651d pvr: break out render-pass to separate headers
To avoid some circular dependencies due to pvr_private.h, split out
pvr_framebuffer etc into their own header.

We often only need to peek into the framebuffer, so this seems like a
good idea anyway. We can reconsider this once dynamic rendering has
landed, and we know how much remains here.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:06 +00:00
Erik Faye-Lund
87193fc6ce pvr: break out buffer to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:06 +00:00
Erik Faye-Lund
e0d9effa7a pvr: break out image to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:05 +00:00
Erik Faye-Lund
0cf8839a3d pvr: break out instance/device to separate header
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
2025-10-02 05:34:05 +00:00
Simon Perretta
2a7ebf2ae0 nir/lower_alpha: extend to support dynamic a2c
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:53 +00:00
Simon Perretta
63c4ecfae0 pvr, pco: add remaining support for eds2 & 3
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:53 +00:00
James Fitzpatrick
17468aee4b pvr: add support for (EXT|KHR)_line_rasterization
Signed-off-by: James Fitzpatrick <james.fitzpatrick@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:52 +00:00
James Fitzpatrick
7e11ec20e4 pvr: update WClamp value to 1.0e-13f
Signed-off-by: James Fitzpatrick <james.fitzpatrick@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:52 +00:00
leonperianu
9ab273f5ab pvr: add support for VK_KHR_depth_stencil_resolve
This commit enables the VK_KHR_depth_stencil_resolve extension in the PVR
Vulkan driver. Only worth to note that this implementation is based on the
renderpass driver path and it will need a rework as part of the dynamic
rendering enablement.

Signed-off-by: leonperianu <leon.perianu@imgtec.com>
Co-authored-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Co-authored-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:51 +00:00
Luigi Santivetti
2c2fdac093 pvr: improve unemitted resolve attachments readability
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:51 +00:00
Peter Quayle
9d48088428 pvr: add view index support for vertex shaders
Signed-off-by: Peter Quayle <peter.quayle@imgtec.com>
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:46 +00:00
Peter Quayle
93c7f0f9c0 pvr: various multiview fixes
- Fix ds address offset for multiview.
- Fix multiview depth/stencil address by restoring it after every kick.
- Enable empty tile processing after first subpass for multiview.

Signed-off-by: Peter Quayle <peter.quayle@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:45 +00:00
Luigi Santivetti
a1002a6673 pvr: add initial driver support for VK_KHR_multiview
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:45 +00:00
Simon Perretta
7fdf3683bc pvr, pco: allow fs sample rate to be dynamically set
Sets up the PDS doutu sample rate as late as possible, utilises
covmask(1.0f) to detect whether the fragment shader is running in single
sampled mode or not in order to select registers that differ based on
the execution rate.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
2025-09-30 12:15:43 +00:00
Simon Perretta
b111b8a844 pvr, pco: implement prerequisites for sampleRateShading
- Implement load_interpolated_input and friends.
- Optimize load_barycentric_* cases that can be simplified.
- Initial support for non-standard sample locations.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37540>
2025-09-27 23:45:54 +01:00
Erik Faye-Lund
83a8df1b37 pvr: drop pointless PVR_FROM_HANDLE macro
All it does is call VK_FROM_HANDLE, let's just do that directly instead.

Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37554>
2025-09-26 08:15:58 +00:00
Simon Perretta
916d51bd06 pvr: merge legacy uscgen code into pvr_usc
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439>
2025-09-22 14:52:05 +01:00
Simon Perretta
6dd0a5ee2d pvr, pco: switch to clc query shaders
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439>
2025-09-22 14:52:04 +01:00
Christian Gmeiner
48be3799b3 imagination: Re-format using clang-format
No manual changes here, this is simply running
$ ninja -C build/ clang-format

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37222>
2025-09-17 10:05:18 +00:00
Frank Binns
0dc4bf1683 pvr: add support for VK_FORMAT_D32_SFLOAT_S8_UINT
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:30 +00:00
Frank Binns
6b00301c04 pvr: implement VK_EXT_depth_clip_enable
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:28 +00:00
Luigi Santivetti
65bc48c1c7 pvr: rename {init,setup} command buffer helpers
In preparation to add more helpers, improve function names consistency.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:26 +00:00
Luigi Santivetti
a94a73bb3d pvr: rename job field holding pds PR background objects
Make the naming consistent with the pbe partial render field and
with the pds pixel event partial render field.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:25 +00:00
Vlad Schiller
03f02a4655 pvr: Implement VK_KHR_imageless_framebuffer
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:24 +00:00
Iliyan Dinev
82a4c66635 pvr: re-emit ppp state update when ds depth bits are set
The driver needs to check for dynamic state depth writes and comparison flags,
as so to not miss re-emitting the ppp update from a dirty state.

Signed-off-by: Iliyan Dinev <iliyan.dinev@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:19 +00:00
Vlad Schiller
1d46696887 pvr: implement dynamically set vertex buffer strides
Co-Authored-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:19 +00:00
Simon Perretta
fc651f3a8c pvr, pco: implement VK_EXT_color_write_enable
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:19 +00:00
Simon Perretta
b77ebcf69c pvr, pco: implement alphaToOne feature
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:18 +00:00
Simon Perretta
33620688a7 pvr: add support for VK_EXT_provoking_vertex
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:16 +00:00
Luigi Santivetti
b461335f64 pvr: add support for VK_KHR_maintenance1
VK_KHR_maintenance1 is a collection of several tweaks and additions to the 1.0
version of the Vulkan spec, promoted to core in more recent versions.

This change exposes the extension and only adds what was missing from our
implementation, however the driver largely already had support for what is
required by this extension.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:13 +00:00
Simon Perretta
f27ff49e2b pvr, pco: temporary initial scratch memory support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Simon Perretta
e18e867efb pvr, pco: experimental temp spilling
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Luigi Santivetti
d905d0fca7 pvr: take zonlyrender into account when setting up ZLS control
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Jarred Davies
be2a8a9e4b pvr: Mark barrier load subcmd as not empty
Barrier loads must restore the content stored in the SPM scratch
buffer so it can be stored.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Jarred Davies
456fb3df11 pvr: Reduce number of stencil dependency barriers needed
Keep the aspectMask with the inpout attachments so the driver knows more
about stencil dependencies

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Simon Perretta
eb084cc823 pvr: select SPM EOT state words from render index
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Simon Perretta
a67120cda3 pvr, pco: full support for tile buffer eot handling
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00
Simon Perretta
12979f2ba7 pvr: handle num workgroups in indirect compute
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
2025-09-16 18:26:12 +00:00