Yiwei Zhang [Thu, 6 Jul 2023 19:34:39 +0000 (12:34 -0700)]
venus: refactor vn_cmd_add_query_feedback and miscs
There's no functional changes:
1. remove unused function arg and use snake case
2. do early return for direct recording (avoid dup feedback checks)
3. use vk_alloc instead of vk_zalloc if applicable
4. move local struct closer to usage, and use assignment
5. convert secondary cmd in_render_pass condition check to assert
6. avoid redundant list_del upon freeing up
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
Yiwei Zhang [Tue, 4 Jul 2023 22:36:31 +0000 (15:36 -0700)]
venus: cmd to reuse alloc copy from cmd pool
Directly use the alloc callback upon pool reset/destroy since the compat
is blessed by the spec.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
Yiwei Zhang [Tue, 4 Jul 2023 22:21:23 +0000 (15:21 -0700)]
venus: track pool in cmd and track device in pool
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
Yiwei Zhang [Tue, 4 Jul 2023 23:17:47 +0000 (16:17 -0700)]
venus: fix leaks from tracked present src images
The cmd can be reset and freed during render pass recording as well.
Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
Yiwei Zhang [Tue, 4 Jul 2023 21:44:49 +0000 (14:44 -0700)]
venus: fix a cmd tmp storage leak
When the pool is destroyed, cmds are implicitly freed. Cmd level allocs
have to be cleaned up to avoid leak.
Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24009>
Yiwei Zhang [Tue, 27 Jun 2023 00:27:44 +0000 (17:27 -0700)]
venus: extend VkBuffer cache to cover concurrent sharing
vkd3d-proton always use concurrent sharing when there exists multiple
queue families, and all queue families are used. This change adds the
exact simple case to the existing cache.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23916>
Yiwei Zhang [Wed, 28 Jun 2023 23:00:11 +0000 (16:00 -0700)]
venus: refactor buffer cache related bits
Simplify returns and reorder inits.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23916>
Yiwei Zhang [Wed, 28 Jun 2023 22:55:09 +0000 (15:55 -0700)]
venus: refactor ahb buffer mem type bits cache to be lazy
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23916>
Christian Gmeiner [Thu, 6 Jul 2023 08:49:37 +0000 (10:49 +0200)]
ci/etnaviv: update ci expectation
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24029>
Lionel Landwerlin [Tue, 4 Jul 2023 07:02:41 +0000 (10:02 +0300)]
docs/features: add hasvk entries
Automatically generated using
https://github.com/djdeath/mesa-jhbuild/blob/master/update_features.py
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23986>
Lionel Landwerlin [Tue, 4 Jul 2023 06:58:40 +0000 (09:58 +0300)]
docs/features: add more missing extensions
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23986>
Sil Vilerino [Thu, 6 Jul 2023 15:48:48 +0000 (11:48 -0400)]
frontend/va: Remove fence_server_sync for surface in vlVaHandleVAProcPipelineParameterBufferType
Fixes:
fb1783616e3 ("frontend/va: Add video processing async fence support")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24023>
Sil Vilerino [Thu, 6 Jul 2023 14:39:15 +0000 (10:39 -0400)]
frontend/va: Fix vaSyncSurface and vaQuerySurface status for drivers not implementing get_processor_fence
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24023>
Eric Engestrom [Thu, 6 Jul 2023 17:19:58 +0000 (18:19 +0100)]
docs/codingstyle: fix clang-format command
I should've copy/pasted it back into my terminal to double-check it.
The `-o` is incorrect (it splits each char that matches into its own
line) and there's a missing `^` to remove lines that start with a hash
even if they contain anything else.
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24028>
Eric Engestrom [Thu, 6 Jul 2023 16:29:00 +0000 (17:29 +0100)]
zink/ci: fix skips & flakes for zink+radv on vangogh & navi10
These are regexes, not globs.
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24021>
Eric Engestrom [Thu, 6 Jul 2023 16:56:46 +0000 (17:56 +0100)]
etnaviv/ci: fix skips definition
Skips are regexes, not globs :)
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24025>
Eric Engestrom [Thu, 6 Jul 2023 16:47:02 +0000 (17:47 +0100)]
intel/ci: fix skips definitions
Skips are regexes, not globs :)
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24024>
Eric Engestrom [Thu, 6 Jul 2023 16:38:55 +0000 (17:38 +0100)]
panfrost/ci: drop invalid skips that are already marked as known flakes
Skips are regexes, which means the `*` would've needed to be escaped. As
is, they can't match any existing test.
Since these lines are also all in `-fails.txt` as `Crash`es, let's just
remove them from the skips.
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24022>
Mike Blumenkrantz [Thu, 6 Jul 2023 16:23:13 +0000 (12:23 -0400)]
zink: fix anv ci flakes (for real this time)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24020>
Mike Blumenkrantz [Mon, 19 Jun 2023 15:47:22 +0000 (11:47 -0400)]
vk/wsi: add error logging for syncfile import/export failures
these are otherwise pretty obscure
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23835>
Mike Blumenkrantz [Thu, 15 Jun 2023 17:26:23 +0000 (13:26 -0400)]
vk/wsi: unify dmabuf exporting
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23835>
Mike Blumenkrantz [Thu, 15 Jun 2023 14:36:19 +0000 (10:36 -0400)]
vk/wsi/x11: stop roundtripping on presentation
there's no requirement to return SUBOPTIMAL based on processed events
at present time, nor is SURFACE_LOST required here vs as a result of
acquire, so allow both of these conditions to be reported there instead
improves presentation perf by ~60%
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23835>
Mike Blumenkrantz [Tue, 13 Jun 2023 20:55:45 +0000 (16:55 -0400)]
vk/wsi/x11: handle geometry updating more asynchronously
this uses geometry updates from events when possible in order to avoid
roundtripping during vkGetPhysicalDeviceSurfaceCapabilitiesKHR, which
significantly improves wsi performance in severely bottlenecked scenarios
now that roundtripping is completely eliminated from acquires in most scenarios,
this improves acquire perf by 10%+
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23835>
Mike Blumenkrantz [Tue, 13 Jun 2023 20:18:44 +0000 (16:18 -0400)]
vk/wsi/x11: move surface alpha check from get_caps to creation
this makes get_caps a bit less heavy
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23835>
xurui [Thu, 6 Jul 2023 03:04:10 +0000 (11:04 +0800)]
zink: Free the cdt when an error occurs
Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24012>
Lionel Landwerlin [Tue, 4 Jul 2023 12:06:50 +0000 (15:06 +0300)]
nir/opt_shrink_vectors: enable sparse intrinsics shrinking
Image sparse loads can be stripped from their sparse component if
unused and turned into non sparse variants.
Texture sparse accesses can also be turned off if unused.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23995>
Lionel Landwerlin [Sat, 1 Jul 2023 20:36:19 +0000 (23:36 +0300)]
intel/fs: disable coarse pixel shader with interpolater messages at sample
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9292
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23962>
Antonio Gomes [Wed, 5 Jul 2023 01:08:01 +0000 (22:08 -0300)]
rusticl: Drop Program::kernel_count
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23999>
Antonio Gomes [Wed, 5 Jul 2023 00:33:41 +0000 (21:33 -0300)]
rusticl: Drop some Kernel data and have a NirKernelBuild ref instead
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23999>
Erik Faye-Lund [Mon, 26 Jun 2023 07:43:07 +0000 (09:43 +0200)]
tgsi: uint -> unsigned
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 08:25:50 +0000 (10:25 +0200)]
tgsi: uint -> uint32_t
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 09:57:39 +0000 (11:57 +0200)]
tgsi: use enum for interpolate-mode
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 09:30:57 +0000 (11:30 +0200)]
tgsi: use enum for shader-type
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 09:51:26 +0000 (11:51 +0200)]
tgsi: use enum for property-name
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 09:21:08 +0000 (11:21 +0200)]
tgsi: use enum for tgsi-file type
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 08:31:40 +0000 (10:31 +0200)]
tgsi: use stdint.h types
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 30 Jun 2023 11:24:36 +0000 (13:24 +0200)]
tgsi: use enum instead of defines
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 07:43:07 +0000 (09:43 +0200)]
aux/util: uint -> unsigned
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 08:31:37 +0000 (10:31 +0200)]
aux/util: use stdint.h types
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:46:48 +0000 (16:46 +0200)]
aux/util: use unsigned instead of uint
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:50:49 +0000 (16:50 +0200)]
aux/util: use enum for primitive-type
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:48:29 +0000 (16:48 +0200)]
aux/util: match type of pipe_draw_start_count_bias::start/count
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:46:30 +0000 (16:46 +0200)]
aux/util: use enum for render-condition
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:43:42 +0000 (16:43 +0200)]
aux/pp: use unsigned instead of uint
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:21:37 +0000 (16:21 +0200)]
gallivm: use unsigned instead of uint
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:19:10 +0000 (16:19 +0200)]
pipebuffer: use unsigned instead of uint
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Fri, 23 Jun 2023 14:17:11 +0000 (16:17 +0200)]
aux/trace: use stdint.h types
...as well as stdbool.h ;)
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>
Erik Faye-Lund [Mon, 26 Jun 2023 13:38:30 +0000 (15:38 +0200)]
math: drop MAT_[ST][XYZ] defines
These were used a single time each, and that argually made the code a
bit more confusing to read. Let's just drop these, and use the correct
indexes directly.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24003>
Erik Faye-Lund [Mon, 26 Jun 2023 13:24:38 +0000 (15:24 +0200)]
math: remove unused defines
Since libmesa_classic got removed, we no longer have the assembly
sources that used these defines, so let's get rid of them.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24003>
Erik Faye-Lund [Mon, 26 Jun 2023 13:52:55 +0000 (15:52 +0200)]
math: fix indentation in m_matrix.[ch]
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24003>
Zhang Ning [Fri, 9 Jun 2023 01:52:18 +0000 (09:52 +0800)]
lima: use u_pipe_screen_lookup_or_create in the renderonly path too
close #8739
Signed-off-by: Zhang Ning <zhangn1985@outlook.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23538>
QwertyChouskie [Thu, 6 Jul 2023 04:32:31 +0000 (04:32 +0000)]
docs/features.txt(fix): mark VK_EXT_pipeline_robustness as supported on radv
This was implemented in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24013>
Marek Olšák [Thu, 22 Jun 2023 11:15:02 +0000 (07:15 -0400)]
vbo: correctly restore _VaryingInputs for display list fast path
Fixes:
3a294ff0 - mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9007
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23796>
Timothy Arceri [Wed, 5 Jul 2023 02:48:34 +0000 (12:48 +1000)]
st/glsl: merge st_glsl_to_ir.cpp with st_glsl_to_nir.cpp
There is no longer any other IR so lets finally merge these together
to make the code easier to follow.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Jul 2023 02:35:51 +0000 (12:35 +1000)]
st/glsl: merge st_link_glsl_to_nir() into st_link_nir()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Jul 2023 02:31:30 +0000 (12:31 +1000)]
st/glsl: merge link_shader() into st_link_nir()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 22 Jun 2023 04:33:53 +0000 (14:33 +1000)]
glsl: remove glsl ir optimisation loop from linker
We no longer need to call this here and can depend on the glsl_to_nir
pass to call it and clean up anything it cannot handle. Everything
else can now depend on the nir optimisation passes.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 22 Jun 2023 04:26:12 +0000 (14:26 +1000)]
glsl: move store_fragdepth_layout() to nir linker
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 21 Jun 2023 03:26:10 +0000 (13:26 +1000)]
glsl: drop link_invalidate_variable_locations()
All this code does is reinitialise the values to what the original
ir_variable() call already set them too. This code is very old dating
to the initial glsl compiler support, it has probably been unrequired
for a long time now.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 21 Jun 2023 03:09:51 +0000 (13:09 +1000)]
glsl: set last_vert_prog in the nir linker
Another step to removing the GLSL IR linker
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 21 Jun 2023 03:02:46 +0000 (13:02 +1000)]
glsl: inline link_varyings()
Most code has already been moved to the NIR linker.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Apr 2023 04:05:59 +0000 (14:05 +1000)]
glsl: remove the always_active_io flag from GLSL IR
No longer used.
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Apr 2023 04:01:34 +0000 (14:01 +1000)]
glsl: move disable_varying_optimizations_for_sso() to NIR linker
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Apr 2023 02:09:19 +0000 (12:09 +1000)]
nir/glsl: add nir_var_declared_implicitly enum
This will be used in the following patch.
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Wed, 5 Apr 2023 02:30:24 +0000 (12:30 +1000)]
glsl: drop the dce of global vars from GLSL IR linker
All this does is compilcate things such as forcing us to set
var->data.always_active_io in the glsl linker. Just let NIR clean
these up for us instead.
A Zink test hits a new assert but this is not a regression it just
uncovers an existing mesa bug.
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 4 May 2023 02:13:44 +0000 (12:13 +1000)]
glsl: remove unused system vars
System vars are added to the resource list as inputs so remove any
dead ones before building the list.
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 4 May 2023 01:24:07 +0000 (11:24 +1000)]
glsl: remove unused buffer objects with packed layout
These are currently removed by the GLSL IR DCE pass but we will
drop that in a following patch. Also there are scenarios where these
might not be detected as unused until the NIR optimisations have
been run so we really need to do it here too anyway.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 6 Apr 2023 04:18:44 +0000 (14:18 +1000)]
glsl: call assign_attribute_or_color_locations() in NIR linker
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 6 Apr 2023 04:17:12 +0000 (14:17 +1000)]
glsl: port assign location code for VS inputs or FS outputs
Here we port the code to the NIR linker.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 22 Jun 2023 00:33:41 +0000 (10:33 +1000)]
glsl: move lowering linker code out of st
Move all these lowering calls into the linker where they belong. This
makes future changes to the linker more flexible and is needed to
allow some following patches as we need to call things in a specific
order.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 22 Jun 2023 00:24:05 +0000 (10:24 +1000)]
glsl: move some compiler code out of st
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 22 Jun 2023 00:18:53 +0000 (10:18 +1000)]
mesa: add some new constants
These will be used by the compiler in a following patch.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Timothy Arceri [Thu, 6 Apr 2023 01:58:16 +0000 (11:58 +1000)]
glsl: add some more c wrappers for string_to_uint_map
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>
Iago Toral Quiroga [Wed, 5 Jul 2023 08:38:07 +0000 (10:38 +0200)]
broadcom/compiler: don't leak v3d_compile when finding a new best strategy
If we had selected a best strategy and find an even better one we need to
make sure we free the previous one.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24001>
Iago Toral Quiroga [Wed, 5 Jul 2023 08:40:34 +0000 (10:40 +0200)]
broadcom/compiler: free defin and defout arrays if they already exist
Just like we do for everything else here, since we are going to realloc
them again right below. Notice this is not exactly a memory leak, since
all these arrays are allocated with ralloc using v3d_compile as context,
so all allocations will be eventually freed when the context is destroyed.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24001>
Danylo Piliaiev [Tue, 4 Jul 2023 16:07:43 +0000 (18:07 +0200)]
tu: Add missing dbg reg stomping to tu_CmdBeginRendering
Also we shouldn't stomp PC_DRAW_INDX_BASE - we never use it and
stomping it together with some other reg leads to a fault.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23993>
Konstantin Seurer [Tue, 4 Jul 2023 19:01:23 +0000 (21:01 +0200)]
llvmpipe,lavapipe: Relayout lp_descriptor
This is more robust in case of a descriptor type mismatch.
Fixes test_null_descriptor_mismatch_type (vkd3d-proton).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
Konstantin Seurer [Tue, 4 Jul 2023 17:05:08 +0000 (19:05 +0200)]
llvmpipe: Allocate more dummy sample functions for FORMAT_NONE
When a null texture is sampled with a non-null sampler, having only one
set of sample functions would lead to an OOB read.
Fixes test_null_srv (vkd3d-proton).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
Konstantin Seurer [Tue, 4 Jul 2023 16:24:30 +0000 (18:24 +0200)]
llvmpipe: Allow comparison sampling for float formats
Fixes test_gather_c (vkd3d-proton).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
Konstantin Seurer [Tue, 4 Jul 2023 16:10:18 +0000 (18:10 +0200)]
lavapipe: Set the descriptor count to what vkd3d-proton requires
vkd3d-proton tries to allocate a maximum size descriptor set. The
previous limits were to high for that to work reliably.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
Konstantin Seurer [Tue, 4 Jul 2023 15:48:58 +0000 (17:48 +0200)]
gallivm: Fix atomic_global types
Passes LLVM validation on the test_mesh_shader_rendering vkd3d-proton
test.
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
Sviatoslav Peleshko [Mon, 3 Jul 2023 06:45:29 +0000 (09:45 +0300)]
glsl: Fix yylloc.source propagation in YYLLOC_DEFAULT
Currently, it's always initialized to 0, but we should take the value from
the grouping passed to the macro. This way parser will have the full
location info, and errors originating from it will show the correct
source file number.
Fixes:
a0cfe8c4 ("glsl: Fix missing initialization of yylloc.source")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9229
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23966>
Patrick Lerda [Thu, 22 Jun 2023 11:11:07 +0000 (13:11 +0200)]
radeonsi: fix refcnt imbalance related to util_blitter_save_fragment_constant_buffer_slot()
Indeed, util_blitter_clear() requires a call to
util_blitter_save_fragment_constant_buffer_slot(),
but most other blitter functions do not.
For instance, this issue is triggered with:
"piglit/bin/object-namespace-pollution glDrawPixels buffer -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.
Fixes:
03bc7503d471 ("radeonsi: save the fs constant buffer to the util blitter context")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23856>
Dave Airlie [Wed, 5 Jul 2023 04:01:05 +0000 (14:01 +1000)]
clc: llvm 17 requires opaque pointers.
You can't turn this off for llvm17+, this at least makes things
run against llvm git now instead of blowing up in clang.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24000>
Pavel Ondračka [Fri, 23 Jun 2023 08:39:16 +0000 (10:39 +0200)]
r300: assert that every writer has a reader
Dead writes can lead to problems with regalloc, so add a safety assert
to catch such cases in the vertex shaders at least in the meantime.
Additionally we could think there are no readers due to some shortcoming
of out dataflow analysis or some other bug which we would also like to
know about.
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
Pavel Ondračka [Thu, 15 Jun 2023 11:57:48 +0000 (13:57 +0200)]
r300: disable ntt regalloc for vertex shaders
We have much better regalloc in the backend, and additionally having
a close to ssa form means some optimizations can be more effective.
RV370:
total instructions in shared programs: 82500 -> 81645 (-1.04%)
instructions in affected programs: 32147 -> 31292 (-2.66%)
helped: 396
HURT: 1
total temps in shared programs: 12355 -> 12465 (0.89%)
temps in affected programs: 368 -> 478 (29.89%)
helped: 5
HURT: 96
GAINED: shaders/trine/vp-237.shader_test VS
GAINED: shaders/trine/vp-79.shader_test VS
RV530:
total instructions in shared programs: 130706 -> 129684 (-0.78%)
instructions in affected programs: 40902 -> 39880 (-2.50%)
helped: 428
HURT: 1
total temps in shared programs: 16811 -> 16920 (0.65%)
temps in affected programs: 421 -> 530 (25.89%)
helped: 7
HURT: 89
The instruction decrease is from the channel merging pass which can be
much more agressive when we have ssa-like form.
The temp regressions are cases where we merge something like
3: MAD output[1].xy, const[8].xy__, input[1].ww__, temp[0].xy__;
....
12: MOV output[1].zw, none.__00;
We always merge the first instruction into the second one, which means
the liverange for temp[0] will be unnecessarily extended here.
This can be fixed with the following draft MR
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19790
however if we ever get a VS pair scheduling support this will be solved
as well as a consequence, so let it be for now.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7693
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
Pavel Ondračka [Thu, 15 Jun 2023 11:29:50 +0000 (13:29 +0200)]
r300: remove most of backend contant folding
This is now done in NIR. The remaining one for ADD + 0 to MOV is kept
until we move some remaining part of FS lowering to NIR.
There single regressions is in one d3d->glsl shader from Wine.
Wine sets invariant for glPosition which translates to exact bit for all
calculations leading to it (or the TGSI PRECISE flag). r300 backend
ignores is completelly, so removing the backend optimizations should
even make us more correct in this regards.
RV530:
total instructions in shared programs: 130705 -> 130706 (<.01%)
instructions in affected programs: 16 -> 17 (6.25%)
helped: 0
HURT: 1
RV370: no change
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
Pavel Ondračka [Thu, 15 Jun 2023 07:27:59 +0000 (09:27 +0200)]
r300: add some early safe bool lowering
This lowers some of the bool-producing comparisons and following bcsels
if the bool comparison results is only used in the bcsel.
This is a temporary solution before we can fork ntt and optimize
the pass sequence there. Right now if we have something like
bcsel(a,b,0.0) we lower it to flrp in nir_lower_bool_to_float. The
flrp goes to backend where it will be lowered to 2 MADs. However in this
case with one of the arguments being a constant one MAD is enough. The
backend can figure this out in the constant folding pass, however this
is actually one of the last things we need it for. So if we do early
translation of the bcsels, than the algebraic pass can clean it up and
we can remove more backend code in the next patch.
no significant change with RV370 shader-db:
total instructions in shared programs: 82497 -> 82496 (<.01%)
instructions in affected programs: 1029 -> 1028 (-0.10%)
helped: 4
HURT: 3
total temps in shared programs: 12351 -> 12355 (0.03%)
temps in affected programs: 10 -> 14 (40.00%)
helped: 0
HURT: 4
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
Pavel Ondračka [Fri, 23 Jun 2023 12:30:44 +0000 (14:30 +0200)]
r300: lower undefs to zero
They will get translated to read from random register otherwise, which is
not problematic per se, but they will not be regalloced and if the
initial register index was too high, we can fail the shader compilation
because we think we run out of registers.
Almost no effect with shader-db on RV530:
total instructions in shared programs: 130707 -> 130705 (<.01%)
instructions in affected programs: 1012 -> 1010 (-0.20%)
helped: 2
HURT: 1
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
Yonggang Luo [Tue, 4 Jul 2023 08:47:45 +0000 (16:47 +0800)]
radeonsi: Use ALIGN_POT instead ALIGN_TO
ALIGN_POT would be a bit faster as it's have no divide arithmetic
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23987>
Friedrich Vock [Fri, 2 Jun 2023 12:40:12 +0000 (14:40 +0200)]
radv: Re-enable RT pipeline capture/replay handles
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Wed, 7 Jun 2023 07:54:50 +0000 (09:54 +0200)]
radv/rt: Rework radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 15:41:58 +0000 (17:41 +0200)]
radv/rt: Replay shader allocations according to capture/replay handle
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 15:38:35 +0000 (17:38 +0200)]
radv/rt: Associate capture/replay handles with stages
For stages where the capture/replay handle is only known after compiling
and uploading the shader, the shader needs to be relocated to the VA
corresponding to the capture/replay address.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 15:36:31 +0000 (17:36 +0200)]
radv/rt: Only compare the non-recursive capture/replay handle
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 15:44:12 +0000 (17:44 +0200)]
radv: Add radv_rt_capture_replay_handle
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 12:39:04 +0000 (14:39 +0200)]
radv: Add support for creating capture/replay shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Fri, 2 Jun 2023 12:37:07 +0000 (14:37 +0200)]
radv: Split up implementation of radv_shader_create
This will make it easy to re-use the split-up parts for creating
replayed shaders.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Wed, 7 Jun 2023 09:12:51 +0000 (11:12 +0200)]
radv: Break up radv_shader_nir_to_asm
radv_shader_nir_to_asm actually had 3 functions: compiling the NIR to
asm, uploading the shaders and generating debug info for them.
This reduces the functionality of radv_shader_nir_to_asm to only compile
NIR to asm. Uploading the shader and generating debug info is split into
separate functions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>
Friedrich Vock [Thu, 1 Jun 2023 20:24:45 +0000 (22:24 +0200)]
radv: Add radv_shader_reupload
Used for relocating RT shaders with capture/replay.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23516>