platform/upstream/mesa.git
22 months agov3dv: drop wayland-protocols dep
Simon Ser [Mon, 21 Nov 2022 10:40:39 +0000 (11:40 +0100)]
v3dv: drop wayland-protocols dep

wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19894>

22 months agogallium/draw: do not use trig to compute tangent
Erik Faye-Lund [Tue, 22 Nov 2022 08:40:12 +0000 (09:40 +0100)]
gallium/draw: do not use trig to compute tangent

We've already done the expensive part of computing this without
trigenometry, e.g computing the length. So let's finish it off.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agogallium/draw: properly fix short aalines
Erik Faye-Lund [Mon, 21 Nov 2022 12:28:00 +0000 (13:28 +0100)]
gallium/draw: properly fix short aalines

The fix we used to have for short smooth lines were incorrect, and
here's the real fix:

For lines shorter than one pixel, we need to clamp the length-wise
coverage to the line-length. That produces results that are consistent
with our approximation for longer lines.

Because we pass (length / 2) + 0.5 to the fragment shader instead of
the unmodified length, we need to spend a few instructions to
reconstruct the original width.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agoaux/draw: vectorize aaline computations
Erik Faye-Lund [Mon, 21 Nov 2022 12:53:04 +0000 (13:53 +0100)]
aux/draw: vectorize aaline computations

This makes it a bit more similar to the TGSI version, which makes
modifying them easier to review.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agodriconf: disable glthread for FINAL FANTASY XI
Jimi Huotari [Tue, 22 Nov 2022 16:59:14 +0000 (18:59 +0200)]
driconf: disable glthread for FINAL FANTASY XI

Enabling 'glthread' here causes textures to be missing/invisible.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7562
Signed-off-by: Jimi Huotari <chiitoo@gentoo.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19935>

22 months agoradv: fix number of PS samples with VK_AMD_mixed_attachment_samples
Samuel Pitoiset [Mon, 21 Nov 2022 17:40:56 +0000 (18:40 +0100)]
radv: fix number of PS samples with VK_AMD_mixed_attachment_samples

From the Vulkan spec:
    "If the VK_AMD_mixed_attachment_samples extension is enabled and
     the subpass uses color attachments, the samples value used to
     create each color attachment is used instead of
     rasterizationSamples."

Found by inspection, though I don't think this extension is widely
used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19907>

22 months agoradv/ci: make use of the new VanGogh runners
Martin Roukala (né Peres) [Tue, 22 Nov 2022 13:38:42 +0000 (15:38 +0200)]
radv/ci: make use of the new VanGogh runners

I just added 3 new Steam Decks at my home CI, bringing the total count
to 5. Let's make use of 2 of these to reduce execution time in Mesa CI
and leave the last one available for DXVK-CI.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19929>

22 months agogenxml: forbid usage of L1CC_WBP/L1CC_UC for stateless messages
Lionel Landwerlin [Fri, 28 Oct 2022 22:39:04 +0000 (01:39 +0300)]
genxml: forbid usage of L1CC_WBP/L1CC_UC for stateless messages

We want to avoid those settings so that we do not have to emit a tile
fence to implement Wa_22013689345.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>

22 months agointel/fs: improve Wa_22013689345 workaround
Lionel Landwerlin [Tue, 16 Aug 2022 08:08:43 +0000 (08:08 +0000)]
intel/fs: improve Wa_22013689345 workaround

The initial implementation is a pretty big hammer. Implement the HW
recommendation to minimize cases in which we need a fence.

This improves by 10FPS on some of the Sascha Willems RT demos.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6031ad4bf690 ("intel/fs: Add Wa_22013689345")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>

22 months agointel/perf: Fix memory leak.
Vinson Lee [Sun, 20 Nov 2022 21:53:06 +0000 (13:53 -0800)]
intel/perf: Fix memory leak.

Fix defect with Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable pass_array going out of scope leaks the storage it points to.

Fixes: d4cbb665067 ("intel/perf: support more than 64 queries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19888>

22 months agoanv: Set 3DSTATE_RASTER API mode as recomended
José Roberto de Souza [Tue, 22 Nov 2022 16:04:58 +0000 (08:04 -0800)]
anv: Set 3DSTATE_RASTER API mode as recomended

TGL+ specification ask the API mode to be set to DX10.1 for Vulkan API.

BSpec: 46947
Reference: TGL PRMs, Volume 2d: Command Reference: Structures: 3DSTATE_RASTER_BODY
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19934>

22 months agovenus: enable VK_KHR_push_descriptor
Dawn Han [Wed, 5 Oct 2022 21:46:12 +0000 (21:46 +0000)]
venus: enable VK_KHR_push_descriptor

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: implement vkCmdPushDescriptorSetWithTemplateKHR
Dawn Han [Mon, 31 Oct 2022 21:19:42 +0000 (21:19 +0000)]
venus: implement vkCmdPushDescriptorSetWithTemplateKHR

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()
Dawn Han [Tue, 22 Nov 2022 20:52:56 +0000 (20:52 +0000)]
venus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: extend lifetime of push descriptor set layout
Dawn Han [Mon, 31 Oct 2022 21:15:31 +0000 (21:15 +0000)]
venus: extend lifetime of push descriptor set layout

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agoradeonsi/ci: update stoney fail -> flakes
David Heidelberg [Tue, 22 Nov 2022 23:29:53 +0000 (00:29 +0100)]
radeonsi/ci: update stoney fail -> flakes

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19941>

22 months agoci: split arm_test into arm{hf,64}_test
David Heidelberg [Sat, 5 Nov 2022 13:36:43 +0000 (14:36 +0100)]
ci: split arm_test into arm{hf,64}_test

Every barebone arm or aarch64 job depends on these.
When experimenting with CI, this job drags both kernel+rootfs_arm64 and armhf,
even when the latter is not used.

This should speed up development and relieve one instance for about 30 minutes
and overlap between finishing kernel+rootfs_arm64 and armhf jobs per change.

Here are some size stats:
old arm_test   904M (32+64)
new arm64_test 579M (64bit)
new armhf_test 402M (32bit)
---
both     ~ 981M (overhead is 81M overall, but never used together so it's only cost "at rest")

Runtime of the arm*_test jobs is ~ 2 minutes.

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: "Sergi Blanch Torné" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19550>

22 months agoci/iris: Drop EGL copyteximage2d.12 xfail.
Emma Anholt [Tue, 22 Nov 2022 19:39:24 +0000 (11:39 -0800)]
ci/iris: Drop EGL copyteximage2d.12 xfail.

It is still marked as a flake (along with other copyteximage cases) on all
these boards, so this will reduce the CI IRC channel noise given that we
actually expect a Pass.  I haven't found where exactly in history we went
from generally-fail to generally-pass, but it looks like around Feb 2022.

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

22 months agoci/llvmpipe: Add headless Wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 01:16:06 +0000 (17:16 -0800)]
ci/llvmpipe: Add headless Wayland testing using weston.

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

22 months agoci/llvmpipe: Drop NIR stress testing from deqp-egl.
Emma Anholt [Fri, 18 Nov 2022 01:15:31 +0000 (17:15 -0800)]
ci/llvmpipe: Drop NIR stress testing from deqp-egl.

This was a pasteo from deqp-gles31.

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

22 months agoci/vc4,v3d: Add headless wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 00:55:34 +0000 (16:55 -0800)]
ci/vc4,v3d: Add headless wayland testing using weston.

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

22 months agoci/iris: Add headless Wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 00:53:14 +0000 (16:53 -0800)]
ci/iris: Add headless Wayland testing using weston.

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

22 months agoci/freedreno: Add wayland testing using weston.
Emma Anholt [Thu, 17 Nov 2022 22:53:33 +0000 (14:53 -0800)]
ci/freedreno: Add wayland testing using weston.

Take the old EGL job and make it a suite, stop segregating the reset tests
now that we assign reset blame appropriately, and add a variant using
headless weston.  This catches two failures we weren't covering before.

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

22 months agoci/freedreno: Drop EGL wide_color and create_context flakes.
Emma Anholt [Tue, 22 Nov 2022 18:57:16 +0000 (10:57 -0800)]
ci/freedreno: Drop EGL wide_color and create_context flakes.

Haven't seen them since May 2021, when my current set of IRC logs start.
The color_clears, render, and sharing.gles2 flakes are definitely still
there.

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

22 months agoci/freedreno: Expire an old robustness flake.
Emma Anholt [Tue, 22 Nov 2022 18:55:28 +0000 (10:55 -0800)]
ci/freedreno: Expire an old robustness flake.

Last happened in January, and Rob made great strides in reset stability
since then so I think it's gone.

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

22 months agoci/deqp-runner: Drop dead code for DEQP_CASELIST_FILTER.
Emma Anholt [Fri, 18 Nov 2022 00:46:39 +0000 (16:46 -0800)]
ci/deqp-runner: Drop dead code for DEQP_CASELIST_FILTER.

The last user is now gone.

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

22 months agoci/freedreno: Stop segregating reset tests from non-reset tests in EGL.
Emma Anholt [Fri, 18 Nov 2022 00:43:33 +0000 (16:43 -0800)]
ci/freedreno: Stop segregating reset tests from non-reset tests in EGL.

Now that we assign reset blame appropriately, they're safe to run
together, and no single-threading.  I put these in a .toml because I'm
about to add another window system.

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

22 months agoci: Add weston to our rootfses for wayland testing.
Emma Anholt [Thu, 17 Nov 2022 19:13:42 +0000 (11:13 -0800)]
ci: Add weston to our rootfses for wayland testing.

We want to be able to test the wayland EGL platform code in Mesa, which
has had no coverage yet.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>

22 months agoci/softpipe: Add another blit flake.
Emma Anholt [Tue, 22 Nov 2022 18:41:53 +0000 (10:41 -0800)]
ci/softpipe: Add another blit flake.

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

22 months agoci/llvmpipe: Update some flakes/skips from IRC logs.
Emma Anholt [Fri, 18 Nov 2022 22:58:44 +0000 (14:58 -0800)]
ci/llvmpipe: Update some flakes/skips from IRC logs.

Acked-by: David Heidelberg <david.heidelberg@collabora.com> (prev version)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>

22 months agor600/sfn: allow building with clang 6 (Android 9)
Mauro Rossi [Mon, 7 Nov 2022 00:57:02 +0000 (01:57 +0100)]
r600/sfn: allow building with clang 6 (Android 9)

static constexpr const 'value' is replaced by static function
in all type_char template specializations
to avoid the following building errors happening with clang 6

/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::ExportInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::ExportInstr>(std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&, std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
...
/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::RatInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::RatInstr>(std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&, std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19873>

22 months agoaco: fix emitting DEALLOC_VGPRS in the discard block
Samuel Pitoiset [Tue, 22 Nov 2022 15:49:13 +0000 (16:49 +0100)]
aco: fix emitting DEALLOC_VGPRS in the discard block

It should be emitted right before s_endpgm.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19931>

22 months agoradv: fix possible hangs with NGG streamout and secondary cmdbuf
Samuel Pitoiset [Thu, 17 Nov 2022 04:43:33 +0000 (04:43 +0000)]
radv: fix possible hangs with NGG streamout and secondary cmdbuf

This was missing but it might hang if streamout is used only in
secondary command buffers.
Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoradv: fix NGG streamout when it's never enabled in runtime
Samuel Pitoiset [Thu, 17 Nov 2022 04:46:43 +0000 (04:46 +0000)]
radv: fix NGG streamout when it's never enabled in runtime

If a shader has XFB outputs but the application never enables
streamout in runtime (no buffers bound and no begin/end pair), we
have to disable it in the shader by emitting buffer size as 0. It's
also still needed to remember that the cmdbuf needs GDS/GDS OA BOs,
so move this at pipeline bind time instead.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoradv: re-mit streamout buffers to unbind them when NGG streamout is disabled
Samuel Pitoiset [Thu, 17 Nov 2022 09:43:21 +0000 (10:43 +0100)]
radv: re-mit streamout buffers to unbind them when NGG streamout is disabled

A buffer size as 0 acts like if streamout is disabled with NGG.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoradv: enable NGG XFB queries only if streamout is enabled
Samuel Pitoiset [Thu, 17 Nov 2022 09:40:01 +0000 (10:40 +0100)]
radv: enable NGG XFB queries only if streamout is enabled

Otherwise, it's possible to increase counters if a shader has XFB but
the application paused it.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoradv: fix computing the pervertex LDS size with NGG streamout
Samuel Pitoiset [Thu, 17 Nov 2022 07:07:25 +0000 (08:07 +0100)]
radv: fix computing the pervertex LDS size with NGG streamout

The NGG streamout lowering pass allocates space for all outputs which
means we have to align our computation. Otherwise, the maximum number
of vertices is incorrect and we end up by reaching the maximum allowed
LDS size. This code could be shared instead of being duplicated but
that's for later.

Fixes some transform feedback tests with Zink and
RADV_PERFTEST=ngg_streamout on GFX10.3.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoradv: stop overallocating LDS for VS/TES when NGG streamout is enabled
Samuel Pitoiset [Thu, 17 Nov 2022 06:53:24 +0000 (07:53 +0100)]
radv: stop overallocating LDS for VS/TES when NGG streamout is enabled

The number of shader outputs should only be considered when the
shader has XFB, otherwise we are overallocating LDS.

fossils-db (GFX1100):
Totals from 16602 (12.31% of 134913) affected shaders:
LDS: 17000448 -> 8500224 (-50.00%)

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>

22 months agoadd zink to macos ci
noasakurajin [Fri, 4 Nov 2022 16:39:10 +0000 (16:39 +0000)]
add zink to macos ci

 This commit causes zink to be build in the macos ci on every commit.
 In addition to that meson will now error if there is no moltenvk-dir
 given on macos since the build would fail anyways.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19531>

22 months agoetnaviv: nir: lower extract byte/word
Christian Gmeiner [Tue, 15 Nov 2022 12:14:15 +0000 (13:14 +0100)]
etnaviv: nir: lower extract byte/word

Fixes e.g. 'Unhandled ALU op: extract_u16' seen with deqp on gc7000.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>

22 months agoetnaviv: Support negative float inline immediates
Christian Gmeiner [Fri, 11 Nov 2022 18:05:24 +0000 (19:05 +0100)]
etnaviv: Support negative float inline immediates

Closes: #7652
Fixes: 45a111c21c2 ("nir/opt_algebraic: Fuse c - a * b to FMA")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>

22 months agoetnaviv: fix NULL pointer dereference in TS allocation
Lucas Stach [Tue, 22 Nov 2022 09:21:43 +0000 (10:21 +0100)]
etnaviv: fix NULL pointer dereference in TS allocation

Commit c2b06e1a3820 ("etnaviv: add support for sharing the TS buffer")
introduced a problem similar to the one fixed in 3b3cd5128672 ("etnaviv:
fix renderonly check in etna_resource_alloc") in a different code path.
This causes a NULL pointer dereference when the screen is instanciated
on the render node. Fix it in the same way by just checking for a valid
pointer.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19923>

22 months agoanv: enable sample location enable dynamic state
Lionel Landwerlin [Tue, 22 Nov 2022 10:22:06 +0000 (12:22 +0200)]
anv: enable sample location enable dynamic state

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19925>

22 months agomicrosoft/nir_to_dxil: Avoid emitting SampleCmpLevel prior to SM 6.7 if possible
Pedro J. Estébanez [Mon, 21 Nov 2022 11:56:37 +0000 (12:56 +0100)]
microsoft/nir_to_dxil: Avoid emitting SampleCmpLevel prior to SM 6.7 if possible

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

22 months agorusticl: Emit build-id in libRusticlOpenCL
Tomeu Vizoso [Tue, 22 Nov 2022 11:39:53 +0000 (12:39 +0100)]
rusticl: Emit build-id in libRusticlOpenCL

Drivers may need it for their on-disk shader caches.

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

22 months agov3d: make format/modifier logic easier to read
Eric Engestrom [Mon, 21 Nov 2022 15:37:54 +0000 (15:37 +0000)]
v3d: make format/modifier logic easier to read

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19900>

22 months agonir: convert nir_opt_idiv_const to nir_shader_instructions_pass
Constantine Shablya [Sun, 20 Nov 2022 11:06:17 +0000 (13:06 +0200)]
nir: convert nir_opt_idiv_const to nir_shader_instructions_pass

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19881>

22 months agoetnaviv: remove use of flush_seqno as trigger for texture cache invalidate
Lucas Stach [Wed, 16 Nov 2022 16:15:07 +0000 (17:15 +0100)]
etnaviv: remove use of flush_seqno as trigger for texture cache invalidate

The flush_seqno is only to be used/updated when a dirty tile status has
been written back to the resource. Using it as a marker to trigger a
texture cache invalidation is bogus and not actually needed. When the
texture resource is updated via a mapping or blit the texture cache
invalidation is already triggered by marking the caches as dirty. If the
resource is updated by fragment output, OpenGL explicitly defines the
result of a later texture read as undefined unless a TextureBarrier is
inserted, which also properly triggers the texture cache invalidate.

Also the current check is bogus as it doesn't handle seqno wraparound.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>

22 months agoetnaviv: mark texture caches as dirty when blitting into a sampler resource
Lucas Stach [Wed, 16 Nov 2022 16:27:38 +0000 (17:27 +0100)]
etnaviv: mark texture caches as dirty when blitting into a sampler resource

Same as with resource mappings the blit can target a resource that may be
cached in the texture cache. Mark the cache as dirty to make sure it is
invalidated before the next draw.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>

22 months agoetnaviv: drop useless ts_for_sampler_view pointer check
Lucas Stach [Wed, 16 Nov 2022 15:24:54 +0000 (16:24 +0100)]
etnaviv: drop useless ts_for_sampler_view pointer check

Both state and desc texture implementations set this function pointer,
so there is no point in guarding against its absence.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>

22 months agost/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap
Marek Olšák [Thu, 17 Nov 2022 13:31:33 +0000 (08:31 -0500)]
st/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap

This might fix some window system issues.

Fixes: 3da170faaec - glthread: change when glFlush flushes asynchronously

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19809>

22 months agoutil/glsl2spirv: don't store preprocessed files in source tree
Lionel Landwerlin [Sun, 20 Nov 2022 22:00:22 +0000 (00:00 +0200)]
util/glsl2spirv: don't store preprocessed files in source tree

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19893>

22 months agofreedreno,tu,ir3: DCE ij_pix
Danylo Piliaiev [Thu, 10 Nov 2022 14:40:48 +0000 (15:40 +0100)]
freedreno,tu,ir3: DCE ij_pix

SP_FS_PREFETCH_CNTL.IJ_WRITE_DISABLE allows disabling ij write, so
now we could DCE it.

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

22 months agofreedreno,tu: Update SP_FS_PREFETCH,SP_FS_PREFETCH_CNTL regs definition
Danylo Piliaiev [Thu, 10 Nov 2022 14:38:28 +0000 (15:38 +0100)]
freedreno,tu: Update SP_FS_PREFETCH,SP_FS_PREFETCH_CNTL regs definition

Reverse engineer more fields of these regs.

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

22 months agomesa: add unlikely() and adjust error handling in BindBuffer
Marek Olšák [Fri, 18 Nov 2022 10:13:42 +0000 (05:13 -0500)]
mesa: add unlikely() and adjust error handling in BindBuffer

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agomesa: add no_error support into get_buffer_target()
Marek Olšák [Thu, 17 Nov 2022 17:02:16 +0000 (12:02 -0500)]
mesa: add no_error support into get_buffer_target()

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agomesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag
Marek Olšák [Thu, 17 Nov 2022 16:15:56 +0000 (11:15 -0500)]
mesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag

to get rid of the fail path in get_buffer_target.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agoetnaviv: fix tile status interaction with write mappings
Lucas Stach [Fri, 18 Nov 2022 11:24:58 +0000 (12:24 +0100)]
etnaviv: fix tile status interaction with write mappings

This fixes a longstanding bug in the interaction between TS and a write
mapping. The write does not update TS regardless of the way the update
is done. Update via etna_copy_resource would just set the target ts_valid
to false without actually writing back any dirty TS to the resource.
Writes via the CPU would update the resource, but keep ts_valid at true
even if the tile status may now not match the actually written tiles of
the resource anymore.

Fix this by writing back a dirty TS to the target resource if needed
before updating the level with the write data. Always invalidate TS,
even when the update is done by the CPU.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19846>

22 months agoanv: fixup context initialization on DG2
Lionel Landwerlin [Tue, 22 Nov 2022 08:47:58 +0000 (10:47 +0200)]
anv: fixup context initialization on DG2

Fixing a typo :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 507a86e131d6 ("anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19922>

22 months agoCODEOWNERS: add MTCoster as an Imagination maintainer
Frank Binns [Thu, 17 Nov 2022 11:36:53 +0000 (11:36 +0000)]
CODEOWNERS: add MTCoster as an Imagination maintainer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19845>

22 months agoutil: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly
Yonggang Luo [Mon, 21 Nov 2022 11:01:50 +0000 (19:01 +0800)]
util: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19895>

22 months agotree-wide: Fixes multi-line macro width after replace to __func__
Yonggang Luo [Sun, 20 Nov 2022 04:50:41 +0000 (12:50 +0800)]
tree-wide: Fixes multi-line macro width after replace to __func__

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agogallium: __FUNCTION__ now never be used, remove it
Yonggang Luo [Thu, 17 Nov 2022 21:40:21 +0000 (05:40 +0800)]
gallium: __FUNCTION__ now never be used, remove it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agogallium: Replace the usage of __FUNCTION__ with __func__ in all gallium code
Yonggang Luo [Thu, 17 Nov 2022 21:39:49 +0000 (05:39 +0800)]
gallium: Replace the usage of __FUNCTION__ with __func__ in all gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agotree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code
Yonggang Luo [Thu, 17 Nov 2022 21:38:36 +0000 (05:38 +0800)]
tree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agomeson: do not use source_root() when possible
Danylo Piliaiev [Tue, 1 Nov 2022 16:42:08 +0000 (17:42 +0100)]
meson: do not use source_root() when possible

source_root() function is deprecated in Meson version 0.56.0 because
it returns the source root of the parent project if called from a
subproject.

Why would anyone need Mesa as a meson subproject?
It would be used as subproject in a project generated by command buffer
"decompiler" for Freedreno.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19901>

22 months agoac/nir/cull: fix culling for lines
Qiang Yu [Sat, 19 Nov 2022 09:48:22 +0000 (17:48 +0800)]
ac/nir/cull: fix culling for lines

Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19868>

22 months agoac/nir/ngg,radv: use intrinsic base for instance_rate_inputs check
Qiang Yu [Thu, 17 Nov 2022 02:17:21 +0000 (10:17 +0800)]
ac/nir/ngg,radv: use intrinsic base for instance_rate_inputs check

radeonsi use packed location base while radv use un-packed location.
So we adjust instance_rate_inputs in each driver to hide the difference.
Note the attribute slot number is less than 16, so we can shift
instance_rate_inputs in radv by VERT_ATTRIB_GENERIC0 which is 16.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19868>

22 months agovulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()
Jason Ekstrand [Thu, 17 Nov 2022 16:40:58 +0000 (10:40 -0600)]
vulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()

The entrypoint needs to exist but we don't need to do anything with it.

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agovulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT
Jason Ekstrand [Thu, 17 Nov 2022 16:39:05 +0000 (10:39 -0600)]
vulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agovulkan: Add state for extraPrimitiveOverestimationSize
Jason Ekstrand [Thu, 17 Nov 2022 16:35:49 +0000 (10:35 -0600)]
vulkan: Add state for extraPrimitiveOverestimationSize

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agorusticl: advertise conformance on 12th Intel iGPUs
Karol Herbst [Sat, 12 Nov 2022 16:10:59 +0000 (17:10 +0100)]
rusticl: advertise conformance on 12th Intel iGPUs

Submission can be found here:
https://www.khronos.org/conformance/adopters/conformant-products/opencl#submission_405

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Hard-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19699>

22 months agoanv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled
Lionel Landwerlin [Sat, 19 Nov 2022 01:35:27 +0000 (03:35 +0200)]
anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled

We need to set CPS_MODE_NONE when no per coarse pixel dispatch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 231651fd89fb ("anv: implement VK_KHR_fragment_shading_rate")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>

22 months agoanv: fix 3d state initialization
Lionel Landwerlin [Sat, 19 Nov 2022 12:29:43 +0000 (14:29 +0200)]
anv: fix 3d state initialization

We missed a couple of restriction leading to inconsistent 3d pipeline
state. It is mostly noticeable when doing a multiple sample dispatch
as the verify first 3d operation.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7531
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>

22 months agonir/loop_analyze: Fix get_iteration for nir_op_fneu
Ian Romanick [Mon, 9 Aug 2021 22:05:33 +0000 (15:05 -0700)]
nir/loop_analyze: Fix get_iteration for nir_op_fneu

Consider the loop:

    float i = 0.0;
    while (true) {
       if (i != 0.0)
          break;

       i = i + 1.0;
    }

This loop clearly executes exactly one time.

Some trickery is necessary to handle cases where the initial loop value
is very large and the increment is, by comparison, very small.  From the
fenu_once test case,

    float i = -604462909807314587353088.0;
    while (true) {
       if (i != -604462909807314587353088.0)
          break;

       i = i + 36028797018963968.0;
    }

This loop should also execute exactly once, but this is much more
challenging to calculate due to precision issues.

Going towards smaller magnitude (i.e., adding a small positive value to
a large negative value) requires a smaller delta to make a difference
than going towards a larger magnitude. For this reason,
-604462909807314587353088.0 + 36028797018963968.0 !=
-604462909807314587353088.0, but -604462909807314587353088.0 +
-36028797018963968.0 == -604462909807314587353088.0. Math class is
tough.

No changes in shader-db or fossil-db.

v2: Fix major bug in checking result of the eval_const_binop(nir_op_feq,
...) discovered while developing fneu_once_easy unit test. Fix a typo in
the comment just above that. Add fneu_once_easy test.

v3: Skip the iteration count adjustment tests for nir_op_fenu and
nir_op_ine. Since the iteration count is either 1 or unknown, all this
function can do is add numerical error. Add fenu_once tests.

v4: Change the initial value in the fneu_once test from large positive
to large negative. Change check in get_iteration from nir_op_fsub to
nir_op_fadd. Both changes from discussion with M Henning. Also add some
more explanation in fneu_once.

v5: Rename test cases.

Fixes: 6772a17acc8 ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agonir/loop_analyze: Fix get_iteration for nir_op_ine
Ian Romanick [Mon, 9 Aug 2021 22:05:33 +0000 (15:05 -0700)]
nir/loop_analyze: Fix get_iteration for nir_op_ine

I discovered this problem because adding an algebraic transformation to
convert some uge and ult to ieq or ine caused a couple loops to stop
unrolling. Consider the loop:

    uint i = 0;
    while (true) {
       if (i >= 1)
          break;

       i++;
    }

This loop clearly executes exactly one time. Note that uge(x, 1) is
equivalent to ine(x, 0). Changing the condition to 'if (i != 0)' will
also execute exactly one time.

In the added test cases, uge_once correctly get an exact loop trip count
of 1. Without the changes to nir_loop_analyze.c, the ine_once case
detects a maximum loop trip count of zero and does not get an exact loop
trip count.

No changes in shader-db or fossil-db.

v2: Move nir_op_fneu changes to a separate commit.

v3: Rename test cases.

Fixes: 6772a17acc8 ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agonir/loop_analyze: Add basic unit test framework
Ian Romanick [Tue, 15 Nov 2022 03:07:06 +0000 (19:07 -0800)]
nir/loop_analyze: Add basic unit test framework

This test comes from a comment in the loop analysis code.

The ine_zero test checks that zero iteration loops involving ine are
correctly identified.

v2: Add ine_zero test. Suggested by Tim.

v3: Rename test cases.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agorusticl/device: put space at the end of CL_DEVICE_VERSION
Karol Herbst [Sat, 19 Nov 2022 20:44:28 +0000 (21:44 +0100)]
rusticl/device: put space at the end of CL_DEVICE_VERSION

Apparently some software relies on that and the spec kind of says it's
there.

Fixes: 20c90fed5a0 ("rusticl: added")
Reported-by: sobkas
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19872>

22 months agoegl: Fix uninitialized variable warning
Adam Jackson [Mon, 21 Nov 2022 20:46:03 +0000 (15:46 -0500)]
egl: Fix uninitialized variable warning

Fedora's gcc 12.2.1 says:

    ../src/egl/main/eglapi.c: In function ‘eglDupNativeFenceFDANDROID’:
    ../src/egl/main/eglapi.c:2268:11: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
     2268 |    EGLint ret;

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19913>

22 months agor300: don't reuse destination registers when lowering
Pavel Ondračka [Wed, 16 Nov 2022 21:09:50 +0000 (22:09 +0100)]
r300: don't reuse destination registers when lowering

Regalloc can sort it out later. No significant change is shader-db, the
one instruction reduction is likely because some optimize pass can
actually work better when we are closer to ssa-like form.

RV530:
total instructions in shared programs: 133718 -> 133717 (<.01%)
instructions in affected programs: 47 -> 46 (-2.13%)
helped: 1
HURT: 0

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>

22 months agor300: simplify rc_find_free_temporary
Pavel Ondračka [Fri, 7 Oct 2022 20:02:40 +0000 (22:02 +0200)]
r300: simplify rc_find_free_temporary

Back when we had a stupid register allocator we did a lot of tricks to
optimize the register usage. The old version of rc_find_free_temporary
did a full program search each time it was called to find out what
registers and channels are actually used and than used that info to give
us the first free register to use.

Now that we have a proper register allocator both for vertex and
fragment shaders, this is no longer needed. Just scan the program when
called for the first time to find the first unused temporary index and
than increment by one everytime. Regalloc can sort it out later.

No change in shader-db confirms this assumption is sound.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>

22 months agofreedreno/a6xx: Remove unneeded MSAA clear fallback
Rob Clark [Tue, 15 Nov 2022 17:19:19 +0000 (09:19 -0800)]
freedreno/a6xx: Remove unneeded MSAA clear fallback

This was added in commit 911ce374caf ("freedreno/a6xx: Fix MSAA clear"),
but the only case that can't handle fast-clear is sysmem blitter clear
path.

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

22 months agofreedreno/a6xx: Use fallback path for MSAA clear_texture()
Rob Clark [Sun, 20 Nov 2022 17:21:43 +0000 (09:21 -0800)]
freedreno/a6xx: Use fallback path for MSAA clear_texture()

The trick for emulating MSAA clear by adjusting blit coords tends to
fall over with tiled/ubwc, so just use the fallback path instead.

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

22 months ago.gitignore: add VSCode and VSCodium
David Heidelberg [Mon, 21 Nov 2022 16:19:33 +0000 (17:19 +0100)]
.gitignore: add VSCode and VSCodium

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

22 months agoci: ci_run_n_monitor.py: fail when job is not found
David Heidelberg [Sat, 19 Nov 2022 20:30:39 +0000 (21:30 +0100)]
ci: ci_run_n_monitor.py: fail when job is not found

Acked-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19902>

22 months agoci/freedreno: add some missing a630 flakes.
Emma Anholt [Mon, 21 Nov 2022 18:52:13 +0000 (10:52 -0800)]
ci/freedreno: add some missing a630 flakes.

Two from the GL 4.5 update, one that's been around longer.

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

22 months agoci/turnip+zink: Generalize the 16-bit copy_image fails.
Emma Anholt [Mon, 21 Nov 2022 17:31:59 +0000 (09:31 -0800)]
ci/turnip+zink: Generalize the 16-bit copy_image fails.

We just had another fail of the non_compressed texture2d_array group, and
we've got enough of a pattern here.

I left in the specific cases that had some debug info, though.

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

22 months agoasahi: Wire up all BCn formats
Alyssa Rosenzweig [Sun, 13 Nov 2022 03:05:58 +0000 (22:05 -0500)]
asahi: Wire up all BCn formats

We have these native. Passes the relevant piglits. Large reduction in memory
usage on Xonotic on higher settings (8x less memory per texture), which allows
Xonotic to run at high settings without OOMing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19903>

22 months agovirgl: don't a use staging when a resources created with the shared flag
Gert Wollny [Thu, 10 Nov 2022 17:48:29 +0000 (18:48 +0100)]
virgl: don't a use staging when a resources created with the shared flag

There seems to be a problem with running firefox by using Xwayland that
results in a shared resources being not always tagged as using staging.

As a result one process tries to map the resource that was allocated as
one that uses staging without actually using the staging resource, and
hence the mapped range only accounts for the small region that we have
to allocated because a zero-allocation doesn't work, but the application
mapping the resource assumes that a properly sized range is mapped, and
consequently this results in invalid memory access.

To work around this issue disable creating staging for resources that
are created by using shared binding. It is not clear to me whether this
is the best fix, but it seems to quell the issue.

Fixes: c9d99b7eec7ec14d6d71d381a424b6280d75a882
    virgl: Fix texture transfers by using a staging resource

Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/291
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19655>

22 months agogallium/drivers: copy only the actual number of slice parameters
Sajeesh Sidharthan [Sun, 20 Nov 2022 06:47:50 +0000 (22:47 -0800)]
gallium/drivers: copy only the actual number of slice parameters

currently max number of slice(tile) parameters are copied for av1.
copy only actual number of slice parameters

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19878>

22 months agonir/algebraic: shrink 64-bit bitwise operations with 0/-1 constant half
Rhys Perry [Tue, 15 Nov 2022 12:10:40 +0000 (12:10 +0000)]
nir/algebraic: shrink 64-bit bitwise operations with 0/-1 constant half

fossil-db (navi21):
Totals from 457 (0.34% of 135636) affected shaders:
Instrs: 259349 -> 250383 (-3.46%)
CodeSize: 1411976 -> 1369136 (-3.03%)
Latency: 2175961 -> 2148158 (-1.28%)
InvThroughput: 502206 -> 490244 (-2.38%)
Copies: 15238 -> 15232 (-0.04%); split: -0.07%, +0.03%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19748>

22 months agoradv/rt: Return the correct result for requested deferral
Konstantin Seurer [Sun, 20 Nov 2022 15:05:21 +0000 (16:05 +0100)]
radv/rt: Return the correct result for requested deferral

We do not implement deferred host operations so we will return
VK_OPERATION_NOT_DEFERRED_KHR for now.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19882>

22 months agofrontends/va: remove unused slice_param_idx variable
Sajeesh Sidharthan [Sun, 20 Nov 2022 06:34:37 +0000 (22:34 -0800)]
frontends/va: remove unused slice_param_idx variable

slice_param_idx was added to handle multiple slice params.
it's not used anymore.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19877>

22 months agoaco: ensure MRT0 is written with dual source blending
Rhys Perry [Wed, 16 Nov 2022 15:08:34 +0000 (15:08 +0000)]
aco: ensure MRT0 is written with dual source blending

Fixes crucible test func.shader.dualsrc_mrt0_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>

22 months agoradv: disable MRT compaction with dual-source blending
Rhys Perry [Wed, 16 Nov 2022 15:08:34 +0000 (15:08 +0000)]
radv: disable MRT compaction with dual-source blending

Fixes crucible tests func.shader.dualsrc_mrt0_undef on navi21 and
func.shader.dualsrc_mrt1_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>

22 months agoiris: Fix iris_bo_alloc() flags call argument
José Roberto de Souza [Thu, 17 Nov 2022 20:15:11 +0000 (12:15 -0800)]
iris: Fix iris_bo_alloc() flags call argument

binder_realloc() -> iris_bo_alloc() is setting 4096 as flags parameter.
Up to now this is harmeless as there is no BO_ALLOC flag that uses
bit 12 but is better to avoid any future issues.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19898>

22 months agotu: Implement VK_EXT_post_depth_coverage
Danylo Piliaiev [Fri, 11 Nov 2022 15:40:53 +0000 (16:40 +0100)]
tu: Implement VK_EXT_post_depth_coverage

Passes:
 dEQP-VK.pipeline.monolithic.multisample.sample_mask_with_depth_test.*
 KHR-GL45.post_depth_coverage_tests.*

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

22 months agor300: more informative too many ALU instructions error
Pavel Ondračka [Tue, 15 Nov 2022 12:33:19 +0000 (13:33 +0100)]
r300: more informative too many ALU instructions error

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>

22 months agor300: delete backend branch emulation
Pavel Ondračka [Tue, 15 Nov 2022 11:48:00 +0000 (12:48 +0100)]
r300: delete backend branch emulation

We now depend on NIR doing the right thing. It was not able to
handle the few cases where NIR failed anyway (and even if it did,
such complex cases would hit the instruction limit later).

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>

22 months agor300: abort shader compilation early on loops and branches
Pavel Ondračka [Tue, 15 Nov 2022 11:46:50 +0000 (12:46 +0100)]
r300: abort shader compilation early on loops and branches

R300/R400 GPUs can't do it in hardware and all the lowering should have
happened in NIR already, there is no point in wasting CPU time, just to
abort later when emitting.

Reduces CPU time for dEQP run by ~25% for RV370. The wallclock time is
now just slighly above 1 minute at 10 threads, mostly determined by the
long-running dEQP-GLES2.functional.flush_finish.* tests.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>