Commit graph

187345 commits

Author SHA1 Message Date
Mike Blumenkrantz
364a6ac1a3 zink: check for arrayness rather than tess io vars for indirect array vars
this is a bit more accurate since it includes clip/cull dist

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
720a43858d zink: fix generated variable expansion
this fixes a case where the found variable might be an array of a
smaller vector

not currently possible to reach

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
404e9f1134 zink: always use shader sizes for clip/cull dist variables
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
316470920a zink: add a helper to detect clip/cull dist locations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
665755720a zink: manually calc clip/cull distance sizes
the current frontend handling for this is too unreliable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
cf4953d184 zink: apply component offset for CLIP/CULL DIST1 location derefs
cannot currently be reached

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
332c24774c zink: run scan_nir before variable rework
this will enable using its heuristics when generating variables

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:47 +00:00
Mike Blumenkrantz
88792b9ea3 zink: update xfb info after lower_to_scalar
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:46 +00:00
Mike Blumenkrantz
23ce5696d6 zink: use outputs_written mask to detect edge flag usage
fixes lowered io

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:46 +00:00
Mike Blumenkrantz
b8bf82133a zink: always sort io variables by location after re-creating them
this otherwise breaks linking

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:46 +00:00
Mike Blumenkrantz
5fd03efda0 zink: delete some ntv dead code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28466>
2024-04-03 14:21:46 +00:00
Samuel Pitoiset
cefbfe6597 radv: add radv_wsi.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
bfaa674583 radv: add radv_pipeline_graphics.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
987f3351b3 radv: add radv_pipeline_rt.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
7807d49f82 radv: add radv_pipeline_compute.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
f07a639801 radv: add radv_pipeline.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
8e9b41641a radv: add radv_pipeline_cache.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
150ce13273 radv: add radv_device.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
1c590cbd28 radv: add radv_rra.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
6849305a86 radv: add radv_physical_device.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
0fb19b8331 radv: add radv_queue.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
30eb0ef45a radv: add radv_instance.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
83841b0b78 radv: add radv_device_memory.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:53 +00:00
Samuel Pitoiset
bcfac61468 radv: move radv_shader_{layout,stage} to radv_shader.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:53 +00:00
Samuel Pitoiset
0df9270997 radv: move radv_userdata_locations to radv_shader_args.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:53 +00:00
Samuel Pitoiset
d058264f55 radv: move radv_prim_vertex_count to si_cmd_buffer.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03 13:32:53 +00:00
Sil Vilerino
74ac72ceb2 d3d12: Fix leak of batch->bos on video-only builds
Fixes: 55e377e965 ("d3d12: Add partial media, compute, graphics support with CORE and GENERIC feature levels")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28543>
2024-04-03 12:51:16 +00:00
Iago Toral Quiroga
bdf2a470d3 v3dv: fix job suspend with command buffer simultaneous use flag
With the simultaneous use flag we can reuse the same command
buffer multiple times. That means, for example, that we can
have an instance of a job running in the GPU while we are
submitting another one for execution to a queue.

This scenario is problematic with dynamic rendering and job
suspension because suspended jobs need to be patched with the
resume address at queue submit time, and thus, if we have another
instance of the same job currently executing in the GPU we could
stomp its resume address, which could be different.

To fix this, at queue submission time, when we detect a suspending
job in a command buffer with the simultaneous use flag, we clone the
job and create its own copy of the BCL so we can patch the resume
address into it safely without conflicting with any other instance
of the job that may be running.

We need to flag these clones  as having their own BCL since
we would have to free it when the job is destroyed, unlike other
clones that don't own any resources of their own. Also, because
this job is created at queue submit time, it won't be in the
execution list of the command buffer, so it won't be automatically
destroyed with it, so we need to add it to the command buffer
as a private object.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28521>
2024-04-03 13:35:54 +02:00
Iago Toral Quiroga
ff8d72ba22 v3dv: store the offset of the BRANCH instruction in a CL
This will be useful to know which is the actual executable
size of a BO in a CL that branches into a another BO. We
will need this soon to implement deep clones of the BCL
for suspending jobs with the command buffer simultaneous
use flag.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28521>
2024-04-03 12:57:56 +02:00
Iago Toral Quiroga
c874caf33d v3dv: fix job pointers from cloned CLs
We had these pointing to the original job instead of pointing
to the cloned job. This can be confusing, particularly, if we
then emit commands that include references to new BOs into the
cloned jobs, since we would then try to insert these BOs in the
original jobs instead of the clones, which was the situation
we had when we implemented resume address patching with dynamic
rendering.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28521>
2024-04-03 12:57:56 +02:00
Iago Toral Quiroga
e6efee3b40 v3dv: add a v3dv_job_clone helper
This will clone the job but it won't automatically put it in the
job list of a command buffer. This will come in handy to handle
the required job cloning for suspending jobs with the command buffer
reuse flag in a follow-up patch.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28521>
2024-04-03 12:57:56 +02:00
Iago Toral Quiroga
16c96b0e93 v3dv: drop single sync kernel interface
Since we are now requiring a multisync kernel interface there is
no reason to continue supporting the legacy interface.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28541>
2024-04-03 10:34:17 +00:00
Iago Toral Quiroga
25e45b85c2 v3dv: require multisync kernel
Multisync has been available in kernel releases for a long time
now and Raspberry Pi OS kernels have been supporting it for a
while too.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28541>
2024-04-03 10:34:17 +00:00
Mary Strodl
7a8771f7b5 NirShader: don't fail on null constant_buffer
On iris (and probably other platforms too), an empty buffer could be a
null pointer. This is problematic, because even empty slices can't have
a null pointer. When we encounter an empty buffer, send an empty
static slice instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28309>
2024-04-03 09:26:38 +00:00
Samuel Pitoiset
f9b3e32440 radv: advertise VK_EXT_device_address_binding_report
This extension can be very useful for debugging VM faults with AMDGPU
because it's possible to associate VA ranges with Vulkan objects. Also
useful for detecting use-after-free.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
2024-04-03 08:48:36 +00:00
Samuel Pitoiset
db736ebf53 radv: implement VK_EXT_device_address_binding_report
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
2024-04-03 08:48:36 +00:00
Samuel Pitoiset
34e8e5d76f vulkan/debug_utils: add a helper for reporting address binding
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
2024-04-03 08:48:36 +00:00
Patrick Lerda
24a5165cdf r300: fix constants_remap_table memory leak related to the dummy shader path
A last memory leak related to constants_remap_table is happening.
This memory leak is triggered by two deqp-gles2 tests.

For instance, this issue is triggered with
"deqp-gles2 --deqp-case=dEQP-GLES2.functional.uniform_api.random.13":
Direct leak of 336 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b4a5de7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef)
    #1 0x7f1b401a2cdf in rc_remove_unused_constants ../src/gallium/drivers/r300/compiler/radeon_remove_constants.c:101
    #2 0x7f1b40185386 in rc_run_compiler_passes ../src/gallium/drivers/r300/compiler/radeon_compiler.c:476
    #3 0x7f1b40185625 in rc_run_compiler ../src/gallium/drivers/r300/compiler/radeon_compiler.c:498
    #4 0x7f1b401c14d2 in r3xx_compile_fragment_program ../src/gallium/drivers/r300/compiler/r3xx_fragprog.c:172
    #5 0x7f1b401b669a in r300_translate_fragment_shader ../src/gallium/drivers/r300/r300_fs.c:516
    #6 0x7f1b401baf73 in r300_pick_fragment_shader ../src/gallium/drivers/r300/r300_fs.c:592
    #7 0x7f1b40128db7 in r300_create_fs_state ../src/gallium/drivers/r300/r300_state.c:1071
    #8 0x7f1b3e67799d in st_create_fp_variant ../src/mesa/state_tracker/st_program.c:1073
    #9 0x7f1b3e680285 in st_get_fp_variant ../src/mesa/state_tracker/st_program.c:1119
    #10 0x7f1b3e6812fa in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:1284
    #11 0x7f1b3e6812fa in st_finalize_program ../src/mesa/state_tracker/st_program.c:1363
    #12 0x7f1b3f13d501 in st_link_glsl_to_nir ../src/mesa/state_tracker/st_glsl_to_nir.cpp:754
    #13 0x7f1b3f13d501 in st_link_shader ../src/mesa/state_tracker/st_glsl_to_nir.cpp:990
    #14 0x7f1b3efeef75 in link_program ../src/mesa/main/shaderapi.c:1336
    #15 0x7f1b3efeef75 in link_program_error ../src/mesa/main/shaderapi.c:1445

Fixes: 29df85788a ("r300: fix constants_remap_table memory leak")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28522>
2024-04-03 08:28:42 +00:00
Erik Faye-Lund
dfc6330b85 panvk: use integers instead of strings
There's no good reason to use strings here instead of integers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28533>
2024-04-03 08:08:00 +00:00
Mike Blumenkrantz
3352803510 zink: fix shaderdb pipeline compile
this assert is always triggered with shaderdb, but it's not relevant there

Fixes: 0ebd6f52a2 ("zink: reuse rast_prim for line-rasterization check")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28525>
2024-04-03 06:37:31 +00:00
Mike Blumenkrantz
18fbe63ff2 zink: make descriptor pool creation more robust
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28467>
2024-04-03 05:48:19 +00:00
Mike Blumenkrantz
c2e0c2c67f zink: don't use set_foreach_remove with dmabuf_exports
foreach_remove cannot be used if the set ever has members deleted,
and this set may have deleted members

Fixes: 7b7a581a52 ("zink: prune dmabuf export tracking when adding resource binds")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28464>
2024-04-03 05:22:43 +00:00
Yonggang Luo
3114917986 util: Turn futex_wake parameter to int32_t for consistence across platforms
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28473>
2024-04-03 00:55:24 +00:00
Yonggang Luo
ca9738cd7a util: futex_wait use TIME_MONOTONIC on win32 for consistence with other platform
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28473>
2024-04-03 00:55:24 +00:00
Yonggang Luo
54e3fde5ca util: Fixes futex_wait on win32
The timeout compute is invalid

Fixes: 095dfc6caa ("util: Move the implementation of futex_wake and futex_wait from futex.h to futex.c")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28473>
2024-04-03 00:55:24 +00:00
Timur Kristóf
8a24610477 nir/recompute_io_bases: Sort per-primitive PS inputs last.
Some hardware requires that per-primitive FS inputs are
sorted last, and nir_assign_io_var_locations can already
take care of this.

Add the same consideration to nir_recompute_io_bases.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28489>
2024-04-02 23:00:01 +00:00
Timur Kristóf
ecbf3464f6 nir: Record per-primitive inputs without variables.
Previously, this information would have been lost when the
shader has no I/O variables.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28489>
2024-04-02 23:00:01 +00:00
Timur Kristóf
b085248819 nir/gather_info: Record per-primitive outputs without variables.
Previously, this information would have been lost when the
shader has no I/O variables.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28489>
2024-04-02 23:00:01 +00:00
Eric Engestrom
185e9b4a75 ci: fix nightly build
Fixes: 7c0b19a607 ("ci: run python-test automatically only in merge pipelines")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28517>
2024-04-02 22:10:43 +00:00
Samuel Pitoiset
a535425fb6 radv: enable radv_zero_vram for Red Dead Redemption 2
This fixes some very rare glitches that are unrelated to DCC.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8719
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28393>
2024-04-02 21:31:46 +00:00