These are identical, pull them into a helper so we only have one place
to fix bugs.
(Marked fixes because the next two patches depend on the refactor.)
Fixes: ec2e8bc33f ("intel/compiler: Avoid copy propagating large registers into EOT messages")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36577>
(cherry picked from commit 4151a39b8a)
if a renderpass has ended, the info is signaled and cannot be modified
for anything but resolves and invalidates. when a CSO is then bound
before the next fb state change, there is no way to increment rp info in
a way which keeps it in lockstep with the consumer thread, so storing the
new states until a new rp info is incremented ensures that everything works
as expected
Fixes: 4989a40e89 ("tc: explicitly terminate renderpasses on fb access")
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36576>
(cherry picked from commit 84fb88e5e7)
Using bit_count on the result of ballot doesn't work for targets where
ballot's num_components > 1.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Fixes: d2e1e4442a ("ir3: enable nir_opt_uniform_subgroup")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35669>
(cherry picked from commit ae66bd1c00)
GFX9 might not have DCC but compressed FMASK. In this case, it needs
to be decompressed to handle feedback loops.
Fixes new VKCTS coverage dEQP-VK.dynamic_rendering.*_ms.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36550>
(cherry picked from commit 72cf81df54)
In commit 9ced3148ca ("util: avoid calling UNREACHABLE(str) macro
without arguments", 2025-07-30) the argument type check in the
UNREACHABLE(str) macro in src/util/macros.h was improved to also avoid
calling it without arguments, but the definition in
src/compiler/libcl/libcl.h was not updated.
Apply a similar change to src/compiler/libcl/libcl.h to keep the C and
CL macros in sync.
Fixes: 9ced3148ca ("util: avoid calling UNREACHABLE(str) macro without arguments", 2025-07-30)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> on gfx8 (Polaris 20)
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36508>
(cherry picked from commit 5649a0aa06)
This change ensures a deterministic state compatible with
the expected ARB_shader_image_load_store behavior when an
incomplete shader image is detected.
Note: "spec/arb_shader_image_load_store/invalid/.*/address bounds test/.*"
are not addressed by this change.
This change was tested on cypress, palm, barts and cayman and
fixes the remaining issues concerning the following tests:
khr-gl4[2-6]/shader_image_load_store/incomplete_textures: fail pass
spec/arb_shader_image_load_store/invalid/.*/format mismatch test: fail pass
spec/arb_shader_image_load_store/invalid/.*/incompatible format test: fail pass
spec/arb_shader_image_load_store/invalid/.*/incomplete image test: fail pass
spec/arb_shader_image_load_store/invalid/.*/index bounds test: fail pass
spec/arb_shader_image_load_store/invalid/.*/invalid format test: fail pass
spec/arb_shader_image_load_store/invalid/.*/layer bounds test: fail pass
spec/arb_shader_image_load_store/invalid/.*/level bounds test: fail pass
spec/arb_shader_image_load_store/invalid/.*/target mismatch test: fail pass
spec/arb_shader_image_load_store/invalid/.*/unbound image test: fail pass
Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35685>
(cherry picked from commit d2be9f95e5)
This functionality is working properly on rv770, but some
issues remain for the newer r600 gpus. These issues are not the
same for cypress and for palm and beyond.
As far as palm and beyond is concerned this change is consistent
with the radeonsi commit: 50c95d0c54 "radeonsi: reject some
3-component formats as buffer textures". This is explained
in a comment of this other commit.
This change assumes that all the real evergreen gpus (before
palm) behave like cypress.
This change was tested on palm, barts and cayman. Here are the tests fixed:
deqp-gles3/functional/texture/specification/teximage2d_pbo/rgb16f_cube: fail pass
deqp-gles3/functional/texture/specification/teximage2d_pbo/rgb16i_cube: fail pass
deqp-gles3/functional/texture/specification/teximage2d_pbo/rgb16ui_cube: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgb16f_cube_array: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgb16i_cube_array: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgb16ui_cube_array: fail pass
This change was also tested on cypress. Here are the tests fixed:
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgb565_2d: fail pass
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgb565_cube: fail pass
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgb5_a1_2d: fail pass
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgb5_a1_cube: fail pass
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgba4_2d: fail pass
deqp-gles3/functional/texture/specification/teximage[23]d_pbo/rgba4_cube: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgb565_2d: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgb565_cube: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgb5_a1_2d: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgb5_a1_cube: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgba4_2d: fail pass
deqp-gles3/functional/texture/specification/texsubimage[23]d_pbo/rgba4_cube: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgb565_cube_array: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgb5_a1_cube_array: fail pass
deqp-gles31/functional/texture/specification/teximage3d_pbo/rgba4_cube_array: fail pass
deqp-gles31/functional/texture/specification/texsubimage3d_pbo/rgb565_cube_array: fail pass
deqp-gles31/functional/texture/specification/texsubimage3d_pbo/rgb5_a1_cube_array: fail pass
deqp-gles31/functional/texture/specification/texsubimage3d_pbo/rgba4_cube_array: fail pass
Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35430>
(cherry picked from commit f352491834)
The variable "i" is updated to the type returned by
util_format_get_first_non_void_channel() which is int.
The function is refactored to handle "for_vbo" as false.
Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35430>
(cherry picked from commit bf76e5bb38)
Tracking for those jobs were missing and not reset when the batch was reissued.
Fixes: d1934e44fc ("panvk: Implement occlusion queries for JM")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
(cherry picked from commit ab0f0323e0)
We could end up in situations where the active count wouldn't match the
varying_count causing a memory corruption.
This fix it by not relying on the active count anymore.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 05020699b9 ("panvk: Move the linking bits to panvk_shader")
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
(cherry picked from commit a1a98d1dc5)
this catches the case where an app resolves both color and depth buffers
previously the inlining would only catch the first color buffer, then the depth
resolve which followed would cause the whole of rp tracking to desync and
explode, as seen in Transport Fever 2
Fixes: 8933b3ed39 ("tc: add resolve resource to rp info")
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36521>
(cherry picked from commit a71b6ac41a)
The requirements bump a few weeks ago forgot to update the docs.
Fixes: 1a698c75ae ("build: Rust: Bump minimum Meson and bindgen version")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36526>
(cherry picked from commit eda7043025)
We need to insert a (ss)nop when an instruction that doesn't support
(ss) needs it. However, when this happens in a block that needs to be
legalized more than once (e.g., because it is in a loop), the (ss)nop
would be inserted every iteration, causing an infinite loop.
Fix this by checking if the previous instructions is a nop and applying
(ss) there.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 5993723471 ("freedreno/a3xx/compiler: scheduling/legalize fixes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36440>
(cherry picked from commit c8f9990733)
If the mov node being handled here has modifiers, it cannot be
trivially removed. This happens in some shaders, so handle it
in the identity mov check for that optimization.
Fixes: d6987daef9 ("lima: ppir: introduce an optimizer")
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36490>
(cherry picked from commit 3020d27326)
We were using the maximum of all attachment sizes as the bounding box
for the frame buffer. But in fact we want the minimum, as we do not
want to draw outside of any attachment boundaries.
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36360>
(cherry picked from commit 904a4ab364)
anv_slab_bo_deinit() eventually calls down to anv_device_release_bo()
which locks a yet to be initilized device->bo_cache->mutex leading to:
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x79c25ee54bd8)'
Reorder anv_slab_bo_init() to occur after anv_bo_cache_init() and
anv_slab_bo_deinit() before anv_bo_cache_finish()
Fixes: 3bf6d42fda ("anv: Add the base infrastructure to support memory pool")
Signed-off-by: Juston Li <justonli@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36479>
(cherry picked from commit c8ea72093b)
After commit 2dcd6bed6a ("util: enforce unreachable()'s argument being
a literal string", 2023-04-17) the compiler effectively emit errors when
an argument that is not a string literal is passed to UNREACHABLE(str),
however the compiler still allows the macro to be called without
arguments, which can be confusing.
Implement the type check outside of the assert() call so that we have
two types of errors:
1. The compiler will error out when the argument passed to the macro is
not a string literal because the concatenation with an empty string
will not be allowed.
2. The compiler will error out when no arguments are passed to the macro
because the invocation of assert() will be invalid.
This also has the nice side-effect of removing the extra empty string
printed in the assert() messages; after the changes the messages will
look like:
Assertion `!"Invalid type"' failed.
instead of:
Assertion `!"" "Invalid type"' failed.
Fixes: 2dcd6bed6a ("util: enforce unreachable()'s argument being a literal string", 2023-04-17)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
(cherry picked from commit 9ced3148ca)
The unreachable(str) macro defined in src/util/macros.h is defined to
accept a literal string as an argument.
However the way it checks that the argument is a string literal, by
prepending an empty string where the argument is used, i.e.:
#define unreachabel(str) assert(!"" str)
still allows users to call the macro with no arguments.
This is confusing, so pass an empty string to all invocations of
unreachable() for consistency.
This is done with the following command:
git grep -l '[^_]unreachable();' -- "src/**" | sort | uniq | \
while read file; \
do \
sed -e 's/\([^_]\)unreachable();/\1unreachable("");/g' -i "$file";
done
This should not change the behaviour of the callers of unreachable() in
a meaningful way, but there will be some cosmetic consequence.
The changed invocations will now print:
Assertion `!"" ""' failed.
instead of
Assertion `!""' failed.
But this is also what happens for the invocations that do pass an
argument, for instance `unreachable("Invalid type")` currently prints:
Assertion `!"" "Invalid type"' failed.
So all invocations now also have the same output style.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
(cherry picked from commit b4c7d3a08e)
The private BO can get removed due to WSI aliasing and that breaks the
submission code (expecting one).
Delay the registration on the device to when the image actually gets
bound and there is a private BO.
Fixes: b21e62b71a ("anv: avoid leaking private binding for aliased wsi image")
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36474>
(cherry picked from commit 9efb3ee511)