Commit graph

181539 commits

Author SHA1 Message Date
Christian Gmeiner
2436babbd2 etnaviv: Extend etna_set_framebuffer_state(..) for MRTs
The GPU needs all the active (non-null) render targets in a
contiguous representation. For instance, if fb->nr_cbufs is 4 but
fb->cbufs[0] and fb->cbufs[1] are null we need to program the GPU that
fb->cbufs[2] is configured via PE_COLOR_FORMAT and friends and
fb->cbufs[3] via PE_RT_CONFIG[0] and friends.

We need to keep track which render target is used as we need to update
the fragment shader output mapping.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
546c4b992c etnaviv: Extend etna_update_zsa(..) for MRTs
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
64b78ef9c2 etnaviv: Extend etna_update_blend_color(..) for MRTs
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
5598a449f1 etnaviv: Extend etna_record_flush_resources(..) for MRTs
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
f070d44add etnaviv: Extend compiler for MRTs
We will see multiple fragment outputs when MRTs are used. Keep
track of the registers for the outputs.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
035a100246 etnaviv: Extend compiled_shader_state for MRTs
We can have up to 8 MRTs (depending on HALTI) and we need
more two uint32_t in total. Just convert PS_OUTPUT_REG to
an array and change the code that works with it.

This is just prep change for MRT support.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
4e83236ced etnaviv: Extend frag_rb_swap for MRTs
We need to handle rb_swap for every color buffer.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
594f38bde6 etnaviv: Call etna_resource_level_mark_changed(..) for all rts
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
63bae5940f etnaviv: nir: Make use of reported number of render targets
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:24 +00:00
Christian Gmeiner
4b01e9056d etnaviv: Report number of render targets
At the basic infrastructure to report the number of supported
render targets. etna_determine_num_rts(..) will be extended later
to report correct numbers based on GPU's capability.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:23 +00:00
Christian Gmeiner
3e6f178734 etnaviv: nir: Make use of nir_lower_fragcolor
This is a prep step to be able to use nir_lower_blend(..) and
also simplifies the compiler a little bit.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:23 +00:00
Christian Gmeiner
a83b816f03 etnaviv: Update headers from rnndb
Update to rnndb commit 8a5797f25d90.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26565>
2024-10-04 09:48:23 +00:00
Lucas Stach
c12697abe0 etnaviv: re-emit uniforms on sampler view changes when txs is used
The shader uniforms used for emulating TXS depend on the current
sampler view state and thus need to be re-emitted when this
states changes.

Fixes: 88f399b651 ("etnaviv: nir: support intrinsic used for txs lowering")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31495>
2024-10-04 09:18:01 +00:00
Samuel Pitoiset
50f78e4a54 radv: remove GFX6-7 DGC support completely
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31491>
2024-10-04 07:58:37 +00:00
Samuel Pitoiset
e4f67f2106 radv: do not expose NV DGC extensions on GFX6-7
These extensions were experimental and only exposed with radv_dgc=true
for vkd3d-proton. Only two games require DGC (Starfield and Halo
Infinite) and both also require sparse support which GFX6-7 can't
support.

GFX6-7 support is also mostly broken because IB2 can't be used when
indirect draw packets are used and RADV uses that to preprocess IBO.
Also with the EXT, indirect draws are more common and can't be
supported.

Everything could work with a bunch of time and workarounds but I don't
think it's worth the effort given there is no real use.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31491>
2024-10-04 07:58:37 +00:00
Timothy Arceri
065b45e4dc glsl: remove linker.cpp
All functionality has now been converted to NIR or moved elsewhere.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00
Timothy Arceri
e4c3e7e0d8 glsl: rename link_shaders() -> link_shaders_init()
And move it to the linker util file.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00
Timothy Arceri
37ac8f5e79 glsl: move shader cache lookup call to st
The nir shader cache read call is just below this call now so the code
is easier to follow.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00
Timothy Arceri
b663eb83fe glsl: move error and warning helpers to util file
These functions are already defined in linker_util.h so moving them here
is logical.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00
Timothy Arceri
19c27c39b4 glsl/mesa: remove ir_uniform.h
We moved its contents elsewhere in a previous patch.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:59 +00:00
Timothy Arceri
13301e2509 glsl: move resource_name_updated() to linker_util.cpp
We want to remove the old linker.cpp file in following patches so move
this util function to the util code file.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:58 +00:00
Timothy Arceri
08e25e091b glsl/mesa: move uniform related shader structs to shader_types.h
This is where all the other uniform related structs are and these were
the only structs used by both the compiler and gl api that were defined
in the compiler code so lets move them to where everything else is
defined.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31500>
2024-10-04 00:10:58 +00:00
Faith Ekstrand
bba6bf33a8 vulkan/queue: Merge submits when possible
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:40 +00:00
Faith Ekstrand
c3bf1a67a1 vulkan/queue: Split vk_queue_submit into create and submit
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:40 +00:00
Faith Ekstrand
f0392779d9 vulkan/queue: Use a builder pattern for vk_queue_submit
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:39 +00:00
Faith Ekstrand
899c774b9a vulkan: Add a vk_queue_submit_has_bind() helper
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:39 +00:00
Faith Ekstrand
c95b646e23 vulkan/queue: Use _mem_signal_temp instead of signal_mem_sync
The two checks should be equivalent.  This just lets us use data in
struct vk_queue_submit rather than a local boolean.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:39 +00:00
Faith Ekstrand
267b7f1deb vulkan/queue: Move has_binary_permanent_semaphore_wait into the sumbit struct
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:39 +00:00
Faith Ekstrand
9b21dc06c4 vulkan/queue: Don't use vk_semaphore in threaded payload stealing
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25576>
2024-10-03 22:11:39 +00:00
Danylo Piliaiev
e5d3eba096 u_trace: Fix trace_payload_as_extra_func desync between drivers
Buffer with indirect args wasn't passed to the function which
adds extra event args. Since function definition depends on the
common code, the definition is moved to a single place.

Fixes: 0a17035b5c
("u_trace: add support for indirect data")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31090>
2024-10-03 20:25:48 +00:00
Nanley Chery
26692deefc anv: Delete stale comment for BLORP clear color addr
It looks like this comment attempted to describe all the reasons we need
to pass the clear color address to BLORP. This comment actually isn't
exhaustive and some bits are out of date (e.g., BLORP no longer updates
the clear color address for us). Let's just delete it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31136>
2024-10-03 19:41:31 +00:00
Nanley Chery
10bcfb63d5 anv: Prevent clear color modifier corruption with views
If a dmabuf is shared with a clear color, the raw clear color channels
generally won't be interpreted correctly during format reinterpretation.
So, prevent Vulkan apps from trying to use such dmabufs as mutable
format render targets. Also, prevent such apps from using such dmabufs
as blorp_copy() destinations if doing so would require format
reinterpretation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31136>
2024-10-03 19:41:31 +00:00
Nanley Chery
edfb33efdd intel/blorp: Use original surface format for some copies
In iris, this should avoid some partial resolves when copying between
images. In anv, this will reduce restrictions on dmabufs which have
clear color support in the next patch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31136>
2024-10-03 19:41:31 +00:00
Nanley Chery
73637dbce4 intel/blorp: Choose some copy formats independently
blorp_copy_get_formats() tries to make the source and destination view
formats match as much as possible. This avoids some casting in the copy
shader, but it makes determining the format that will be used for a
surface impossible without having the ISL surface for both that surface
and a source or destination.

We'd like to enable the Vulkan driver to know as early as possible what
format an image may be reinterpreted as for correctness. So, determine
the copy formats more independently and expose a helper which does so
for drivers.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31136>
2024-10-03 19:41:31 +00:00
Nanley Chery
6721064939 anv: Use image formats when copying to/from buffers
blorp_copy() will sometimes use a complex shader if the source and
destination surface formats differ. For example, it will do this when
both formats support CCS_E, but have differing numbers of
bits-per-channel.

To reduce the chance of using this complex shader during transfers
between images and buffers, ensure the same format is used. We can't
completely prevent the complex shader because a copy may happen between
surface formats that have a different number of bits-per-pixel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31136>
2024-10-03 19:41:31 +00:00
Mike Blumenkrantz
f7b5faa1a2 zink: block srgb with winsys imports
these are already a set format

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Mike Blumenkrantz
f3c206d61e zink: fix external_only reporting for dmabuf formats
this is based on format features

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Mike Blumenkrantz
49950d3b2f zink: clamp out dmabuf exports from optimal tiling images
this is an impossible combo since optimal tiling cannot return stride

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Mike Blumenkrantz
3c44886d9e zink: also init format props when getting modifier props
forgot this in earlier refactor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Mike Blumenkrantz
efeb65cfe8 zink: assert images aren't created with dmabuf export and optimal tiling
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Mike Blumenkrantz
2fdba5b914 zink: block dmabuf fallback into optimal tiling
when modifiers are specified the frontend needs stride, and optimal
tiling cannot provide a stride

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
2024-10-03 19:06:02 +00:00
Faith Ekstrand
15fb18063b nvk: Fix a comment in SET_VIEWPORT_CLIP_CONTROL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31514>
2024-10-03 18:34:55 +00:00
Rhys Perry
96e7cd89ea aco: fix is_vector_intact for GFX11 BVH
fossil-db (navi31):
Totals from 44 (0.06% of 79395) affected shaders:
Instrs: 1539111 -> 1539109 (-0.00%); split: -0.00%, +0.00%
CodeSize: 7880452 -> 7880380 (-0.00%); split: -0.00%, +0.00%
Latency: 7578794 -> 7578844 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 1450872 -> 1450876 (+0.00%); split: -0.00%, +0.00%
VClause: 40014 -> 40010 (-0.01%)
Copies: 116005 -> 116001 (-0.00%); split: -0.01%, +0.01%
VALU: 854630 -> 854626 (-0.00%); split: -0.00%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346>
2024-10-03 17:55:56 +00:00
Rhys Perry
24c60be1ad aco: create vector affinities for phi operands
fossil-db (navi21):
Totals from 2934 (3.70% of 79395) affected shaders:
Instrs: 8368484 -> 8365630 (-0.03%); split: -0.05%, +0.01%
CodeSize: 46032152 -> 45998480 (-0.07%); split: -0.09%, +0.01%
VGPRs: 200360 -> 200280 (-0.04%); split: -0.12%, +0.08%
Latency: 85556147 -> 85562615 (+0.01%); split: -0.09%, +0.10%
InvThroughput: 19066462 -> 19065173 (-0.01%); split: -0.09%, +0.09%
VClause: 209834 -> 209783 (-0.02%); split: -0.14%, +0.12%
SClause: 261811 -> 261826 (+0.01%); split: -0.00%, +0.01%
Copies: 727502 -> 724394 (-0.43%); split: -0.56%, +0.13%
Branches: 291083 -> 291120 (+0.01%); split: -0.01%, +0.03%
VALU: 5564021 -> 5560975 (-0.05%); split: -0.07%, +0.02%
SALU: 1100996 -> 1100942 (-0.00%); split: -0.02%, +0.02%

fossil-db (navi31):
Totals from 34207 (43.08% of 79395) affected shaders:
MaxWaves: 1036893 -> 1036781 (-0.01%); split: +0.01%, -0.02%
Instrs: 21977229 -> 21884600 (-0.42%); split: -0.47%, +0.05%
CodeSize: 112680884 -> 112298404 (-0.34%); split: -0.38%, +0.04%
VGPRs: 1590832 -> 1615912 (+1.58%); split: -0.25%, +1.83%
Latency: 142542601 -> 142670271 (+0.09%); split: -0.12%, +0.21%
InvThroughput: 19481055 -> 19434110 (-0.24%); split: -0.44%, +0.20%
VClause: 462865 -> 462558 (-0.07%); split: -0.20%, +0.13%
SClause: 619822 -> 619685 (-0.02%); split: -0.02%, +0.00%
Copies: 1704870 -> 1610889 (-5.51%); split: -5.89%, +0.38%
Branches: 518238 -> 518241 (+0.00%); split: -0.01%, +0.01%
VALU: 12230157 -> 12136112 (-0.77%); split: -0.82%, +0.05%
SALU: 2444075 -> 2444099 (+0.00%); split: -0.01%, +0.01%
VOPD: 3443 -> 3476 (+0.96%); split: +1.80%, -0.84%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11186
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346>
2024-10-03 17:55:56 +00:00
Rhys Perry
1e60509135 aco: stop using instructions in ra_ctx::vectors
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346>
2024-10-03 17:55:56 +00:00
David Rosca
be9b9c5fc4 pipe: Remove video get_*_fence
Replaced now with fence_wait.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31442>
2024-10-03 17:04:26 +00:00
David Rosca
206bd951b4 frontends/va: Use fence_wait instead of get_*_fence
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31442>
2024-10-03 17:04:26 +00:00
David Rosca
a98aa21873 r600/uvd: Implement fence_wait
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31442>
2024-10-03 17:04:26 +00:00
David Rosca
a511dc1dda d3d12: Implement fence_wait
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31442>
2024-10-03 17:04:26 +00:00
David Rosca
9080741d8f radeonsi/vpe: Implement fence_wait
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31442>
2024-10-03 17:04:26 +00:00