Commit graph

212322 commits

Author SHA1 Message Date
Simon Perretta
de4dd8e9ea pvr, pco: fragment shader metadata boilerplate code
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:11 +00:00
Simon Perretta
aa6af19da5 pco: temporarily aggressively prevent isp feedback reordering by opt passes
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:11 +00:00
Simon Perretta
07f0038974 pvr: temporarily dword align *all* descriptors
This isn't ideal, nor is it required for all descriptor types, but will
work for the time being.

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:11 +00:00
Jarred Davies
508f044d41 pvr: Disable PBE resolve on cores without gs_rta_support
On cores without gs_rta_support, PBE resolves might depend on writes
that occur within the deferred RTA clears that happen after the PBE
has written.
Since the driver can't know at renderpass creation whether RTA clears
are needed, PBE resolves must be disabled.

Fix for deqp-vk:
    dEQP-VK.api.image_clearing.*.clear_color_attachment.multiple_layers.*

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:11 +00:00
Luigi Santivetti
d68344bffe pvr: don't csb emit multi-layer clear attachments without rta support
Deferred clears are a way to turn clear operations into transfer operations.
One use of them is to account for multi-layer clears when the HW doesn't
support render targets array.

Fix for deqp:
  dEQP-VK.renderpass.dedicated_allocation.attachment_allocation*

Fixes: 9582058 ("pvr: Add deferred RTA clears for cores without gs_rta_support")

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:11 +00:00
Simon Perretta
4927d2274c pco: handle vector ra via parallel copy
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:11 +00:00
Simon Perretta
0019b5ccaf pvr, pco: dynamic buffer and immutable sampler 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:11 +00:00
Simon Perretta
58e437781b pco: add remaining texture buffer 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:11 +00:00
Simon Perretta
0962eec985 pco: basic image/texture cube 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:11 +00:00
Simon Perretta
a3b2510c24 pco: remap buffer samplers to be 2d
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:11 +00:00
Matt Coster
b83481e397 pvr: Use 2D texstate for buffer views to allow for >8k sizes
The maximum width of a texstate is 16k-1; use the highest power of two
(8k) as a fixed width and only adjust the height by the view size.

Signed-off-by: Matt Coster <matt.coster@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/36412>
2025-09-16 18:26:11 +00:00
Simon Perretta
1de2188cbf pco: experimentally pre-propagate vectors during regalloc
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:11 +00:00
Simon Perretta
ef55f836bc pvr: texture swizzle depth/stencil fix
With the currrent state of things when setting up the texture state
word we need to make sure the swizzle is obtained from a format
compatible with the TPU.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Co-authored-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:11 +00:00
Simon Perretta
231755f517 pvr, pco: add support for robust buffer access
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:11 +00:00
Simon Perretta
483bfbf8aa pco: temporarily prevent vectorization of vertex outputs
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:11 +00:00
Simon Perretta
9b595a50ba pvr, pco: clip/cull distance 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:11 +00:00
Simon Perretta
0b757da625 pco: skip comp-only opt on collated vecs
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:11 +00:00
Simon Perretta
0afe6e2254 pco: add helpers for finding non-empty blocks, apply
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:11 +00:00
Simon Perretta
b1aad71f35 pco: restrict regalloc debug printing
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:11 +00:00
Simon Perretta
d10b769130 pco: temporarily make vecs interfere with their components during regalloc
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:11 +00:00
Simon Perretta
ea917ae732 pco: add render target awareness to input attachments
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:11 +00:00
Simon Perretta
f4bc938a4d pco: support render target/layer id intrinsic
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:11 +00:00
Simon Perretta
78062fbb75 pvr, pco: improved image write (with format) support, handle 111110
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:11 +00:00
Simon Perretta
fe884e30f8 pvr, pco: image size query 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:11 +00:00
Simon Perretta
7369f77590 pvr, pco: z-replicate 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:11 +00:00
Simon Perretta
1b7954fae6 pvr: dynamically handle shademodel for flat shaded varyings
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:11 +00:00
Simon Perretta
0c7dc07c93 pvr, pco: add support for gl_FrontFacing
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:11 +00:00
Simon Perretta
5aac0f7917 pco: add pass to expand out vecs only used by comps
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:11 +00:00
Simon Perretta
ed652e10fc pco: force image/texture array coordinate f2i32 conversions to be rtne
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:11 +00:00
Simon Perretta
4d201a16f9 pvr: remove vertex position output assertion
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:11 +00:00
Simon Perretta
f71f8e1bc7 pco: temporarily treat already overridden refs as comps during regalloc
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:11 +00:00
Simon Perretta
195cb4bfce pco: support shader i/o arrays of structs
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:11 +00:00
Simon Perretta
d038d9181c pco: enable shrink vec opt
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:11 +00:00
Simon Perretta
383df775aa pco: add pass to split shader in/out struct/array vars across more slots
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:11 +00:00
Simon Perretta
53183be836 pvr: initial sample rate shading 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:10 +00:00
Simon Perretta
66e8886a68 pco: support indirect function temp refs
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:10 +00:00
Frank Binns
f1580acefb pvr: only share scratch buffers when they're the required size
When sharing scratch buffers across framebuffers, it reallocates the scratch
buffer to ensure the smallest scratch buffer is always in use. However, the
check to do this meant that it was possible to end up with a scratch buffer that
was too small, leading to page faults or memory corruption.

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:10 +00:00
Simon Perretta
cbf58fea6f pco: further commonize iteration instruction emission
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:10 +00:00
Simon Perretta
bd274e27be pco: support dce for vregs
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:10 +00:00
Luigi Santivetti
801215d03e pvr: fix logic for setting vdm instance count present
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:10 +00:00
Luigi Santivetti
5457e8a0e3 pvr: determine rt layers based on rta support
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:10 +00:00
Luigi Santivetti
5e1bd5e02d pvr: split out missing output register write handling into separate function
Factor this step out of pvr_render_pass_setup_load_ops() for keeping
the code more organised and easier to follow.

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:10 +00:00
Karmjit Mahil
1e4478ff98 pvr: Move renderpass load op setup into a separate function
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@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:10 +00:00
Luigi Santivetti
002eed7b8b pvr: rename pvr_{create,generate} to appear at the end
In preparation to add more helpers, rename some function to improve
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:10 +00:00
Karmjit Mahil
72923ee62f pvr: Remove shareds_dest_offset from load_op
The starting offset is always `0` and there isn't really a reason
for why it should be non-zero, we always want to DMA into the
shareds from the beginning, for the load_ops, so removing it.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@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:10 +00:00
Matt Coster
c23f81cd11 pvr: Cleanup compressed border colour support
To clear up the ambiguity of uncompressed/compressed formats:
  - Always use the correct enum type to refer to them, and
  - Split the border colour table into two halves so the compressed tex
    format enum can be used as an index directly without applying an
    offset.

Signed-off-by: Matt Coster <matt.coster@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:10 +00:00
Matt Coster
5fd65333c2 pvr: Add macros to iterate all supported tex formats
Signed-off-by: Matt Coster <matt.coster@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:10 +00:00
Matt Coster
d8121fa4a9 pvr: Add missing format adjustment for e5b9g9r9
Devices with the feature tpu_border_colour_enhanced don't require
e5b9g9r9 formats to be encoded and instead read the channels directly
as f16 values. Without this special handling, two channels were left
uninitialised, leading to random test failures.

Fixes: dEQP-VK.pipeline.monolithic.sampler.view_type.*
  .format.e5b9g9r9_ufloat_pack32.address_modes.*_clamp_to_border_*

Signed-off-by: Matt Coster <matt.coster@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:10 +00:00
Matt Coster
72aa576469 pvr: Fill in missing {u,s}norm equivalents for tex formats
Signed-off-by: Matt Coster <matt.coster@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:10 +00:00
Luigi Santivetti
baa27bcbe3 pvr: rename pvr tex format description variables for clarity
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:10 +00:00