platform/upstream/mesa.git
2 years agozink: Fix memory leak on error path.
Vinson Lee [Sat, 30 Apr 2022 05:57:02 +0000 (22:57 -0700)]
zink: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

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

Fixes: 625457caafb ("zink: handle swapchain acquire failures more directly")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16258>

2 years agovulkan/wsi: Add signal_fence/semaphore_for_image helpers
Jason Ekstrand [Mon, 15 Mar 2021 17:04:56 +0000 (12:04 -0500)]
vulkan/wsi: Add signal_fence/semaphore_for_image helpers

These operations are about to get a bit more complex so let's add a
couple nice helpers to keep things clean.

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Set the right stage flags for semaphore waits
Jason Ekstrand [Fri, 21 May 2021 20:31:06 +0000 (15:31 -0500)]
vulkan/wsi: Set the right stage flags for semaphore waits

This is currently technically broken for compute.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Reset the image fence right before vkQueueSubmit
Jason Ekstrand [Tue, 3 Mar 2020 18:45:16 +0000 (12:45 -0600)]
vulkan/wsi: Reset the image fence right before vkQueueSubmit

Instead of resetting at the top of the loop, we create the fence in the
signaled state and then unconditionally reset it before vkQueueSubmit.
This gives us a bit more flexibility with how we handle the fence in the
case where the client provides zero semaphores.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Hang on to file descriptors
Jason Ekstrand [Mon, 2 Mar 2020 23:40:09 +0000 (17:40 -0600)]
vulkan/wsi: Hang on to file descriptors

Instead of closing the dma-buf file descriptors immediately after
handing them to the window system, hang on to them.  We want to be able
to use them for synchronization.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Only use a single fd per wsi_image
Jason Ekstrand [Mon, 2 Mar 2020 23:38:16 +0000 (17:38 -0600)]
vulkan/wsi: Only use a single fd per wsi_image

The only thing this was helping was X11 where the protocol requires that
we pass in an array of images.  We can move all the dup() code to the
X11 back-end and leave the others a bit cleaner.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Close file descriptors in wsi_destroy_image
Jason Ekstrand [Mon, 2 Mar 2020 23:16:33 +0000 (17:16 -0600)]
vulkan/wsi: Close file descriptors in wsi_destroy_image

Most of the time, this is a non-issue because the WSI back-end closes
them as part of handing them to the window-system and sets fds[*] to -1.
The one exception here was Wayland which was closing them but leaving
fds[*] pointing to bogus file descriptors.  Having wsi_destroy_image
close them makes clean-up easier and more reliable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agogallium: refactor a channel loop in draw_llvm.c
Mihai Preda [Wed, 20 Apr 2022 11:30:30 +0000 (14:30 +0300)]
gallium: refactor a channel loop in draw_llvm.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: LLVM opaque pointers small changes
Mihai Preda [Mon, 2 May 2022 13:11:07 +0000 (16:11 +0300)]
gallivm: LLVM opaque pointers small changes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_tgsi_aos.c
Mihai Preda [Mon, 2 May 2022 13:10:19 +0000 (16:10 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_tgsi_aos.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_tgsi_soa.c
Mihai Preda [Mon, 2 May 2022 13:09:40 +0000 (16:09 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_tgsi_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_struct.c
Mihai Preda [Mon, 2 May 2022 13:08:16 +0000 (16:08 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_struct.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_sample_soa.c
Mihai Preda [Mon, 2 May 2022 13:06:06 +0000 (16:06 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_sample_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_sample.c
Mihai Preda [Mon, 2 May 2022 13:04:44 +0000 (16:04 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_sample.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_nir_soa.c
Mihai Preda [Mon, 2 May 2022 13:03:36 +0000 (16:03 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_nir_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_gather.c
Mihai Preda [Mon, 2 May 2022 13:01:52 +0000 (16:01 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_gather.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_format_s3tc.c
Mihai Preda [Mon, 2 May 2022 12:59:55 +0000 (15:59 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_format_s3tc.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_intr.c
Mihai Preda [Mon, 2 May 2022 12:56:33 +0000 (15:56 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_intr.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_flow.c
Mihai Preda [Mon, 2 May 2022 12:54:57 +0000 (15:54 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_flow.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_printf.c
Mihai Preda [Mon, 2 May 2022 12:53:10 +0000 (15:53 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_printf.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_coro.c
Mihai Preda [Mon, 2 May 2022 12:51:30 +0000 (15:51 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_coro.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_conv.c
Mihai Preda [Mon, 2 May 2022 12:44:19 +0000 (15:44 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_conv.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_format_aos.c
Mihai Preda [Mon, 2 May 2022 12:41:12 +0000 (15:41 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_format_aos.c

Also extract lp_build_const_func_pointer_from_type() in lp_bld_const.h
taking explicit function type.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_assert.c
Mihai Preda [Mon, 2 May 2022 12:32:25 +0000 (15:32 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_assert.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_arit.c
Mihai Preda [Mon, 2 May 2022 12:31:29 +0000 (15:31 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_arit.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium/llvmpipe: use LLVM opaque pointers in lp_bld_depth.c
Mihai Preda [Mon, 2 May 2022 12:28:22 +0000 (15:28 +0300)]
gallium/llvmpipe: use LLVM opaque pointers in lp_bld_depth.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium/llvmpipe: use LLVM opaque pointers in lp_bld_interp.c
Mihai Preda [Mon, 2 May 2022 12:26:25 +0000 (15:26 +0300)]
gallium/llvmpipe: use LLVM opaque pointers in lp_bld_interp.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium: use LLVM opaque pointers in draw_llvm.c
Mihai Preda [Mon, 2 May 2022 12:20:01 +0000 (15:20 +0300)]
gallium: use LLVM opaque pointers in draw_llvm.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium: add opaque pointers shim for LLVM < 8.0
Mihai Preda [Mon, 2 May 2022 12:14:48 +0000 (15:14 +0300)]
gallium: add opaque pointers shim for LLVM < 8.0

LLVM is transitioning to "opaque pointers", and as such deprecates
LLVMBuildGEP, LLVMBuildCall, LLVMBuildLoad, replacing them with
LLVMBuildGEP2, LLVMBuildCall2, LLVMBuildLoad2 respectivelly.
These new functions were added in LLVM 8.0; so for LLVM before 8.0 we
simply forward to the non-opaque-pointer variants.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agowsi/x11: Hook up KHR_incremental_present
Adam Jackson [Thu, 28 Apr 2022 16:04:42 +0000 (12:04 -0400)]
wsi/x11: Hook up KHR_incremental_present

We create one XFIXES region per swapchain image. If the QueuePresent
comes in with a list of rectangles, we push them into the region and
pass it to xcb_present_pixmap.

The extension is technically just a hint. We still fall back to the
unhinted "update the whole image" path if the update region has more
than an arbitrary number of rects, or if we're stuck using plain
PutImage instead of ShmPutImage.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16218>

2 years agozink: add a ci flake
Mike Blumenkrantz [Wed, 4 May 2022 17:10:40 +0000 (13:10 -0400)]
zink: add a ci flake

weird that this is suddenly failing on two drivers lately...

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

2 years agolavapipe: lower quad_broadcast intrinsics
Mike Blumenkrantz [Tue, 3 May 2022 15:01:05 +0000 (11:01 -0400)]
lavapipe: lower quad_broadcast intrinsics

not supported by gallivm

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16301>

2 years agosvga: Add support for requesting NIR and translating to TGSI.
Emma Anholt [Fri, 10 Dec 2021 23:17:01 +0000 (15:17 -0800)]
svga: Add support for requesting NIR and translating to TGSI.

I'm working on switching mesa/st to no longer produce TGSI on its own, and
so we need a way to test SVGA against that future.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14160>

2 years agointel/dev: add RPL-S pci ids from drm-intel-next
Jonathan Gray [Wed, 4 May 2022 10:30:13 +0000 (20:30 +1000)]
intel/dev: add RPL-S pci ids from drm-intel-next

from Tejas Upadhyay 'drm/i915: Add RPL-S PCI IDs' in drm-intel-next

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

2 years agoradv: only init acceleration structure if RT is enabled
Samuel Pitoiset [Tue, 3 May 2022 16:22:36 +0000 (18:22 +0200)]
radv: only init acceleration structure if RT is enabled

This is to fix a LLVM crash with 13.0 because ATOMIC_FMAX is only
supported on 14.0+, so RADV_DEBUG=llvm was just completely broken.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16305>

2 years agoradv/sqtt: fix configuring AUTO_FLUSH_MODE on GFX10.3
Samuel Pitoiset [Tue, 3 May 2022 15:20:24 +0000 (17:20 +0200)]
radv/sqtt: fix configuring AUTO_FLUSH_MODE on GFX10.3

The polarity is inverted. Ported from RadeonSI and PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16303>

2 years agoac,radeonsi: add has_sqtt_auto_flush_mode_bug
Samuel Pitoiset [Tue, 3 May 2022 15:18:09 +0000 (17:18 +0200)]
ac,radeonsi: add has_sqtt_auto_flush_mode_bug

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16303>

2 years agoegl/kopper: Hook up eglSwapInterval
Adam Jackson [Thu, 28 Apr 2022 21:38:17 +0000 (17:38 -0400)]
egl/kopper: Hook up eglSwapInterval

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>

2 years agoglx/kopper: Enable GLX_EXT_swap_control etc.
Adam Jackson [Thu, 28 Apr 2022 21:19:13 +0000 (17:19 -0400)]
glx/kopper: Enable GLX_EXT_swap_control etc.

This requires newly tracking the max swap interval since kopper can't do
abs(interval) > 1 yet.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>

2 years agokopper: Grow a swap interval API
Adam Jackson [Thu, 28 Apr 2022 21:03:23 +0000 (17:03 -0400)]
kopper: Grow a swap interval API

We take a slight liberty here by allowing 0 to mean either MAILBOX or
IMMEDIATE, since Wayland (at least) doesn't have a true IMMEDIATE mode
at least MAILBOX won't throttle to vblank.

This only correctly handles intervals of 0 or 1 at the moment.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>

2 years agowsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes
Adam Jackson [Mon, 25 Apr 2022 19:24:08 +0000 (15:24 -0400)]
wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes

If the window is destroyed from underneath us while we happen to be in
xcb_wait_for_special_event, there's no recovery. The special event will
never match because the XID is no longer valid, and Present doesn't have
an in-band DestroyNotify. We're going to work around this by using the
poll API instead. If we get an event we short-circuit back to the top of
the "wait for available image" loop, so we drain the whole special event
queue before any other logic. Which means if we run out of special
events (and the connection and swapchain are still valid) that we
_don't_ have enough images available, so to hurry along any events that
the X server hasn't flushed out yet we call GetGeometry on the
swapchain's window. As a side effect this verifies that the window is
still alive.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>

2 years agoradv/radix: handle intentional allocation failures properly
Samuel Pitoiset [Tue, 3 May 2022 14:00:41 +0000 (16:00 +0200)]
radv/radix: handle intentional allocation failures properly

This test can intentionally make the alloc callback to return NULL, so
we have to handle object creation failures properly. The driver should
also avoid memleaks because the test checks that.

Fixes crashes with
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16298>

2 years agoradv: Use RADV_RT_STAGE_BITS more often
Konstantin Seurer [Wed, 4 May 2022 13:18:07 +0000 (15:18 +0200)]
radv: Use RADV_RT_STAGE_BITS more often

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: Treat rt stages like compute stages
Konstantin Seurer [Tue, 3 May 2022 17:15:53 +0000 (19:15 +0200)]
radv: Treat rt stages like compute stages

Fixes dEQP-VK.binding_model.descriptorset_random.sets4.noarray.ubolimitlow.sbolimitlow.sampledimglow.outimgtexlow.noiub.nouab.rgen.noia.0
and probably some other ones.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: Move RADV_RT_STAGE_BITS to radv_private.h
Konstantin Seurer [Wed, 4 May 2022 12:43:33 +0000 (14:43 +0200)]
radv: Move RADV_RT_STAGE_BITS to radv_private.h

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: re-emit dynamic line stipple state if the primitive topology changed
Samuel Pitoiset [Tue, 3 May 2022 10:14:38 +0000 (12:14 +0200)]
radv: re-emit dynamic line stipple state if the primitive topology changed

The dynamic primitive topology could change from LINE_LIST to
LINE_STRIP for example and the stipple state depends on this.

Found by inspection.

Cc: 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/16295>

2 years agopan/bi: Rework varying linking on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 16:31:01 +0000 (12:31 -0400)]
pan/bi: Rework varying linking on Valhall

Valhall introduces hardware-allocated varyings. Instead of allocating varying
descriptors on the CPU with a slot based interface, the driver just tells the
hardware how many bytes to allocate per vertex and loads/stores with byte
offsets. This is much nicer!

However, this requires us to rework our linking code to account for separable
shaders. With separable shaders, we can't rely on driver_location matching
between stages, and unlike on Midgard, we can't resolve the differences with
curated command stream descriptors. However, we *can* rely on slots matching. So
we should "just" determine the byte offsets based on the slot, and then
separable shaders work.

For GLES, it really is that easy.

For desktop GL, it's not -- desktop GL brings unpredictable extra varyings like
COL1 and TEX2. Allocating space for all of these unconditionally would hamper
performance. To cope, we key fragment shaders to the set of non-GLES varyings
written by the linked vertex shader. Then we may define an efficient ABI, where
only apps only pay for what they use.

Fixes various tests in dEQP-GLES31.functional.separate_shader.random.* on
Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16310>

2 years agopanvk: Don't use VARYING_SLOT_TEX0 internally
Alyssa Rosenzweig [Tue, 3 May 2022 16:30:19 +0000 (12:30 -0400)]
panvk: Don't use VARYING_SLOT_TEX0 internally

This is a legacy varying for desktop GL use. Don't use it in our meta shaders,
as it adds pointless complexity.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16310>

2 years agopanfrost: Don't use VARYING_SLOT_TEX0 internally
Alyssa Rosenzweig [Tue, 3 May 2022 16:29:35 +0000 (12:29 -0400)]
panfrost: Don't use VARYING_SLOT_TEX0 internally

This is a legacy varying for desktop GL use. Don't use it in our internal
shaders, as it adds pointless complexity.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16310>

2 years agopanfrost/ci: Smoke test spilling
Alyssa Rosenzweig [Tue, 3 May 2022 21:21:13 +0000 (17:21 -0400)]
panfrost/ci: Smoke test spilling

Spilling is tricky and doesn't get much testing in CI. Run
a subset of dEQP-GLES2.functional.shaders.* with spilling forced to get spilling
tested in CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopanfrost: Use packed TLS on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 20:34:52 +0000 (16:34 -0400)]
panfrost: Use packed TLS on Valhall

Packed TLS has cache-locality benefits on Valhall, compared to Bifrost's flat
TLS. Valhall does support flat TLS, but requires extra arithmetic in the shader
for correct results. At least until we get to generic pointers (and maybe even
then), we can use packed TLS. So just use packed TLS always for proper spilling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopanfrost: Use emit_tls
Alyssa Rosenzweig [Tue, 3 May 2022 20:18:59 +0000 (16:18 -0400)]
panfrost: Use emit_tls

Instead of rolling our own, so it can pick up a Valhall fix.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopanfrost: Correct XML for TLS
Alyssa Rosenzweig [Tue, 3 May 2022 20:08:18 +0000 (16:08 -0400)]
panfrost: Correct XML for TLS

It was never updated for Valhall, from Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopan/bi: Assert that blend shaders may not spill
Alyssa Rosenzweig [Tue, 3 May 2022 21:14:20 +0000 (17:14 -0400)]
pan/bi: Assert that blend shaders may not spill

The set of blend shaders is closed. They are completely internal. As such, we
know that the registers we reserve for them suffice, and we don't permit
register spilling. Refusing to support spilling in blend shaders simplifies a
number of parts of the compiler. Add a check that we don't try to spill anyway,
which will silently fail.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopan/bi: Add option to test spilling
Alyssa Rosenzweig [Tue, 3 May 2022 21:05:57 +0000 (17:05 -0400)]
pan/bi: Add option to test spilling

BIFROST_MESA_DEBUG=spill now restricts the register file to 1/4 its usual size,
useful for testing register spilling (e.g. running CTS) as well as debugging
spilling on small shaders.

Note blend shaders are exempt, as we don't allow blend shaders to spill.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopan/bi: Align spilled registers on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 21:01:24 +0000 (17:01 -0400)]
pan/bi: Align spilled registers on Valhall

Required to support packed addressing correctly. Fixes (with spilling forced):

dEQP-GLES2.functional.shaders.random.trigonometric.vertex.20

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopan/va: Serialize memory stores
Alyssa Rosenzweig [Tue, 3 May 2022 20:47:27 +0000 (16:47 -0400)]
pan/va: Serialize memory stores

We could do better :(

Fixes spilling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>

2 years agopanfrost: Relax image check
Alyssa Rosenzweig [Tue, 3 May 2022 21:41:23 +0000 (17:41 -0400)]
panfrost: Relax image check

Shader images on Valhall don't allow nonzero "Minimum level". However,
pan_texture lowers away nonzero minimum levels anyway, so there's nothing to
check. Fixes:

KHR-GLES31.core.shader_image_load_store.advanced-allMips-cs

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16315>

2 years agomeson: Tell glslang to be quiet.
Georg Lehmann [Tue, 3 May 2022 19:57:23 +0000 (21:57 +0200)]
meson: Tell glslang to be quiet.

Without --quiet glslang unconditionally prints the input file name to stdout.
Check if --quiet is supported because some distros only have ancient glslang
versions.

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

2 years agoaco/ra: fix vgpr_limit
Rhys Perry [Tue, 3 May 2022 11:13:55 +0000 (12:13 +0100)]
aco/ra: fix vgpr_limit

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: b98a4d4dd7e ("aco: refactor GPR limit calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16297>

2 years agoaco: Remove D16 zero components from image stores.
Georg Lehmann [Thu, 31 Mar 2022 13:40:53 +0000 (15:40 +0200)]
aco: Remove D16 zero components from image stores.

No foz-db changes.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoradv: Run copy_prop and dce after folding 16bit sampling/load/store.
Georg Lehmann [Mon, 7 Mar 2022 12:10:47 +0000 (13:10 +0100)]
radv: Run copy_prop and dce after folding 16bit sampling/load/store.

Totals from 10 (0.01% of 134913) affected shaders:
CodeSize: 53168 -> 54832 (+3.13%); split: -0.17%, +3.30%
Instrs: 9117 -> 9200 (+0.91%); split: -1.74%, +2.65%
Latency: 41595 -> 41787 (+0.46%); split: -0.95%, +1.41%
InvThroughput: 16412 -> 16424 (+0.07%); split: -1.95%, +2.02%
VClause: 107 -> 112 (+4.67%); split: -0.93%, +5.61%
Copies: 199 -> 535 (+168.84%); split: -3.02%, +171.86%
PreVGPRs: 520 -> 502 (-3.46%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoradv: Use nir_fold_16bit_image_load_store_conversions.
Georg Lehmann [Fri, 25 Feb 2022 17:55:42 +0000 (18:55 +0100)]
radv: Use nir_fold_16bit_image_load_store_conversions.

Totals from 10 (0.01% of 134913) affected shaders:
CodeSize: 53316 -> 53168 (-0.28%)
Instrs: 9219 -> 9117 (-1.11%)
Latency: 41744 -> 41595 (-0.36%)
InvThroughput: 16616 -> 16412 (-1.23%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoaco: Implement image_load d16.
Georg Lehmann [Fri, 25 Feb 2022 17:52:27 +0000 (18:52 +0100)]
aco: Implement image_load d16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoaco: Implement image_store d16.
Georg Lehmann [Fri, 25 Feb 2022 17:21:00 +0000 (18:21 +0100)]
aco: Implement image_store d16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agonir/lower_mediump: Add a new pass to fold 16bit image load/store.
Georg Lehmann [Mon, 7 Feb 2022 20:43:13 +0000 (21:43 +0100)]
nir/lower_mediump: Add a new pass to fold 16bit image load/store.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agov3dv/pipeline: include pipeline layout on the pipeline sha1
Alejandro Piñeiro [Tue, 3 May 2022 10:48:10 +0000 (12:48 +0200)]
v3dv/pipeline: include pipeline layout on the pipeline sha1

Fixes failures on tests like this when the on-disk-cache is enabled:
dEQP-VK.binding_model.descriptor_copy.compute.uniform_buffer_0

We only found them when running full CTS runs. What happens is that we
got a hit from the on-disk shader cache, for several tests using the
same shaders. But some tests seems to be using a uniform buffer, and
others a inline buffer. Right now inline buffers leads to some changes
on the final nir shader, and generated assembly, compared with uniform
buffers. So we got a wrong shader. Fortunately we only got an assert
instead of weird behaviour.

With this commit we include the pipeline layout on the pipeline sha1,
so those two cases would get different sha1. FWIW, this is what other
drivers are already doing.

Surprisingly that didn't cause a problem before.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline_cache: add on disk cache hit stats
Alejandro Piñeiro [Tue, 3 May 2022 11:10:30 +0000 (13:10 +0200)]
v3dv/pipeline_cache: add on disk cache hit stats

Useful when debugging/testing on disk cache.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline_cache: adds check to skip searching for a entry
Alejandro Piñeiro [Tue, 3 May 2022 11:03:54 +0000 (13:03 +0200)]
v3dv/pipeline_cache: adds check to skip searching for a entry

If we are calling pipeline_cache_upload_shared_data with
from_disk_cache, that means that we had used the disk-cache to found
that entry. And that should only happens if we didn't find the entry
on the cache. So on that case we can skip to search for it.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline: fix small comment typo
Alejandro Piñeiro [Tue, 3 May 2022 10:57:15 +0000 (12:57 +0200)]
v3dv/pipeline: fix small comment typo

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agointel/dev: sync ADL-S pci ids with linux
Jonathan Gray [Wed, 4 May 2022 06:52:08 +0000 (16:52 +1000)]
intel/dev: sync ADL-S pci ids with linux

sync ADL-S pci ids with linux
c79b846f892d ("drm/i915/adl_s: Update ADL-S PCI IDs")

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

2 years agov3d: disable early-Z on odd frame dimensions
Juan A. Suarez Romero [Tue, 19 Apr 2022 14:53:20 +0000 (16:53 +0200)]
v3d: disable early-Z on odd frame dimensions

The early-Z buffer may load incorrect depth values if the frame has an
od width or height. In this case we need to disable early-Z.

v3:
 - Set job->early_zs_clear only for V3D_VERSION >= 40 (Iago)
 - Check early-Z is disabled if no zsbuf (Iago)

v4:
 - Borrow comments from v3dv around v3d_update_job_ez() (Iago)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3557
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16166>

2 years agov3d: enable early Z/S clears
Juan A. Suarez Romero [Tue, 19 Apr 2022 14:52:44 +0000 (16:52 +0200)]
v3d: enable early Z/S clears

This performance optimization can be enabled if we are clearing Z/S
buffer, and not storing or loading it.

v2:
 - Add assertion on depth/stencil job loads (Iago)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16166>

2 years agowgl: don't auto-load zink before software drivers
Mike Blumenkrantz [Tue, 3 May 2022 19:12:45 +0000 (15:12 -0400)]
wgl: don't auto-load zink before software drivers

as in glx/egl, zink+lavapipe should only load if explicitly selected

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16311>

2 years agozink: use VK_EXT_primitives_generated_query when available
Mike Blumenkrantz [Mon, 2 May 2022 12:58:25 +0000 (08:58 -0400)]
zink: use VK_EXT_primitives_generated_query when available

the old codepath must be maintained, but runtime will be far simpler

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: add a flag to zink_query to trigger rasterizer discard workaround
Mike Blumenkrantz [Mon, 2 May 2022 13:05:29 +0000 (09:05 -0400)]
zink: add a flag to zink_query to trigger rasterizer discard workaround

make this agnostic of query types; no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: add and use a function to detected emulated primgen queries
Mike Blumenkrantz [Mon, 2 May 2022 12:53:57 +0000 (08:53 -0400)]
zink: add and use a function to detected emulated primgen queries

no functional changes, just reducing instances of PIPE_QUERY_PRIMITIVES_GENERATED

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: pass screen param to convert_query_type()
Mike Blumenkrantz [Mon, 2 May 2022 12:53:00 +0000 (08:53 -0400)]
zink: pass screen param to convert_query_type()

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: pass query object to get_num_results()
Mike Blumenkrantz [Mon, 2 May 2022 12:36:42 +0000 (08:36 -0400)]
zink: pass query object to get_num_results()

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: pass query object to get_num_query_pools()
Mike Blumenkrantz [Mon, 2 May 2022 12:35:07 +0000 (08:35 -0400)]
zink: pass query object to get_num_query_pools()

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: pass query object to get_num_queries()
Mike Blumenkrantz [Mon, 2 May 2022 12:31:45 +0000 (08:31 -0400)]
zink: pass query object to get_num_queries()

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agozink: hook up VK_EXT_primitives_generated_query
Mike Blumenkrantz [Mon, 2 May 2022 12:24:33 +0000 (08:24 -0400)]
zink: hook up VK_EXT_primitives_generated_query

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16274>

2 years agogallivm: use VPERMPS (x86/AVX2) for 32-bit 8-element shuffles
Autumn on Tape [Fri, 1 Apr 2022 20:03:40 +0000 (13:03 -0700)]
gallivm: use VPERMPS (x86/AVX2) for 32-bit 8-element shuffles

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agogallivm: use shufflevector for shuffles when index is constant data
Autumn on Tape [Fri, 1 Apr 2022 20:03:30 +0000 (13:03 -0700)]
gallivm: use shufflevector for shuffles when index is constant data

This checks if index is a ConstantAggregateZero, ConstantDataSequential,
or UndefValue and emits a single shufflevector instead of a loop if so.

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agolavapipe: enable subgroup shuffle operations
Autumn on Tape [Fri, 1 Apr 2022 20:03:20 +0000 (13:03 -0700)]
lavapipe: enable subgroup shuffle operations

Bits flipped in VkPhysicalDeviceSubgroupProperties.supportedOperations:
  * SUBGROUP_FEATURE_SHUFFLE_BIT
  * SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agogallivm: add subgroup shuffle support
Autumn on Tape [Fri, 1 Apr 2022 20:02:55 +0000 (13:02 -0700)]
gallivm: add subgroup shuffle support

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agonir: Don't assert on tg4 offset range.
Emma Anholt [Sat, 30 Apr 2022 14:40:59 +0000 (07:40 -0700)]
nir: Don't assert on tg4 offset range.

From the GL 4.6 spec: "If the value of any non-ignored component of the
offset vector operand is outside implementation-dependent limits, the
results of the texture lookup are undefined."  We shouldn't assertion
fail, then.

GLSL-to-NIR shouldn't be enforcing limits on TG4 offsets, since it doesn't
for non-TG4 tex_src_offset either.  Leave it up to the driver to handle
it.

Fixes a crash in a piglit test on nouveau that supplies a negative random
number up to 10,000 as the first coordinate for some reason.  Other NIR
drivers lowered TG4 explicit offsets to tex_src_offset, so they weren't
affected.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16261>

2 years agowgl: always set alpha on kopper windows
Mike Blumenkrantz [Mon, 25 Apr 2022 20:02:14 +0000 (16:02 -0400)]
wgl: always set alpha on kopper windows

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16153>

2 years agoutil: fix test on msvc
Erik Faye-Lund [Tue, 3 May 2022 08:41:05 +0000 (10:41 +0200)]
util: fix test on msvc

We also miss this function on MSVC. But let's use the functionality in
meson to check for supported functions instead of hand-rolling the list
here.

Fixes: 067023dce2c ("util: Add some unit tests of the half-float conversions.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16290>

2 years agonir: Don't set writes_memory for reading XFB
Alyssa Rosenzweig [Mon, 2 May 2022 17:59:55 +0000 (13:59 -0400)]
nir: Don't set writes_memory for reading XFB

That's a read, not a write. Fixes optimizations getting disabled for fragment
shaders when linked with a shader producing transform feedback varyings.

Fixes: 85a723975bb ("nir: add and gather shader_info::writes_memory")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16285>

2 years agonir: Eliminate out-of-bounds read/writes in local lowering.
Emma Anholt [Wed, 20 Apr 2022 21:31:50 +0000 (14:31 -0700)]
nir: Eliminate out-of-bounds read/writes in local lowering.

Avoids nir validation assertion failures, and it's not like backend
drivers would want to see definitely-out-of-bounds read/writes either.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16066>

2 years agoci: traces: re-enable disabled traces which are now trimmed traces
David Heidelberg [Mon, 2 May 2022 07:01:22 +0000 (09:01 +0200)]
ci: traces: re-enable disabled traces which are now trimmed traces

After checksum mismatch, visually verified both re-enabled traces and
updated checksums for virgl-traces job.

Suggested-by: Emma Anholt <emma@anholt.net>
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/16260>

2 years agoci: traces: switch to Valve trimmed traces
David Heidelberg [Sat, 30 Apr 2022 12:31:01 +0000 (14:31 +0200)]
ci: traces: switch to Valve trimmed traces

Valve has trimmed traces already for some time, switch to
them to save network bandwidth, storage and run-time.

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/16260>

2 years agopan/bi: Use a dynarray for predecessors
Alyssa Rosenzweig [Tue, 19 Apr 2022 22:58:27 +0000 (18:58 -0400)]
pan/bi: Use a dynarray for predecessors

This is deterministic, unlike a set. Note we need the extra dereferencing to
keep the macro safe, simple, and standards compliant:

1. Nesting two for-loops would cause break/continue to fail.
2. Declaring variables outside the loop would pollute the namespace.
3. Declaring an anonymous struct is not conformant and doesn't compile in clang.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Use worklist for scoreboard analysis
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:08:44 +0000 (14:08 -0400)]
pan/bi: Use worklist for scoreboard analysis

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Use bi_worklist for post-RA liveness
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:06:09 +0000 (14:06 -0400)]
pan/bi: Use bi_worklist for post-RA liveness

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Use bi_worklist for liveness
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:04:20 +0000 (14:04 -0400)]
pan/bi: Use bi_worklist for liveness

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Use bi_worklist in analyze_helper_requirements
Alyssa Rosenzweig [Tue, 19 Apr 2022 17:35:19 +0000 (13:35 -0400)]
pan/bi: Use bi_worklist in analyze_helper_requirements

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Add u_worklist wrapper macros
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:00:10 +0000 (14:00 -0400)]
pan/bi: Add u_worklist wrapper macros

..expanding to bi_block.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>

2 years agopan/bi: Count blocks
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:00:01 +0000 (14:00 -0400)]
pan/bi: Count blocks

For u_worklist.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>