Commit graph

275 commits

Author SHA1 Message Date
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
Iliyan Dinev
672f738e39 pvr: add support for VK_FORMAT_X8_D24_UNORM_PACK32
Fixes many test cases, including:
  dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth_component24
  dEQP-GLES3.functional.fbo.render.shared_depth_stencil.tex2d_rgba8_depth_tex2d_depth_component24

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:11 +00:00
Simon Perretta
66d5815919 pvr: dynamic depth bias 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
297a0c269a pvr, pco: tile 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
c31e0a7159 pvr, pco: additional multisample 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
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
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
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
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
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
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
Ashish Chauhan
4873903b56 pvr: Enable PDS_DDMADT
Signed-off-by: Ashish Chauhan <Ashish.Chauhan@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
5c420c940a pvr: fix spm-related renderpass hwr
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
Simon Perretta
21561f9718 pvr: drop legacy rogue compiler
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
0ff8f57392 pvr, pco: simple end-of-tile/render nir shader gen
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
ba9b6f2d57 pvr, pco: temporarily add legacy loadop shader gen 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:10 +00:00
Simon Perretta
8afde5ec19 pvr, pco: add input attachment sampler and initial 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:09 +00:00
SoroushIMG
e12826da71 pvr: fix color values and crash for soft bg load ops
Seen in dEQP-VK.renderpass.suballocation.formats.d16_unorm.input.clear.store.clear
and dEQP-VK.renderpass.suballocation.formats.d16_unorm.input.clear.dont_care.clear

Signed-off-by: SoroushIMG <soroush.kashani@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:09 +00:00
SoroushIMG
fe283032bf pvr: remove unnecessary asserts
"Soft" renderpass start clears are already handled in pvr_clear_attachments_render_init.
The other assert is completely unnecessary and the case of undefined usage is in fact valid.
It means the depth has been partially cleared.

Signed-off-by: SoroushIMG <soroush.kashani@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:09 +00:00
Simon Perretta
b930b13372 pvr, pco: point 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:09 +00:00
Simon Perretta
20a08139ec pvr: enable logicOp 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:09 +00:00
Simon Perretta
992ade9e76 pvr, pco: initial support for blend constants
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:09 +00:00
Simon Perretta
7d9b7ee485 pvr, pco: temporarily add supporting code for VK_KHR_zero_initialize_workgroup_memory
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:09 +00:00
Simon Perretta
61d5240850 pvr: temporarily tweak support required for query programs
This enables the legacy query program implementation to function with
the updated descriptor set code, until it is replaced with NIR/uscgen.

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:09 +00:00
Simon Perretta
fd31165c38 pco, pvr: push constants 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:08 +00:00
Simon Perretta
4f79bc2e30 pvr, pco: add base compute 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:08 +00:00
Antonio Ospite
ddf2aa3a4d build: avoid redefining unreachable() which is standard in C23
In the C23 standard unreachable() is now a predefined function-like
macro in <stddef.h>

See https://android.googlesource.com/platform/bionic/+/HEAD/docs/c23.md#is-now-a-predefined-function_like-macro-in

And this causes build errors when building for C23:

-----------------------------------------------------------------------
In file included from ../src/util/log.h:30,
                 from ../src/util/log.c:30:
../src/util/macros.h:123:9: warning: "unreachable" redefined
  123 | #define unreachable(str)    \
      |         ^~~~~~~~~~~
In file included from ../src/util/macros.h:31:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:456:9: note: this is the location of the previous definition
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
-----------------------------------------------------------------------

So don't redefine it with the same name, but use the name UNREACHABLE()
to also signify it's a macro.

Using a different name also makes sense because the behavior of the
macro was extending the one of __builtin_unreachable() anyway, and it
also had a different signature, accepting one argument, compared to the
standard unreachable() with no arguments.

This change improves the chances of building mesa with the C23 standard,
which for instance is the default in recent AOSP versions.

All the instances of the macro, including the definition, were updated
with the following command line:

  git grep -l '[^_]unreachable(' -- "src/**" | sort | uniq | \
  while read file; \
  do \
    sed -e 's/\([^_]\)unreachable(/\1UNREACHABLE(/g' -i "$file"; \
  done && \
  sed -e 's/#undef unreachable/#undef UNREACHABLE/g' -i src/intel/isl/isl_aux_info.c

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
2025-07-31 17:49:42 +00:00
Simon Perretta
c386c2f9e8 pvr, pco: point size handling
Clamp point size to limits.
Emit default point size if required but none is provided.

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/33998>
2025-07-08 23:10:57 +00:00