platform/upstream/mesa.git
17 months agofreedreno/a6xx: Remove needs_invalidate flag
Rob Clark [Wed, 15 Feb 2023 20:03:01 +0000 (12:03 -0800)]
freedreno/a6xx: Remove needs_invalidate flag

Whether the rsc seqno has changed tells us whether we need to update.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agofreedreno/a6xx: Add a way to assert valid format
Rob Clark [Wed, 15 Feb 2023 19:48:44 +0000 (11:48 -0800)]
freedreno/a6xx: Add a way to assert valid format

Layout transitions caused by access as a various format must happen at
state bind time, before batch_draw_tracking().  Add a helper to assert
this fact.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agofreedreno/a6xx: Fix sampler view rsc_seqno for X32_S8X24
Rob Clark [Sun, 12 Feb 2023 17:57:50 +0000 (09:57 -0800)]
freedreno/a6xx: Fix sampler view rsc_seqno for X32_S8X24

Elsewhere we are comparing it against the seqno for the "primary" z32
buffer, so be consistent.  Otherwise we'll think we need to re-validate
every time the sampler view is bound.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agofreedreno/a6xx: Drop unneed fd6_texture_state() arg
Rob Clark [Sun, 12 Feb 2023 16:38:52 +0000 (08:38 -0800)]
freedreno/a6xx: Drop unneed fd6_texture_state() arg

It is redundant with shader type (stage).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agofreedreno/a6xx: Fix set_sampler_views(start != 0)
Rob Clark [Sat, 11 Feb 2023 20:36:25 +0000 (12:36 -0800)]
freedreno/a6xx: Fix set_sampler_views(start != 0)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agofreedreno/a6xx: Move rsc seqno out of tex cache key
Rob Clark [Sat, 11 Feb 2023 20:28:52 +0000 (12:28 -0800)]
freedreno/a6xx: Move rsc seqno out of tex cache key

Since we invalidate tex cache entries if an associated pipe_resource is
rebound, we don't rely on the rsc_seqno being part of the tex cache key.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>

17 months agoaco: fix pathological case in LdsDirectVALUHazard
Rhys Perry [Mon, 20 Feb 2023 14:37:33 +0000 (14:37 +0000)]
aco: fix pathological case in LdsDirectVALUHazard

Similar to bfd4ac4581bae0d36b2c58524131f91c7c0d27ce.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 296b4d95a3e ("aco/gfx11: workaround LdsDirectVALUHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21423>

17 months agoamd,nir: remove byte_permute_amd intrinsic
Georg Lehmann [Tue, 21 Feb 2023 13:06:46 +0000 (14:06 +0100)]
amd,nir: remove byte_permute_amd intrinsic

It's unused and if we ever want to use it again we should make it an alu
opcode instead.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21445>

17 months agodocs: include explicit `setup` in instructions
Eric Engestrom [Wed, 22 Feb 2023 15:43:57 +0000 (15:43 +0000)]
docs: include explicit `setup` in instructions

The implicit `meson builddir/` is deprecated, and while we have fixed
our scripts, we forgot to update the docs we give our users ^^'

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21468>

17 months agoradeonsi/video: use specific PIPE_BIND_ value for video buffers
Pierre-Eric Pelloux-Prayer [Wed, 15 Feb 2023 14:18:52 +0000 (15:18 +0100)]
radeonsi/video: use specific PIPE_BIND_ value for video buffers

Since 13cb41f6662 PIPE_BIND_SHARED was used to allocate driver internal
video buffers. These buffers are never shared, but the intent was to
get non-suballocated buffers and SHARED was used as an indirect flag.

This commit switches to PIPE_BIND_CUSTOM which isn't used anywhere else,
and is now translated as "no suballocation".

The main benefit here is that this allows these buffers to set
use_reusable_pool to true reducing the CPU overhead a lot.

For instance, running the following command on my system:

   ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
       -i tears_of_steel_1080p.mov -an -c:v h264_vaapi output.mp4

takes 35 sec with this commit vs 45 sec without.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21416>

17 months agomesa: use mesa_log from output_if_debug
Chia-I Wu [Sat, 18 Feb 2023 02:15:45 +0000 (18:15 -0800)]
mesa: use mesa_log from output_if_debug

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agomesa: add missing newlines for _mesa_debug/_mesa_log callers
Chia-I Wu [Sat, 18 Feb 2023 02:27:20 +0000 (18:27 -0800)]
mesa: add missing newlines for _mesa_debug/_mesa_log callers

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: add logger_windbg
Chia-I Wu [Sat, 18 Feb 2023 01:44:29 +0000 (17:44 -0800)]
util/log: add logger_windbg

Because output_if_debug has it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: add support for MESA_LOG_FILE
Chia-I Wu [Sat, 18 Feb 2023 01:37:27 +0000 (17:37 -0800)]
util/log: add support for MESA_LOG_FILE

It allows logger_file to log to any file.

v2: check "geteuid() == getuid()"

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: add logger_syslog
Chia-I Wu [Sat, 18 Feb 2023 00:15:21 +0000 (16:15 -0800)]
util/log: add logger_syslog

This is useful when the app is a daemon.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: improve logger_android
Chia-I Wu [Fri, 17 Feb 2023 23:22:17 +0000 (15:22 -0800)]
util/log: improve logger_android

Avoid __android_log_vprint which can truncate messages.  Also add
MESA_LOG=wait to lower the chance of logger_android dropping messages.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: improve logger_file newline handling
Chia-I Wu [Tue, 21 Feb 2023 18:02:35 +0000 (10:02 -0800)]
util/log: improve logger_file newline handling

Add logger_vasnprintf that will be used by other loggers.  For
logger_file, it improves newline handling for

  mesa_logd("%s", "hello\n");

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: allow multiple loggers
Chia-I Wu [Fri, 17 Feb 2023 23:17:26 +0000 (15:17 -0800)]
util/log: allow multiple loggers

It still logs to logcat on Android and stderr otherwise by default.
MESA_LOG is introduced to override the loggers.

v2: add va_copy

Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agoutil/log: refactor mesa_log
Chia-I Wu [Fri, 17 Feb 2023 22:58:02 +0000 (14:58 -0800)]
util/log: refactor mesa_log

Add logger_file and logger_android.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>

17 months agov3dv: handle ASPECT_MEMORY_PLANE aspect flags when getting plane number
Alejandro Piñeiro [Mon, 20 Feb 2023 22:40:12 +0000 (23:40 +0100)]
v3dv: handle ASPECT_MEMORY_PLANE aspect flags when getting plane number

As we support VK_EXT_image_drm_format_modifier, we could receive
VK_IMAGE_ASPECT_MEMORY_PLANE_0/1/2_BIT_EXT flags.

Fixes several tests like this:
dEQP-VK.drm_format_modifiers.create_explicit_modifier.*

when using CTS 1.3.5.0

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21463>

17 months agoloader: do not check the mesa DRI_Mesa version if it was not found
Sebastian Wick [Mon, 20 Feb 2023 18:28:02 +0000 (19:28 +0100)]
loader: do not check the mesa DRI_Mesa version if it was not found

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Fixes: 1026d2934419 ("dri: Introduce internal Mesa DRI driver loader extension.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21429>

17 months agonir: Skip samplers and textures in lower_explicit_io
Karol Herbst [Wed, 15 Feb 2023 21:34:46 +0000 (22:34 +0100)]
nir: Skip samplers and textures in lower_explicit_io

We have specialized lowering passes dealing with most of that already:
1. gl_nir_lower_samplers_as_deref
2. nir_lower_samplers
3. nir_lower_cl_images

If we need more than that, those passes can deal with following deref
chains as well.

We _might_ need to improve nir_lower_cl_images a bit for more complex
kernels, but CL also doesn't allow indirect images, so we are always able
to optimize the entire deref chain away.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agorusticl: allocate printf buffer as staging
Karol Herbst [Wed, 16 Nov 2022 17:13:12 +0000 (18:13 +0100)]
rusticl: allocate printf buffer as staging

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agorusticl: no compute only
Karol Herbst [Fri, 30 Sep 2022 00:29:49 +0000 (02:29 +0200)]
rusticl: no compute only

This might be a good optimization, but we should figure first what drivers
should be able to disable and what not first.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agorusticl/device: limit CL_DEVICE_MAX_CONSTANT_ARGS
Karol Herbst [Thu, 16 Feb 2023 14:46:30 +0000 (15:46 +0100)]
rusticl/device: limit CL_DEVICE_MAX_CONSTANT_ARGS

At the moment we implement constant memory as normal global memory, but
we still should limit to the actual constant buffer cap once we properly
use UBOs for that.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agorusticl/device: fix some device limits
Karol Herbst [Thu, 29 Sep 2022 01:03:26 +0000 (03:03 +0200)]
rusticl/device: fix some device limits

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agollvmpipe/ci: increase deqp-runner timeout
Karol Herbst [Mon, 20 Feb 2023 13:34:46 +0000 (14:34 +0100)]
llvmpipe/ci: increase deqp-runner timeout

Some of the OpenCL tests are flaky, because they just take that long.
Builtins can generated really complex code and if we are unlucky they can
timeout.

Proper support for functions would also solve the issue, probably, but for
now increase the deqp-runner timeout so it's less of an annoyence.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

17 months agoradv/ci: cleanup CI lists for dEQP-VK.memory.* tests that timeout
Samuel Pitoiset [Wed, 22 Feb 2023 11:44:33 +0000 (12:44 +0100)]
radv/ci: cleanup CI lists for dEQP-VK.memory.* tests that timeout

These tests usually take more than 30s to complete, so exclude them
completely instead. This should also make runs slightly faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21464>

17 months agobroadcom/ci: re-enable egl on wayland
Eric Engestrom [Mon, 13 Feb 2023 15:25:06 +0000 (15:25 +0000)]
broadcom/ci: re-enable egl on wayland

Swap them, as suggested by @enunes, to avoid a ton of timeouts in
wayland if the x11 tests ran first.

Needs to be investigated, but at least like this we can get the CI
coverage back.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>

17 months agobroadcom/ci: add two known failures
Eric Engestrom [Sat, 18 Feb 2023 13:02:32 +0000 (13:02 +0000)]
broadcom/ci: add two known failures

The first one in a Pass on both the rpi and the simulator, while the second
one is skipped as NotSupported on both. No idea why it's failing on the
CI, but at least it's consistently failing...

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>

17 months agobroadcom/ci: skip buffer_age.no_preserve and swap_buffers_with_damage on wayland
Eric Engestrom [Mon, 13 Feb 2023 22:07:23 +0000 (22:07 +0000)]
broadcom/ci: skip buffer_age.no_preserve and swap_buffers_with_damage on wayland

They hang the runner, but they all pass fine on my rpi.
Will need investigating, but for now skip them.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>

17 months agobroadcom/ci: drop create_pixmap_surface from the fails; it passes now
Eric Engestrom [Sat, 18 Feb 2023 11:34:17 +0000 (11:34 +0000)]
broadcom/ci: drop create_pixmap_surface from the fails; it passes now

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>

17 months agobroadcom/ci: add x11- prefix to x11 EGL tests
Eric Engestrom [Mon, 13 Feb 2023 15:25:06 +0000 (15:25 +0000)]
broadcom/ci: add x11- prefix to x11 EGL tests

Makes things more obvious now that we're enabling wayland as well.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>

17 months agozink: get rid of needless dependency
Erik Faye-Lund [Tue, 21 Feb 2023 09:36:01 +0000 (10:36 +0100)]
zink: get rid of needless dependency

We haven't needed this header since 7f56fd96550 ("zink: it's kopperin'
time"), so let's get rid of it and the dependency that comes with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>

17 months agozink: prefer vulkan_core.h over vulkan.h
Erik Faye-Lund [Fri, 17 Feb 2023 15:29:58 +0000 (16:29 +0100)]
zink: prefer vulkan_core.h over vulkan.h

There's just two places where we need any of the WSI specific vulkan
includes, the rest of Zink should do just fine with vulkan_core.h. So
let's include the win32-specific header explicitly in those two places,
and reduce the need for WSI specifics inside zink itself. Kopper
handles the rest of the WSI integration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>

17 months agoanv: Use vk_acceleration_structure
Konstantin Seurer [Wed, 22 Feb 2023 10:23:51 +0000 (11:23 +0100)]
anv: Use vk_acceleration_structure

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>

17 months agoradv: Use vk_acceleration_structure
Konstantin Seurer [Wed, 1 Feb 2023 10:01:52 +0000 (11:01 +0100)]
radv: Use vk_acceleration_structure

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>

17 months agovulkan: Add vk_acceleration_structure
Konstantin Seurer [Wed, 1 Feb 2023 09:59:46 +0000 (10:59 +0100)]
vulkan: Add vk_acceleration_structure

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>

17 months agomeson: add basic support for loongarch
Sui Jingfeng [Wed, 8 Feb 2023 01:36:24 +0000 (09:36 +0800)]
meson: add basic support for loongarch

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21182>

17 months agoradv: set VS_OUT_MISC_SIDE_BUS_ENA for clip distances on GFX10.3+
Samuel Pitoiset [Tue, 21 Feb 2023 08:12:24 +0000 (09:12 +0100)]
radv: set VS_OUT_MISC_SIDE_BUS_ENA for clip distances on GFX10.3+

On GFX10.3, all auxiliary position exports are optimized, so set it
for clip/cull distances. Both RadeonSI and llpc set it too.

Suggested by Marek.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21439>

17 months agodriconf: add zink glthread disable for a game
Mike Blumenkrantz [Mon, 20 Feb 2023 16:03:42 +0000 (11:03 -0500)]
driconf: add zink glthread disable for a game

ref #8333

fixes #8328

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21424>

17 months agozink: make ZINK_DESCRIPTOR_MODE=db the default
Mike Blumenkrantz [Fri, 17 Feb 2023 22:32:50 +0000 (17:32 -0500)]
zink: make ZINK_DESCRIPTOR_MODE=db the default

this has been getting beat up a lot lately by radv ci (and me),
so it should be ready to turn on by default for even more testing
in advance of the 23.1 release

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>

17 months agozink: move db input attachment size check to screen init
Mike Blumenkrantz [Mon, 20 Feb 2023 13:51:31 +0000 (08:51 -0500)]
zink: move db input attachment size check to screen init

it'd be weird to crash later on after allowing db mode to init

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>

17 months agoir3: Add cat7 sleep instruction
Danylo Piliaiev [Thu, 6 Jan 2022 14:24:20 +0000 (16:24 +0200)]
ir3: Add cat7 sleep instruction

Has short and long variants, long seem to be ~20 times longer.
The exact difference between it and a bunch of nops is unknown.

The emission of this instruction were not observed in the wild.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>

17 months agoir3: Add cat5/cat7 cache related instructions
Danylo Piliaiev [Thu, 6 Jan 2022 14:14:39 +0000 (16:14 +0200)]
ir3: Add cat5/cat7 cache related instructions

- tcinv - Likely Texture Cache Invalidate (unverified)
- icinv - Mostly sure that it is Instruction Cache Invalidate
- dccln - Data Cache Clean
- dcinv - Data Cache Invalidate
- dcflu - Data Cache Flush

The emission of these instructions were not observed in the wild.

TODO: find out the difference between .shr and .all modes of
      dccln, dcinv, dcflu.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>

17 months agodriconf/anv: Apply limit_trig_input_range WA to Rise of the Tomb Raider
Sviatoslav Peleshko [Fri, 17 Feb 2023 21:08:36 +0000 (23:08 +0200)]
driconf/anv: Apply limit_trig_input_range WA to Rise of the Tomb Raider

During its Ambient Occlusion calculations the game ends up calculating
sin/cos of some pretty big values, for which HW produces completely bogus
results (e.g. cos(3929491.25) ~= -0.011, while correct would be ~0.923).

Limit the arguments to the reasonable (-2*Pi; 2*Pi) range with the
limit_trig_input_range WA.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8292
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21396>

17 months agokopper: fix loop iterating for msaa texture creation
Mike Blumenkrantz [Tue, 21 Feb 2023 14:41:37 +0000 (09:41 -0500)]
kopper: fix loop iterating for msaa texture creation

the pipe_resource template values need to always be initialized or
else texture creation fails and rendering is broken

fixes #8331

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21450>

17 months agosvga: use upload buffer if texture has pending changes
Charmaine Lee [Tue, 14 Feb 2023 01:47:39 +0000 (03:47 +0200)]
svga: use upload buffer if texture has pending changes

When establishing a texture transfer map, if there is any pending changes on the
texture, instead of trying direct map with DONTBLOCK first, just
use the upload buffer path.

Fixes piglit tests gen-teximages, arb_copy_images-formats

Cc: mesa-stable
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>

17 months agosvga: fix compatible formats for shareable surfaces
Charmaine Lee [Sat, 4 Feb 2023 02:24:19 +0000 (21:24 -0500)]
svga: fix compatible formats for shareable surfaces

Add typeless format to the compatible format lists for shareable surfaces.

Fixes webgl benchmark crash in eglCreateImage running from firefox on Fedora 37.

Cc: mesa-stable
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>

17 months agosvga: fix resource_get_handle from resource created without SHARED bind flag
Charmaine Lee [Wed, 8 Feb 2023 19:01:14 +0000 (14:01 -0500)]
svga: fix resource_get_handle from resource created without SHARED bind flag

When an EGLImage is created from a 2D texture and used for texture sharing,
the texture surface might not have been created with the SHARED bind flag.
To allow these surfaces for sharing, this patch sets the USAGE SHARED bit
for surfaces that can be potentially used for sharing even when the SHARED
bind flag is not originally set. Instead of unconditionally enabling the
SHARED bind flag for all surfaces and unnecessarily bypass the surface cache
optimization, this patch only enables the USAGE SHARED bit for surfaces
that also have the RENDER TARGET bind flag.
When the surface handle is inquired and if the surface is currently
marked as cachable, we will need to unset the cachable bit so
the surface handle will not be recycled again.

This patch fixes an assertion in svga_resource_get_handle() when the
EGL_MESA_image_dma_buf_export extension is used in webgl benchamrk running
from firefox in Fedora 37.

Cc: mesa-stable
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>

17 months agollvmpipe: only use accurate_a0 hack if there are no textures bound
Roland Scheidegger [Sat, 18 Feb 2023 16:11:04 +0000 (17:11 +0100)]
llvmpipe: only use accurate_a0 hack if there are no textures bound

This hack caused problems with some dx9 tests before (due to mipgen
test using nearest filter sampling with tex coords exactly between two
texels hence being extremely sensitive to arithmetic inaccuracies),
and we can no longer distinguish this by using pixel_offset to not get
it enabled. But to pass other tests we don't really need the hack when
there's texture sampling involved anyway.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21407>

17 months agobroadcom/ci: use weston's xwayland instead of starting X as well
Eric Engestrom [Mon, 13 Feb 2023 15:33:49 +0000 (15:33 +0000)]
broadcom/ci: use weston's xwayland instead of starting X as well

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>

17 months agobroadcom/ci: group x11 and wayland variant of the same test failing
Eric Engestrom [Sat, 18 Feb 2023 21:03:58 +0000 (21:03 +0000)]
broadcom/ci: group x11 and wayland variant of the same test failing

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>

17 months agoradv/rt: Skip instances after loading the entire node
Konstantin Seurer [Mon, 20 Feb 2023 13:34:04 +0000 (14:34 +0100)]
radv/rt: Skip instances after loading the entire node

This avoids waiting for instance_data which can improve performance:

vk_ray_tracing_ao_KHR_app: 0.2% (The TLAS has 2 instances)
Quake II RTX: 1%
Control: 1%

We also have to shuffle around some code to avoid increasing VGPR usage.
That leaves us with the following stats:

Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 165612 -> 165716 (+0.06%)
Instrs: 31446 -> 31460 (+0.04%)
Latency: 596709 -> 554292 (-7.11%)
InvThroughput: 121998 -> 113327 (-7.11%)
VClause: 596 -> 587 (-1.51%)
Copies: 4664 -> 4646 (-0.39%)
PreVGPRs: 620 -> 639 (+3.06%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21421>

17 months agoaco: don't apply modifiers through DPP to unsupported instructions
Rhys Perry [Wed, 8 Feb 2023 16:37:44 +0000 (16:37 +0000)]
aco: don't apply modifiers through DPP to unsupported instructions

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21201>

17 months agoaco: combine a ^ ~b and ~(a ^ b) to v_xnor_b32
Georg Lehmann [Wed, 8 Feb 2023 13:18:15 +0000 (14:18 +0100)]
aco: combine  a ^ ~b and ~(a ^ b) to v_xnor_b32

Foz-DB Navi21:
Totals from 13 (0.01% of 134913) affected shaders:
CodeSize: 225432 -> 225180 (-0.11%)
Instrs: 41973 -> 41908 (-0.15%)
Latency: 297464 -> 297326 (-0.05%)
InvThroughput: 82536 -> 82467 (-0.08%)
Copies: 2452 -> 2440 (-0.49%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21410>

17 months agoutil: Extend vk_enum_to_str with bitmasks
Illia Abernikhin [Mon, 6 Feb 2023 16:36:19 +0000 (18:36 +0200)]
util: Extend vk_enum_to_str with bitmasks
vk_enum_to_str only generates literals for enums with type: @type="enum",
but many enums have type: @type="bitmask" and were not taken into account here.

Main changes:
Empty enums are now always skipped
For bitmasks skipped *MAX_ENUM value

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8173
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21146>

17 months agointel/compiler/mesh: follow the type of offset variable
Marcin Ślusarz [Wed, 15 Feb 2023 12:29:24 +0000 (13:29 +0100)]
intel/compiler/mesh: follow the type of offset variable

This allows copy propagation to kick in, decreasing the overall
number of generated instructions.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>

17 months agointel/compiler/mesh: apply URB payload mask once per program
Marcin Ślusarz [Wed, 1 Feb 2023 16:23:25 +0000 (17:23 +0100)]
intel/compiler/mesh: apply URB payload mask once per program

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>

17 months agonir: simplify nir_block_cf_tree_{next|prev}
Daniel Schürmann [Tue, 14 Feb 2023 08:49:37 +0000 (09:49 +0100)]
nir: simplify nir_block_cf_tree_{next|prev}

Removes some case distinction by first checking if this is
the first/last block of a cf_node.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir/lower_continue_targets: only repair SSA when necessary
Daniel Schürmann [Fri, 3 Dec 2021 10:00:19 +0000 (11:00 +0100)]
nir/lower_continue_targets: only repair SSA when necessary

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir/lower_continue_constructs: special-case Continue Constructs with zero or one...
Daniel Schürmann [Thu, 2 Dec 2021 10:08:31 +0000 (11:08 +0100)]
nir/lower_continue_constructs: special-case Continue Constructs with zero or one predecessors

If a loop has only a single continue, the control flow is already
converged and we can inline the continue construct.
If a loop has no continue statement at all, the Continue Construct
is unreachable and can simply be deleted.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agospirv: use Loop Continue Construct to emit SPIR-V loops and lower after parsing
Daniel Schürmann [Tue, 23 Nov 2021 16:06:36 +0000 (17:06 +0100)]
spirv: use Loop Continue Construct to emit SPIR-V loops and lower after parsing

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir: add lowering for Loop Continue Constructs
Daniel Schürmann [Wed, 1 Dec 2021 16:46:16 +0000 (17:46 +0100)]
nir: add lowering for Loop Continue Constructs

This pass lowers Loop Continue Constructs to the previous solution
by inserting it at the beginning of the loop:

loop {
   if (i != 0) {
      continue construct
   }
   loop body
}

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir: create nir_push_continue() and related helpers
Daniel Schürmann [Thu, 2 Dec 2021 11:26:02 +0000 (12:26 +0100)]
nir: create nir_push_continue() and related helpers

nir_control_flow.h:
  void nir_loop_add_continue_construct(nir_loop *loop);
  void nir_loop_remove_continue_construct(nir_loop *loop);

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir: add assertions that loops don't have a Continue Construct
Daniel Schürmann [Thu, 2 Dec 2021 09:31:56 +0000 (10:31 +0100)]
nir: add assertions that loops don't have a Continue Construct

Hoping that I didn't miss any, this *should* add assertions
to all functions and passes which explicitly handle 'nir_loop'.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agonir: add Continue Construct to nir_loop
Daniel Schürmann [Wed, 1 Dec 2021 16:34:48 +0000 (17:34 +0100)]
nir: add Continue Construct to nir_loop

The added continue_list corresponds to the SPIR-V
Continue Construct and serves as a converged control-flow
construct and is executed after each continue statement
and before the next iteration of the loop body.

Also adds validation rules for loops with Continue Construct

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>

17 months agoglsl: Account for unsized arrays in NIR linker
Caio Oliveira [Sat, 18 Feb 2023 06:36:11 +0000 (22:36 -0800)]
glsl: Account for unsized arrays in NIR linker

Follow the same approach as the pre-NIR linker.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5891
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21401>

17 months agozink/kopper: Add extra swapchain images for Venus
Gert Wollny [Fri, 3 Feb 2023 12:31:49 +0000 (13:31 +0100)]
zink/kopper: Add extra swapchain images for Venus

Together with the previous patch that corrects the number of
swapchain images on Xwayland this gives Zink/Venus a spead
boost in a number of work loads and close the gap or even
surpass VirGL when the benchmark is not GPU bound.
Some numbers:

 zink (Virtio-GPU Venus (Host: RADV RENOIR)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ==================================================================
    OpenArena (FPS)            63.8     60.1     148.5
    Unigine Sancuary (FPS)    129.1    121.4     164.7
    Unigine Tropics (FPS)     107.2     85.7     114.3
    Unigine Heaven (FPS)       48.5     48.0      51.5
    Unigine Valley (FPS)       48.0     45.6      47.4
    Xonotic (FPS)              90.5     59.4      89.2
    GpuTest/Volcano (Points)   2960     2966      3013

  zink (Virtio-GPU Venus (Host: Intel Xe TGL GT2)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ===========================================================
    OpenArena (FPS)          95.1       59.8        78.9
    Unigine Sancuary (FPS)   85.5       76.6        81.8
    Unigine Tropics (FPS)    66.0       59.8        62.7
    Unigine Heaven (FPS)     28.8       28.7        28.0
    Unigine Valley (FPS)     29.0       28.0        27.0
    Xonotic (FPS)            64.2       49.4        51.1
    GpuTest/Volcano (Points) 2855       2718        2747

v2: Fix limiting minImageCount (Mike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>

17 months agovulkan/wsi: Take Xwayland into account for x11_min_image_count
Gert Wollny [Mon, 6 Feb 2023 08:28:38 +0000 (09:28 +0100)]
vulkan/wsi: Take Xwayland into account for x11_min_image_count

For wayland we report a minimum of four swapchain images, so for
Xwayland we should report the same.

v2: Fix typo (Eric)
v3: Make that four images on Xwayland (Daniel)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>

17 months agoasahi: Make shader-db work again
Alyssa Rosenzweig [Thu, 29 Dec 2022 21:43:52 +0000 (16:43 -0500)]
asahi: Make shader-db work again

We need a nontrivial blend state otherwise the whole frag shader is optimized
out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21432>

17 months agoasahi: Implement color masks with masked stores
Alyssa Rosenzweig [Fri, 17 Feb 2023 23:24:38 +0000 (18:24 -0500)]
asahi: Implement color masks with masked stores

Blend states can require masking colour. Currently, this is handled by
nir_lower_blend, which lowers masks to a read-modify-write operation as required
on Mali hardware. However, our "tilebuffer store" instruction supports a write
mask, allowing us to write only a subset of channels to the tilebuffer. It's
more efficient to use that than to emit pointless tilebuffer loads.

Note that even without tilebuffer loads, non-opaque masks don't work with opaque
pass types.  Here, we handle this with a translucent pass type, which gets HSR
to do the right thing and is consistent with the pass type used previously.
However, it's a bit heavy handed -- Apple manages to use an opaque pass type
with masking but with some unknown HSR fields twiddled. IMO reverse-engineering
those details shouldn't block this because this gets us closer to optimal (just
not all the way there) and is strictly better than what we had before.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>

17 months agoagx: Add agx_internal_format_supports_mask helper
Alyssa Rosenzweig [Sat, 18 Feb 2023 17:14:03 +0000 (12:14 -0500)]
agx: Add agx_internal_format_supports_mask helper

Not all formats can be masked, add a query to check which can be.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>

17 months agoagx: Handle ssa_undef as zero
Alyssa Rosenzweig [Fri, 17 Feb 2023 23:35:40 +0000 (18:35 -0500)]
agx: Handle ssa_undef as zero

Masked stores may result in undefs after optimization. Rather than call
lower_undef_to_zero late (but get no benefit), we may as well handle ourselves
to prepare for proper undef support down the line.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>

17 months agoagx: Add and use agx_nir_ssa_index helper
Alyssa Rosenzweig [Fri, 17 Feb 2023 23:35:20 +0000 (18:35 -0500)]
agx: Add and use agx_nir_ssa_index helper

Common subexpression that we'll repeat once more in the next patch.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>

17 months agoradv: enable SQTT tracing on GFX11
Samuel Pitoiset [Thu, 15 Dec 2022 08:03:30 +0000 (09:03 +0100)]
radv: enable SQTT tracing on GFX11

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoradv: disable SPM counters with RGP on GFX11
Samuel Pitoiset [Thu, 16 Feb 2023 10:10:05 +0000 (11:10 +0100)]
radv: disable SPM counters with RGP on GFX11

They are likely different and perfcounters aren't defined on GFX11 yet.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoradv: implement a workaround for SQTT on GFX11
Samuel Pitoiset [Thu, 15 Dec 2022 15:27:16 +0000 (16:27 +0100)]
radv: implement a workaround for SQTT on GFX11

Found in AMDVLK, see the comment below for an explanation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoradv: make sure to wait for the trace buffer also on GFX11
Samuel Pitoiset [Thu, 15 Dec 2022 14:40:35 +0000 (15:40 +0100)]
radv: make sure to wait for the trace buffer also on GFX11

Otherwise, we might get incomplete data.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoradv: only enable SQTT for SE0 on GFX11
Samuel Pitoiset [Thu, 15 Dec 2022 14:39:44 +0000 (15:39 +0100)]
radv: only enable SQTT for SE0 on GFX11

For weird reasons, the hardware doesn't return any data for other SEs.
RadeonSI is also affected by the same issue, enable only SE0 for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoradv: configure SQ_THREAD_TRACE_CTRL.REG_AT_HWM on GFX11
Samuel Pitoiset [Thu, 15 Dec 2022 14:46:06 +0000 (15:46 +0100)]
radv: configure SQ_THREAD_TRACE_CTRL.REG_AT_HWM on GFX11

AMDVLK sets this to 2 when the always stall mode is enabled, which is
the default in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>

17 months agoutil/u_process: implement util_get_command_line for BSDs
Jan Beich [Wed, 1 Feb 2023 23:09:57 +0000 (23:09 +0000)]
util/u_process: implement util_get_command_line for BSDs

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21052>

17 months agowinsys/amdgpu: use amdgpu_device_get_fd
Pierre-Eric Pelloux-Prayer [Mon, 30 Jan 2023 08:59:11 +0000 (09:59 +0100)]
winsys/amdgpu: use amdgpu_device_get_fd

If radv is initialized before radeonsi, doing:

   aws->fd = fd;

is incorrect because the device was initialized using the fd
passed by radv.

libdrm has a helper to query the fd used to create the device,
so use it.

We also need to init the kms_handles table in this case
because we're going to share BOs between radeonsi's fd and
the device fd.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3424
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20983>

17 months agofreedreno: check for conditional rendering in launch_grid
Amber [Mon, 20 Feb 2023 17:20:48 +0000 (18:20 +0100)]
freedreno: check for conditional rendering in launch_grid

fixes: KHR-GL45.compute_shader.conditional-dispatching

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21428>

17 months agoagx: Handle group_memory_barrier
Alyssa Rosenzweig [Mon, 13 Feb 2023 14:00:50 +0000 (09:00 -0500)]
agx: Handle group_memory_barrier

A combination of control_barrier + memory_barrier but it's always seen with
those. This would be safer with scoped barriers...

Fixes dEQP-GLES31.functional.synchronization.inter_invocation.ssbo

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Implement b2b32
Alyssa Rosenzweig [Thu, 9 Feb 2023 02:27:17 +0000 (21:27 -0500)]
agx: Implement b2b32

Shows up with store_shared.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Pack local atomics
Alyssa Rosenzweig [Thu, 9 Feb 2023 02:16:53 +0000 (21:16 -0500)]
agx: Pack local atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Lower shared memory offsets to 16-bit
Alyssa Rosenzweig [Thu, 9 Feb 2023 01:46:48 +0000 (20:46 -0500)]
agx: Lower shared memory offsets to 16-bit

Per the hardware requirement. This simplifies instruction selection (it avoids
the need to constant fold u2u16 in the backend).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Translate load/store_shared
Alyssa Rosenzweig [Thu, 9 Feb 2023 01:12:04 +0000 (20:12 -0500)]
agx: Translate load/store_shared

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Translate NIR atomics
Alyssa Rosenzweig [Thu, 9 Feb 2023 00:25:37 +0000 (19:25 -0500)]
agx: Translate NIR atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Pack local load/store instructions
Alyssa Rosenzweig [Thu, 9 Feb 2023 01:33:53 +0000 (20:33 -0500)]
agx: Pack local load/store instructions

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Pack global atomics
Alyssa Rosenzweig [Thu, 9 Feb 2023 00:47:02 +0000 (19:47 -0500)]
agx: Pack global atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Disallow immediate bases to device_load
Alyssa Rosenzweig [Mon, 20 Feb 2023 17:49:13 +0000 (12:49 -0500)]
agx: Disallow immediate bases to device_load

Lina pointed this out in review.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Model local loads/stores
Alyssa Rosenzweig [Thu, 9 Feb 2023 01:11:48 +0000 (20:11 -0500)]
agx: Model local loads/stores

Aka shared memory or threadgroup memory.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoagx: Model atomic instructions
Alyssa Rosenzweig [Thu, 9 Feb 2023 00:15:54 +0000 (19:15 -0500)]
agx: Model atomic instructions

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>

17 months agoiris: Export num_fences()
José Roberto de Souza [Fri, 18 Nov 2022 19:55:40 +0000 (11:55 -0800)]
iris: Export num_fences()

This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>

17 months agoiris: Export update_batch_syncobjs()
José Roberto de Souza [Wed, 16 Nov 2022 19:41:56 +0000 (11:41 -0800)]
iris: Export update_batch_syncobjs()

This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>

17 months agoiris: Export batch debug functions
José Roberto de Souza [Fri, 14 Oct 2022 18:04:03 +0000 (11:04 -0700)]
iris: Export batch debug functions

Those function will be called by different backends, so exporting it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>

17 months agoasahi: Advertise ARB_texture_barrier
Alyssa Rosenzweig [Tue, 14 Feb 2023 19:00:49 +0000 (14:00 -0500)]
asahi: Advertise ARB_texture_barrier

We already implement it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>

17 months agoasahi: Advertise ARB_derivative_control
Alyssa Rosenzweig [Tue, 14 Feb 2023 18:56:49 +0000 (13:56 -0500)]
asahi: Advertise ARB_derivative_control

Our native fddx instruction is already fine, so it's fine to use it for both
fddx_coarse and fddx_fine. We handle both of those cases already so the
extension is trivial.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>