Commit Graph

183805 Commits

Author SHA1 Message Date
Tatsuyuki Ishi
8bf5c33c9c radv: Rename cache_search_nir to cache_lookup_nir_handle.
A future commit will introduce cache_lookup_nir (which does not create
an intermediate vk_pipeline_cache_object), so rename it for consistency.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26696>
2024-01-26 11:46:18 +00:00
Tatsuyuki Ishi
70b0c5909b radv: Add radv_spirv_to_nir_options that summarize early gfx states.
radv_shader_spirv_to_nir now takes a more minimal struct instead of gfx
states. This struct will be used for NIR cache hashing in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26696>
2024-01-26 11:46:18 +00:00
Lionel Landwerlin
e519e06f4b anv: add missing alignment for AUX-TT mapping
Buffers that are not dedicated can also be used for CCS mapped images,
so they need to be aligned to the AUX-TT requirements.

GTK+ is running into such case where it creates an image with a CCS
modifier. When requesting the alignment through
vkGetImageMemoryRequirements() the 64KB/1MB alignment is returned, but
the binding fails with an assert because the VkDeviceMemory has not
been aligned to the AUX-TT requirement and we cannot disable CCS since
the modifier requires it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4cdd3178fb ("anv: Meet CCS alignment reqs with dedicated allocs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10433
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27258>
2024-01-26 11:20:17 +00:00
Pavel Ondračka
337fbab9ce r300: remove backend support for SUB
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
18a0ff121e r300: remove the remaining of backend constant folding
This was needed to clean up after the comparison opcode lowering which
has now beed moved earlier to NIR. We just need to clean up the special
case of add a,0 manually as this happens way too late for any other
standard algebraic pass.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
553e841d7c r300: remove SGE, SNE, SLT, SGE lowering in the backend
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
5115cebd5d r300: lower comparison ops early in NIR
The HW can't do comparison opcodes in the FS, so the old way was to
lower all to ADD and CMP in the backend. However, the comparison bool
result is used either in if (where we can encode the comparions in the
aluresults calculation) or is uses in another bcsel. Therefore, we now
end with two CMPs, one from the original bcsel and one from the lowered
comparison.

This patch fixes it by doing the comparison lowering early for some nice
shader-db gains. Similarly to vertex shaders, we need some special
passes for this, because we can't nir_lower_bool_to_float too early, so
we just manually lower the most common patterns in the main opt loop and
than clean up the rest later.

Shader-db RV530:
total instructions in shared programs: 130797 -> 130400 (-0.30%)
instructions in affected programs: 34591 -> 34194 (-1.15%)
helped: 203
HURT: 133
total presub in shared programs: 8175 -> 8220 (0.55%)
presub in affected programs: 1738 -> 1783 (2.59%)
helped: 62
HURT: 53
total omod in shared programs: 414 -> 412 (-0.48%)
omod in affected programs: 4 -> 2 (-50.00%)
helped: 2
HURT: 0
total temps in shared programs: 17570 -> 17566 (-0.02%)
temps in affected programs: 1122 -> 1118 (-0.36%)
helped: 41
HURT: 43
total consts in shared programs: 94362 -> 94359 (<.01%)
consts in affected programs: 381 -> 378 (-0.79%)
helped: 13
HURT: 10
total lits in shared programs: 2951 -> 2961 (0.34%)
lits in affected programs: 104 -> 114 (9.62%)
helped: 3
HURT: 9
total cycles in shared programs: 198965 -> 198744 (-0.11%)
cycles in affected programs: 55784 -> 55563 (-0.40%)
helped: 177
HURT: 144

LOST:   0
GAINED: 1

Shader-db RV380:
total instructions in shared programs: 84224 -> 84109 (-0.14%)
instructions in affected programs: 6039 -> 5924 (-1.90%)
helped: 106
HURT: 38
total presub in shared programs: 1401 -> 1372 (-2.07%)
presub in affected programs: 113 -> 84 (-25.66%)
helped: 27
HURT: 10
total temps in shared programs: 13231 -> 13224 (-0.05%)
temps in affected programs: 303 -> 296 (-2.31%)
helped: 22
HURT: 12
total consts in shared programs: 82484 -> 82505 (0.03%)
consts in affected programs: 271 -> 292 (7.75%)
helped: 4
HURT: 25
total cycles in shared programs: 132957 -> 132840 (-0.09%)
cycles in affected programs: 12696 -> 12579 (-0.92%)
helped: 101
HURT: 43

LOST:   0
GAINED: 1

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
99abd9ad30 r300: optimize out more modifiers produced later
The code handling NIR to TGSI translation can't handle multiple
chained modifiers.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
bdf42690f6 r300: add r300_is_only_used_as_float helper
This is slightly different from the stock is_only_used_as_float since
that one will return false when called for uses of bcsel if any of the
uses actually uses uint, like vec or another bcsel. This version will
recursivelly go further in such cases and return false only if it sees
any instructions specifically neededing bools or ints.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Pavel Ondračka
b1a669be75 r300: remove backend SLE and SGT support
NIR doesn't know them, so there is no way we can ever end with one.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27089>
2024-01-26 11:06:06 +00:00
Lionel Landwerlin
d46bbf727d anv: promote EXT_load_store_op_none to KHR
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27274>
2024-01-26 10:38:53 +00:00
Lionel Landwerlin
87acc6b59b anv: promote EXT_line_rasterization to KHR
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27274>
2024-01-26 10:38:53 +00:00
Lionel Landwerlin
976d5b9551 anv: promote EXT_index_type_uint8 to KHR
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27274>
2024-01-26 10:38:53 +00:00
Louis-Francis Ratté-Boulianne
1aa832e5f5 panfrost: Legalize before updating part of a AFBC-packed texture
When updating an AFBC-packed resource, we need to make sure it is
legalized before blitting the staging resource to it. We can't rely
on the blit to properly convert the resource as it will result in
blit recursion and a crash.

If the whole texture is updated however, there is no need to unpack
as the content can be discarded. Just create a new BO with the right
format.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 33b48a5585 ("panfrost: Add debug flag to force packing of AFBC textures on upload")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27208>
2024-01-26 10:19:22 +00:00
Louis-Francis Ratté-Boulianne
ee77168d57 panfrost: add can_discard flag to pan_legalize_afbc_format
There might be a more efficient path when legalizing a resource if
we don't need to worry about its content. For example, it doesn't
make sense to copy the resource content when converting the modifier
if the resource content is discarded anyway.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 33b48a5585 ("panfrost: Add debug flag to force packing of AFBC textures on upload")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27208>
2024-01-26 10:19:22 +00:00
Louis-Francis Ratté-Boulianne
62ed14b386 panfrost: add copy_resource flag to pan_resource_modifier_convert
When converting the modifier for a resource, it's not always
needed to blit the content as well. Creating a new resource with
the right format/modifier might be enough.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 33b48a5585 ("panfrost: Add debug flag to force packing of AFBC textures on upload")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27208>
2024-01-26 10:19:21 +00:00
Louis-Francis Ratté-Boulianne
22a7637b08 panfrost: factor out method to check whether we can discard resource
The logic is gonna be re-used to determine whether we need to
unpack a AFBC-packed texture before updating it (when unmapping).

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 33b48a5585 ("panfrost: Add debug flag to force packing of AFBC textures on upload")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27208>
2024-01-26 10:19:21 +00:00
Samuel Pitoiset
c53d0a6a6d radv: advertise VK_KHR_index_type_uint8
Promoted from the EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27262>
2024-01-26 10:00:48 +00:00
Samuel Pitoiset
30f2802e31 radv: promote VK_EXT_index_type_uint8 to KHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27262>
2024-01-26 10:00:48 +00:00
Samuel Pitoiset
0ceeb67b3b radv: advertise VK_KHR_line_rasterization
Promoted from the EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27262>
2024-01-26 10:00:48 +00:00
Samuel Pitoiset
df3fbe3b33 radv: promote VK_EXT_line_rasterization to KHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27262>
2024-01-26 10:00:48 +00:00
Samuel Pitoiset
701a37e863 radv: advertise VK_KHR_load_store_op_none
Promoted from the EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27262>
2024-01-26 10:00:48 +00:00
Krzysztof Kurek
e6156df53a panfrost: fix shift overflow in bi_fold_constant
closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/9517

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26116>
2024-01-26 09:40:48 +00:00
Rohan Garg
b703e0be53 anv: factor out common code for determining surface usage from a VkDescriptorType
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27268>
2024-01-26 09:17:03 +00:00
Samuel Pitoiset
2972590a53 radv: advertise VK_EXT_shader_object on GFX6-8
This extension can be enabled with RADV_PERFTEST=shader_object.
GFX9+ support and improvements will happen shortly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
f0e7714d0d radv: add support for binding/emitting shader objects
Only GFX6-8 support for now because merged shaders make it harder to
implement but I have a bunch of local work for that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
2b93647d7f radv: make some pipeline graphics helpers non-static for ESO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
37d7c2172b radv: add support for creating/destroying shader objects
Only GFX6-8 support for now and no shaders cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
2f1902d4df radv: add radv_shader_layout::dynamic_offset_count
This will be used to initialize the shader layout for ESO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
1dbb859b3b radv: add radv_shader_stage::next_stage field
This allows to init radv_shader_info correctly when the next stage is
known, this is mostly for ESO. Though, next_stage could be used in
other places too.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
a12019cc91 radv: initialize default dynamic state when beginning a new cmdbuf
With ESO everything is dynamic and the default dynamic state must be
initialized when beginning a new command buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
482ca4b074 radv: add required NV entrypoints for VK_EXT_shader_object
Even if the implementation doesn't support the extensions, the
entrypoints must exist.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
de1805faed radv: enable prologs/epilogs in-memory cache for shader objects
Shader objects always use VS prologs/PS epilogs/TCS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
9351a4c51a radv: re-emit the TCS epilog when a new TCS is bound
Similarly to VS prologs and PS epilogs, this needs to be re-emitted
otherwise the config shader state can be overwritten.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
1bc5f15b68 radv: prevent accessing NULL pipelines when emitting VBO with ESO
ESO always uses dynamic strides, so this should be zero.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
6728e9dd15 radv: add a helper to get the VGT_GS_OUT value
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Samuel Pitoiset
fe1a9b3ab3 radv: add a helper for binding the custom blend mode
This re-emits the according state when a new graphics pipeline is bound

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26930>
2024-01-26 08:56:54 +00:00
Pavel Ondračka
bf1a2b7427 r300/ci: add dEQP on RV380
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27183>
2024-01-26 08:05:52 +00:00
Guilherme Gallo
cd8b546205 bin/ci: Add GitLab basic token validation
Validate the token to be able to warn the user about wrong
authentication settings.
Treat the default token argument case, when the token file is not found.
Add some loggings to guide the user.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27206>
2024-01-26 00:37:05 -03:00
Guilherme Gallo
8eabdb3909 bin/ci: Refactor read_token function
Make `read_token` utilize the `get_gitlab_pipeline_from_url` to reuse
code from `gitlab_gql.py`.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27206>
2024-01-26 00:37:05 -03:00
Guilherme Gallo
708a26c607 bin/ci: Move get_token_from_default_dir to common
Moved the `get_token_from_default_dir` method to a common module for
shared use between `gitlab_gql.py` and `ci_run_n_monitor.py`. This
migration facilitates better code organization and potential future
reuse.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27206>
2024-01-26 00:37:05 -03:00
Guilherme Gallo
50fcea9c34 bin/ci: Propagate the token to GitlabGQL
Fix an issue in `ci_run_n_monitor.py` where the token was not
being correctly propagated to the GitlabGQL abstraction. This addresses
misbehavior in scenarios like running pipelines in a private fork,
ensuring proper functionality.

Also document `find_dependencies` function.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27206>
2024-01-26 00:37:03 -03:00
David Heidelberg
7cc6140cc8 ci: shorter kernel tag, included Vivante NPU patches
1. shorter tag so containers tag gets shorter too (we need it)
2. Preparation for NPU etnaviv testing (without NPU enablement, see
   https://gitlab.freedesktop.org/mesa/mesa/-/issues/10465 )

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27229>
2024-01-26 01:57:23 +00:00
Jesse Natalie
472ef1ecae d3d12: Fix path passed to CreateDeviceFactory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27287>
2024-01-26 01:30:00 +00:00
Jesse Natalie
4fede8d419 dzn: Fix path passed to CreateDeviceFactory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27287>
2024-01-26 01:30:00 +00:00
Jesse Natalie
fa1c9618f9 dzn: Don't set view instancing mask until after the PSO
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27286>
2024-01-26 01:05:02 +00:00
Jesse Natalie
86b5c9278c glsl: Work around MSVC arm64 optimizer bug
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27199>
2024-01-26 00:22:53 +00:00
Jesse Natalie
6139cd0656 util: Detect arm64ec as aarch64 (and x86_64)
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27199>
2024-01-26 00:22:53 +00:00
Faith Ekstrand
99ef70d8aa nak: Fix TCS output reads
The hardware uses the lane index for per-vertex TCS output reads rather
than the vertex index.  Fortunately, it's a pretty easy calculation to
go from one to the other.

Fixes: abe9c1fea2 ("nak: Add NIR lowering for attribute I/O")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27284>
2024-01-26 00:07:40 +00:00
Andres Calderon Jaramillo
e44e57b4e7 radeonsi: get enc/dec caps from kernel only on amdgpu
Tested-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Leo Liu <leo.liu@amd.com>

Change-Id: I6f8c6799bb331c42aa1526b8f1eeb0473e5d756e
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27283>
2024-01-25 22:39:56 +00:00