platform/upstream/mesa.git
3 years agoci/softpipe: run KHR-GLESxx tests
Juan A. Suarez Romero [Mon, 19 Apr 2021 07:53:51 +0000 (09:53 +0200)]
ci/softpipe: run KHR-GLESxx tests

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>

3 years agoci/llvmpipe: run KHR-GLES2.* tests
Juan A. Suarez Romero [Mon, 19 Apr 2021 07:53:18 +0000 (09:53 +0200)]
ci/llvmpipe: run KHR-GLES2.* tests

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>

3 years agoci/v3d: add KHR-GLES test jobs
Juan A. Suarez Romero [Fri, 16 Apr 2021 15:10:23 +0000 (17:10 +0200)]
ci/v3d: add KHR-GLES test jobs

Add (manually launched) jobs for KHR-GLES2.*, KHR-GLES3.* and
KHR-GLES31.*

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>

3 years agoci: support KHR-GLES testing
Juan A. Suarez Romero [Fri, 16 Apr 2021 11:01:11 +0000 (13:01 +0200)]
ci: support KHR-GLES testing

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>

3 years agoturnip: add LRZ early-z support
Samuel Iglesias Gonsálvez [Thu, 4 Feb 2021 15:50:12 +0000 (16:50 +0100)]
turnip: add LRZ early-z support

Imported the logic from Freedreno driver.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>

3 years agoturnip: fix setting dynamic state mask for VK_DYNAMIC_STATE_STENCIL_OP_EXT case
Samuel Iglesias Gonsálvez [Fri, 5 Feb 2021 08:52:55 +0000 (09:52 +0100)]
turnip: fix setting dynamic state mask for VK_DYNAMIC_STATE_STENCIL_OP_EXT case

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>

3 years agoturnip: group all geometry constant draw states in one
Samuel Iglesias Gonsálvez [Thu, 4 Feb 2021 15:27:24 +0000 (16:27 +0100)]
turnip: group all geometry constant draw states in one

Thus, we can free some draw state slots for future use.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>

3 years agoturnip: update LRZ state based on stencil test state
Samuel Iglesias Gonsálvez [Thu, 21 Jan 2021 14:40:19 +0000 (15:40 +0100)]
turnip: update LRZ state based on stencil test state

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>

3 years agoturnip: implement LRZ direction
Samuel Iglesias Gonsálvez [Thu, 21 Jan 2021 12:32:46 +0000 (13:32 +0100)]
turnip: implement LRZ direction

There are some LRZ compare op switches that are not supported by
the HW, like GREATER* <-> LESS* ones.

This patch tracks the direction of the switch and disables LRZ
if needed.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>

3 years agoradv: fix emitting depth bias when beginning a command buffer
Samuel Pitoiset [Mon, 19 Apr 2021 06:44:40 +0000 (08:44 +0200)]
radv: fix emitting depth bias when beginning a command buffer

If depth bias is enabled but zero values used, they were never
emitted to the command buffer because they are equal to the default
values.

Previously, they were always emitted when the bound DS attachment
changed.

This should fix some sort of Z fighting with Dota2 on all GPUs.
This also fixes a different issue (ie. some occlusion queries failures)
on GFX6 because CLEAR_STATE is not used on that chip.

Fixes: 8a47422d977 ("radv: do not scale the depth bias for D16_UNORM depth surfaces")
Cc: 21.1 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/10310>

3 years agoradv: fix fast clearing depth-only or stencil-only aspects with HTILE
Samuel Pitoiset [Fri, 16 Apr 2021 07:25:42 +0000 (09:25 +0200)]
radv: fix fast clearing depth-only or stencil-only aspects with HTILE

DB isn't coherent with L2 on GFX6-8. This is needed when the
clear HTILE mask path is selected.

This fixes an issue with avatars in Heroes of The Storm.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3362
Cc: 21.1 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/10277>

3 years agogallivm: add 16-bit integer support
Erik Faye-Lund [Mon, 12 Apr 2021 10:24:50 +0000 (12:24 +0200)]
gallivm: add 16-bit integer support

The new failure here is due to a bug in the test-case, and a fix has
been submitted here:

https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/502

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

3 years agogallivm: run nir_opt_algebraic_late
Erik Faye-Lund [Fri, 9 Apr 2021 09:45:31 +0000 (11:45 +0200)]
gallivm: run nir_opt_algebraic_late

Without this, we're left with a bunch of medium-precision residue, like
i2imp. And to avoid that the lowering intrudces left-over instructions,
also run other lowering passes, similar to what other drivers do.

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

3 years agogallivm: handle 16-bit input in i2b32
Erik Faye-Lund [Mon, 12 Apr 2021 14:20:06 +0000 (16:20 +0200)]
gallivm: handle 16-bit input in i2b32

Fixes: dac8cb981f4 ("gallivm/nir: allow 8/16-bit conversion and comparison.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>

3 years agoci/radeonsi: Add expected failures due to #4674 having slipped in
Tomeu Vizoso [Tue, 20 Apr 2021 07:02:12 +0000 (09:02 +0200)]
ci/radeonsi: Add expected failures due to #4674 having slipped in

https://gitlab.freedesktop.org/mesa/mesa/-/issues/4674

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci: Drop hack to disable all modules from defconfig
Tomeu Vizoso [Wed, 14 Apr 2021 06:02:19 +0000 (08:02 +0200)]
ci: Drop hack to disable all modules from defconfig

It was disabling the building of drivers that were needed in some
devices.

After merging we will anyway only have the modules we want (amdgpu atm),
so it's not really needed.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci: Use a single kernel+rootfs for both baremetal and LAVA jobs
Tomeu Vizoso [Tue, 13 Apr 2021 05:40:36 +0000 (07:40 +0200)]
ci: Use a single kernel+rootfs for both baremetal and LAVA jobs

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci: Test RadeonSI with piglit's quick_gl
Tomeu Vizoso [Wed, 7 Apr 2021 07:23:13 +0000 (09:23 +0200)]
ci: Test RadeonSI with piglit's quick_gl

And do some job refactoring to share more lines between job definitions.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci/lava: Start Xorg on request, for Piglit
Tomeu Vizoso [Fri, 9 Apr 2021 09:55:34 +0000 (11:55 +0200)]
ci/lava: Start Xorg on request, for Piglit

We will need this for running Piglit jobs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci/lava: Update kernel for LAVA to 5.11
Tomeu Vizoso [Fri, 9 Apr 2021 08:02:15 +0000 (10:02 +0200)]
ci/lava: Update kernel for LAVA to 5.11

Also enable CONFIG_DRM_AMDGPU_USERPTR to support GL_AMD_pinned_memory.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci/lava: Build all piglit profiles in LAVA images
Tomeu Vizoso [Wed, 7 Apr 2021 09:09:51 +0000 (11:09 +0200)]
ci/lava: Build all piglit profiles in LAVA images

Previously we were using only the replay profile, but we want to test
with the other ones now.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agoci: Reenable radeonsi jobs, and extend coverage
Tomeu Vizoso [Wed, 7 Apr 2021 06:07:46 +0000 (08:07 +0200)]
ci: Reenable radeonsi jobs, and extend coverage

Now that we have more devices to test on.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>

3 years agopanfrost: Fix Bo imports to not take the process down if fd is invalid
Carsten Haitzler (Rasterman) [Mon, 19 Apr 2021 08:36:47 +0000 (09:36 +0100)]
panfrost: Fix Bo imports to not take the process down if fd is invalid

If the calling process happens to use an invalid bo (e.g. fd has been
closed), this led to lseek() returning -1 and this mmap trying to mmap
a buffer of size -1 (0xffffffffffffffff ...) which led to mmap
failing, which led to munmap failing which then led to the process
aborting.

This fixes that to gracefully handle the mmap failures and percolate
the failures back up through the API so eglCreateImage will not return
a valid image anymore, thus the error is detectable in the caller
process too.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10313>

3 years agodrm-shim: fix compile with glibc >= 2.33
Christian Gmeiner [Mon, 19 Apr 2021 07:00:41 +0000 (09:00 +0200)]
drm-shim: fix compile with glibc >= 2.33

Fixes compile of drm-shim with glibc 2.33.

Closes: #3782
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10309>

3 years agollvmpipe: delay late screen creation until context init.
Dave Airlie [Tue, 20 Apr 2021 01:35:29 +0000 (11:35 +1000)]
llvmpipe: delay late screen creation until context init.

This avoids a problem with lavapipe where the screen hangs around in the
vulkan instance but is just wasting resources.

This was pointed out by Mike Blumenkrantz

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

3 years agollvmpipe: wrap late screen init with a mutex.
Dave Airlie [Tue, 20 Apr 2021 01:30:46 +0000 (11:30 +1000)]
llvmpipe: wrap late screen init with a mutex.

Next step can just move this into context init

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

3 years agollvmpipe: split screen init up.
Dave Airlie [Tue, 20 Apr 2021 01:27:18 +0000 (11:27 +1000)]
llvmpipe: split screen init up.

Add a late init path for stuff that can be delayed.

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

3 years agolavapipe: add support for non-dri loader on linux
Dave Airlie [Thu, 4 Mar 2021 05:49:51 +0000 (15:49 +1000)]
lavapipe: add support for non-dri loader on linux

If you build --glx=gallium-xlib then lavapipe will fail to
link this should let it use the non-dri paths on Linux in that
case

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9400>

3 years agoCI: Windows: Bump warning level to W3 (except for zlib)
Jesse Natalie [Mon, 19 Apr 2021 17:09:12 +0000 (10:09 -0700)]
CI: Windows: Bump warning level to W3 (except for zlib)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agoxmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 19:21:36 +0000 (12:21 -0700)]
xmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agollvmpipe: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 19:21:27 +0000 (12:21 -0700)]
llvmpipe: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agogallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 18:53:04 +0000 (11:53 -0700)]
gallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agoshader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 18:52:12 +0000 (11:52 -0700)]
shader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)

The warning is triggered when assigning into inputs_read, which is 64bit.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agomicrosoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:08:52 +0000 (10:08 -0700)]
microsoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agomicrosoft/clc: Fix undeclared function warning
Jesse Natalie [Mon, 19 Apr 2021 17:08:43 +0000 (10:08 -0700)]
microsoft/clc: Fix undeclared function warning

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agomicrosoft/clc: Fix MSVC unreferenced variable warnings
Jesse Natalie [Mon, 19 Apr 2021 17:08:15 +0000 (10:08 -0700)]
microsoft/clc: Fix MSVC unreferenced variable warnings

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agod3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:07:40 +0000 (10:07 -0700)]
d3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agonir: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:07:21 +0000 (10:07 -0700)]
nir: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

3 years agogallium/hud: extend check for has_srgb
Erico Nunes [Tue, 13 Apr 2021 22:59:46 +0000 (00:59 +0200)]
gallium/hud: extend check for has_srgb

gallium hud checks for the PIPE_FORMAT_B8G8R8A8_SRGB format to set
has_srgb, but can then receive a different format such as
PIPE_FORMAT_B8G8R8X8 in hud_run.
If the driver supports PIPE_FORMAT_B8G8R8A8_SRGB but does not support
the other formats such as PIPE_FORMAT_B8G8R8X8_SRGB, that will break
rendering as gallium hud assumes srgb is also supported for that format.
Extend the check to set has_srgb to prevent that from happening.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10222>

3 years agogallium/hud: create vs_text to match fs_text
Erico Nunes [Mon, 12 Apr 2021 08:05:43 +0000 (10:05 +0200)]
gallium/hud: create vs_text to match fs_text

gallium hud uses different tgsi fragment shaders for text and background
quads, which have different varying layouts. Since these are compiled
directly from tgsi they bypass some optimizations and may not work
properly on all backends.
A simple fix for the varying layout problem is to define a vs_text
shader to match the varyings in fs_text so the problem is avoided.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10222>

3 years agovirgl: move new added field to the end.
Lepton Wu [Mon, 19 Apr 2021 21:18:58 +0000 (14:18 -0700)]
virgl: move new added field to the end.

This field was introduced 2 months ago and it breaks virgl
compatibility between guest/host. Switch the new added field
to the end. We will still have compatibility issue but the
"bug window" is much smaller.

Fixes: e778aceaae0 ("virgl: update headers")

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10333>

3 years agoiris/gfx12: Invalidate ISP at the end of every batch.
Francisco Jerez [Wed, 14 Apr 2021 22:01:24 +0000 (15:01 -0700)]
iris/gfx12: Invalidate ISP at the end of every batch.

As requested by Ken since we're now (after 20e2c7308f674122)
re-emitting constants at the beginning of every batch which may lead
to some redundant constant restore overhead.  No statistically
significant performance changes observed with either change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9903>

3 years agomeson: OpenMP is supposed to be optional
Dylan Baker [Fri, 16 Apr 2021 16:24:27 +0000 (09:24 -0700)]
meson: OpenMP is supposed to be optional

The code around it checks that it is found, so clearly it was meant to
be optional, not arequired.

Fixes: cd2832ee5107201493d59f70983f162653e53c7d
       ("meson: add an optional OpenMP dependency for AMD tests")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10286>

3 years agov3dv/pipeline: track descriptor maps per stage, not per pipeline
Alejandro Piñeiro [Thu, 15 Apr 2021 23:06:34 +0000 (01:06 +0200)]
v3dv/pipeline: track descriptor maps per stage, not per pipeline

One of the conclusions of our recent clean up on the limits was that
the pipeline limits needed to be the per-stage limits multiplied by
the number of stages.

But until now we only have a set of descriptor maps for the full
pipeline. That would work if we could set the same limit per pipeline
that per stage, but that is not the case. So if, for example, we have
the fragment shader using V3D_MAX_TEXTURE_SAMPLERS textures, and then
the vertex shader, with a different descriptor set, using one texture,
we would get an index greater that V3D_MAX_TEXTURE_SAMPLERS. We assert
that index as an error on the vulkan backend, but fwiw, it would be
also asserted on the compiler.

With this commit we track and allocate a descriptor map per stage,
although we reuse the vertex shader descriptor map for the vertex bin.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10272>

3 years agomeson: link vulkan_util with link_whole on mingw
Michel Zou [Sun, 18 Apr 2021 13:44:58 +0000 (15:44 +0200)]
meson: link vulkan_util with link_whole on mingw

It was missing for mingw.

Closes #4633

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: James Park <jpark37@lagfreegames.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276>

3 years agogallium: fix uninitialized variable warning
Michel Zou [Thu, 15 Apr 2021 20:38:44 +0000 (22:38 +0200)]
gallium: fix uninitialized variable warning

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

3 years agovulkan: fix duplicate win32 def
Michel Zou [Thu, 15 Apr 2021 20:38:24 +0000 (22:38 +0200)]
vulkan: fix duplicate win32 def

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

3 years agolavapipe: fix unused variable warning
Michel Zou [Thu, 15 Apr 2021 20:37:58 +0000 (22:37 +0200)]
lavapipe: fix unused variable warning

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

3 years agofreedreno/a6xx: Don't try to do Z-as-RGBA blits for mismatched formats.
Eric Anholt [Mon, 19 Apr 2021 18:49:14 +0000 (11:49 -0700)]
freedreno/a6xx: Don't try to do Z-as-RGBA blits for mismatched formats.

Fixes piglit crashes doing glCopyTexSubImage from (for example)
PIPE_FORMAT_Z24_UNORM_S8_UINT to PIPE_FORMAT_Z32_FLOAT_S8X24_UINT where,
in addition to reading the source Z values incorrectly, we would try to
dereference the missing separate stencil of the Z24S8 buffer.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10328>

3 years agospirv: fix uToAccelerationStructure handling
Lionel Landwerlin [Mon, 19 Apr 2021 15:48:09 +0000 (18:48 +0300)]
spirv: fix uToAccelerationStructure handling

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7f223a2329a7d3 ("spirv: Implement SpvOpConvertUToAccelerationStructureKHR")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10324>

3 years agofreedreno: Mark glsl-fs-fogscale as a Fail.
Eric Anholt [Mon, 19 Apr 2021 19:15:06 +0000 (12:15 -0700)]
freedreno: Mark glsl-fs-fogscale as a Fail.

I have a note in -flakes.txt about how it can flake to being a Crash
instead of a Fail, but I haven't been able to reproduce that flake today.
It does always fail in the GS subtest, though, so quiet the flake spam in

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

3 years agomeson: Increase Android Platform SDK version limit
Billy Laws [Sun, 28 Mar 2021 15:17:26 +0000 (15:17 +0000)]
meson: Increase Android Platform SDK version limit

This is required to allow building with support for newer whitelisted
extensions such as VK_KHR_performance_query.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9878>

3 years agomapi: Respect MESA_DEBUG=silent for no-op debug output.
Eric Anholt [Wed, 14 Apr 2021 18:28:54 +0000 (11:28 -0700)]
mapi: Respect MESA_DEBUG=silent for no-op debug output.

We set this in deqp-runner runs to disable Mesa debug/debugoptimized
builds printing to stderr for expected GL test behavior, and with the
addition of dEQP-EGL mapi got very verbose.  Move it to a call_once() too
to avoid data races.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>

3 years agoci/freedreno: Test dEQP-EGL against Xorg.
Eric Anholt [Fri, 2 Apr 2021 17:38:53 +0000 (10:38 -0700)]
ci/freedreno: Test dEQP-EGL against Xorg.

This should help us be able to refactor core EGL code with more
confidence, and increase our confidence uprevving Mesa in ChromeOS.

Part of #1884

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>

3 years agoci/llvmpipe: Test dEQP-EGL against Xvfb.
Eric Anholt [Fri, 2 Apr 2021 17:37:24 +0000 (10:37 -0700)]
ci/llvmpipe: Test dEQP-EGL against Xvfb.

This should help us refactor EGL code with more confidence than just
relying on piglit.  Reveals several llvmpipe EGL issues.

Part of #1884

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>

3 years agoci: Build deqp-egl targeting x11_egl_glx
Eric Anholt [Fri, 2 Apr 2021 17:31:28 +0000 (10:31 -0700)]
ci: Build deqp-egl targeting x11_egl_glx

This will be used to test llvmpipe against Xvfb and freedreno against
Xorg.  We keep the core deqp testing on surfaceless because
--deqp-surface-type=pbuffer fails on x11_egl_glx, =fbo has never worked in
VK-GL-CTS, and =window would increase test runtime for all the
swapbuffers.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>

3 years agopanfrost: Allow FPK when there are no side effects
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:27:52 +0000 (18:27 -0400)]
panfrost: Allow FPK when there are no side effects

Enables FPK for most real content.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agopanfrost: Don't allow FPK if a RT is missing
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:25:54 +0000 (18:25 -0400)]
panfrost: Don't allow FPK if a RT is missing

A fragment shader that forgets to write to one of the bound render
targets (in the presence of MRT) invalidates a core FPK invariant. Check
for this and add it to the naughty list.

I don't think this needs a backport since FPK isn't really used yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agopanfrost: Invert blend_reads_dest logic
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:20:58 +0000 (18:20 -0400)]
panfrost: Invert blend_reads_dest logic

Easier to understand (and match to actual hardware behaviour) this way.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agopanfrost: Set clean_fragment_write for blits
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:13:38 +0000 (18:13 -0400)]
panfrost: Set clean_fragment_write for blits

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agopanfrost: Set allow_forward_pixel_to_be_killed for blit
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:10:24 +0000 (18:10 -0400)]
panfrost: Set allow_forward_pixel_to_be_killed for blit

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agopanfrost: Don't allow_forward_pixel_to_kill for Z/S blit
Alyssa Rosenzweig [Thu, 15 Apr 2021 22:09:19 +0000 (18:09 -0400)]
panfrost: Don't allow_forward_pixel_to_kill for Z/S blit

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>

3 years agonir: Update some comments referring to imov
Alyssa Rosenzweig [Fri, 16 Apr 2021 23:40:14 +0000 (19:40 -0400)]
nir: Update some comments referring to imov

This was renamed when I was in high school. I remember updating the
Midgard compiler while sitting in AP Physics.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10296>

3 years agozink: Enable PIPE_CAP_PACKED_UNIFORMS.
Eric Anholt [Fri, 9 Apr 2021 23:50:15 +0000 (16:50 -0700)]
zink: Enable PIPE_CAP_PACKED_UNIFORMS.

We already support everything necessary and just need to ask the frontend
to DTRT.  This makes UBO0 get more tightly packed, saving upload space,
and allows for _mesa_optimize_state_parameters() as well.

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

3 years agopanfrost: Enable packed uniforms.
Eric Anholt [Fri, 9 Apr 2021 23:32:48 +0000 (16:32 -0700)]
panfrost: Enable packed uniforms.

Since we can handle arbitrary offsets in the load_ubo paths, we can let
the GLSL compiler pack UBO 0 tighter, saving uniform uploads.  This may
cause some straddling loads that could reduce performance for vec3s, but
those are rare in shader-db and we expect this to be outweighed by the
wins for normal float/vec2 packing.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10151>

3 years agozink: document requirement of VK_EXT_custom_border_color
Erik Faye-Lund [Mon, 19 Apr 2021 10:41:01 +0000 (12:41 +0200)]
zink: document requirement of VK_EXT_custom_border_color

Without this extension, we misrender when custom border colors are
used. Let's document this, and emit a warning when the extension is
missing.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10316>

3 years agoradv: Fix memory leak on descriptor pool reset with layout_size=0.
Bas Nieuwenhuizen [Mon, 19 Apr 2021 11:23:23 +0000 (13:23 +0200)]
radv: Fix memory leak on descriptor pool reset with  layout_size=0.

Gotta track those sets too to free them. Alse changed the search
on destroy to check for set instead of offset since offset is not
necessarily unique anymore.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4652
CC: mesa-stable
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10317>

3 years agoandroid: panfrost/lib: add pan_cs.c to Makefile.sources
Mauro Rossi [Sat, 17 Apr 2021 11:41:10 +0000 (13:41 +0200)]
android: panfrost/lib: add pan_cs.c to Makefile.sources

Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: pan_emit_tls
>>> referenced by pan_cmdstream.c:2279 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2279)
...
ld.lld: error: undefined symbol: pan_emit_fbd
>>> referenced by pan_cmdstream.c:2302 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2302)
...
ld.lld: error: undefined symbol: pan_emit_fragment_job
>>> referenced by pan_cmdstream.c:2382 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2382)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler_heap
>>> referenced by pan_job.c:718 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:718)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler
>>> referenced by pan_job.c:723 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:723)
...
ld.lld: error: undefined symbol: pan_fbd_has_zs_crc_ext
>>> referenced by pan_job.c:893 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:893)
...
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: 21.1 <mesa-stable@lists.freedesktop.org>
Fixes: 387f8c037d38 ("panfrost: Add various helpers to simplify FB desc emission")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10299>

3 years agovenus: refactor vn_queue_submission_count_semaphores
Chia-I Wu [Fri, 16 Apr 2021 17:34:15 +0000 (10:34 -0700)]
venus: refactor vn_queue_submission_count_semaphores

Add vn_queue_submission_count_batch_semaphores that works on a single
batch at a time.  Also avoid code duplication.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10290>

3 years agogallium: Define PIPE_ARCH_AARCH64 for MSVC arm64 builds
Jesse Natalie [Sat, 17 Apr 2021 02:00:55 +0000 (19:00 -0700)]
gallium: Define PIPE_ARCH_AARCH64 for MSVC arm64 builds

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>

3 years agoutil/format: Add some NEON intrinsics-based u_format_unpack.
Eric Anholt [Mon, 5 Apr 2021 16:33:21 +0000 (09:33 -0700)]
util/format: Add some NEON intrinsics-based u_format_unpack.

In looking at the profile of dEQP, GLES3 was spending 5-10% of its time in
ReadPixels, and almost all of that is b8g8r8a8_unorm8.  It's really slow
because we're getting about 47MB/s by doing uncached reads 32 bits at a
time in the code-generated unpack.  If we use NEON to generate larger bus
transactions, we can speed things up to 136MB/s.  In comparison, raw
ldr/str read/writes with no byte swapping can hit a max of 216MB/sec.

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

3 years agoutil: Switch the non-block formats to unpacking rgba rows instead of rects.
Eric Anholt [Fri, 2 Apr 2021 21:35:01 +0000 (14:35 -0700)]
util: Switch the non-block formats to unpacking rgba rows instead of rects.

We have only a few callers of unpack that do rects, so add a helper that
iterates over y adding the strides.  This saves us 36kb of generated code
and means that adding cpu-specific variants for RGBA format unpack will be
much simpler.

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

3 years agomesa: Remove dead _mesa_unpack_rgba_block().
Eric Anholt [Fri, 2 Apr 2021 23:32:22 +0000 (16:32 -0700)]
mesa: Remove dead _mesa_unpack_rgba_block().

Despite many changes over its lifetime, it appears to have been dead ever
since its introduction in 2011.

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

3 years agoradeonsi: Report multi-plane formats as unsupported
Drew Davenport [Tue, 9 Mar 2021 23:49:47 +0000 (16:49 -0700)]
radeonsi: Report multi-plane formats as unsupported

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693 added
NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM, which regressed some
video decode use cases in radeonsi, for example CtsDecodeTestCases in
android CTS. There are also discolored frames in video playback use
cases (i.e. youtube).

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3632
previously fixed similar issues in radeonsi. This change takes that a
step further to report any multi-plane format as unsupported.

Fixes: 826a10255f5 ("st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9490>

3 years agoturnip: implement VK_KHR_shader_terminate_invocation
Danylo Piliaiev [Fri, 5 Mar 2021 18:28:54 +0000 (20:28 +0200)]
turnip: implement VK_KHR_shader_terminate_invocation

OpTerminateInvocation provides the behavior required by the GLSL
discard statement, which we already implement.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>

3 years agoturnip: implement VK_EXT_shader_demote_to_helper_invocation
Danylo Piliaiev [Fri, 5 Mar 2021 18:01:34 +0000 (20:01 +0200)]
turnip: implement VK_EXT_shader_demote_to_helper_invocation

The "demote" intrinsic has the semantics of D3D discard, which means
it doesn't change the control flow, allowing derivatives to work.

On A6xx there is no known way to check whether invocation was demoted,
thus we use nir_lower_is_helper_invocation.

Add "logical" OPC_DEMOTE which is later translated to "kill".
Such separation is necessary to run "kill" specific optimizations
which are invalid for "demote".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>

3 years agonir: add lowering pass for helperInvocationEXT()
Danylo Piliaiev [Fri, 5 Mar 2021 17:58:25 +0000 (19:58 +0200)]
nir: add lowering pass for helperInvocationEXT()

Some hardware doesn't have a way to check if invocation was demoted,
in such case we have to track it ourselves.
OpIsHelperInvocationEXT is specified as:

 "An invocation is currently a helper invocation if it was originally
  invoked as a helper invocation or if it has been demoted to a helper
  invocation by OpDemoteToHelperInvocationEXT."

Therefore we:
- Set gl_IsHelperInvocationEXT = gl_HelperInvocation
- Add "gl_IsHelperInvocationEXT = true" right before each demote
- Add "gl_IsHelperInvocationEXT = gl_IsHelperInvocationEXT || condition"
  right before each demote_if

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>

3 years agoci/lava: Point the shader cache at tmpfs.
Eric Anholt [Fri, 16 Apr 2021 21:47:14 +0000 (14:47 -0700)]
ci/lava: Point the shader cache at tmpfs.

We really don't want to be going out over NFS and back for our shader
cache references.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10297>

3 years agoci/piglit: Always include the HTML summary in a run.
Eric Anholt [Fri, 16 Apr 2021 21:39:56 +0000 (14:39 -0700)]
ci/piglit: Always include the HTML summary in a run.

It's the best visualization for run results when using the piglit
framework, and now all the DUTs return artifacts.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10297>

3 years agoci/lava: Return the run's results/ artifacts from the DUTs.
Eric Anholt [Fri, 16 Apr 2021 21:18:07 +0000 (14:18 -0700)]
ci/lava: Return the run's results/ artifacts from the DUTs.

Finally LAVA users will be able to see deqp XMLs on failures from the
job's artifacts browser.  This replaces a couple of one-off minio uploads
in the piglit runner.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10297>

3 years agoci/lavapipe: Don't include deqp's shader_cache in the artifacts.
Eric Anholt [Fri, 5 Feb 2021 22:46:48 +0000 (14:46 -0800)]
ci/lavapipe: Don't include deqp's shader_cache in the artifacts.

We don't care to look at it and we don't reuse it.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10297>

3 years agoaco: fix opquantize2f16 on GFX6-7
Samuel Pitoiset [Mon, 19 Apr 2021 11:47:14 +0000 (13:47 +0200)]
aco: fix opquantize2f16 on GFX6-7

Make sure to preserve signed zeroes.

Fixes dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
on GFX6 (Pitcairn). Untested on GFX7.

Fixes: 54a09545ec6 ("aco: optimize a*0.0")
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/10319>

3 years agoir3: Assemble and disassemble swz/gat/sct
Connor Abbott [Fri, 16 Apr 2021 15:13:30 +0000 (17:13 +0200)]
ir3: Assemble and disassemble swz/gat/sct

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

3 years agoir3: Improve cat1 modifier disassembly
Connor Abbott [Fri, 16 Apr 2021 12:07:44 +0000 (14:07 +0200)]
ir3: Improve cat1 modifier disassembly

Remove bit that shouldn't be part of (rptN), and rewrite the handling of
(even) and (pos_infinity) to uncover a missing (neg_infinity) modifier.

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

3 years agoir3/parser: Fix oob write with immediates array
Connor Abbott [Fri, 16 Apr 2021 16:36:20 +0000 (18:36 +0200)]
ir3/parser: Fix oob write with immediates array

immediates_count and immediates_size are supposed to have the same
units, but it was only incrementing immediates_count by 1. While we're
here, also fix the case where constants are specified out-of-order.

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

3 years agomicrosoft/clc: If local size isn't specified either in the shader or at runtime,...
Jesse Natalie [Sun, 18 Apr 2021 00:26:37 +0000 (17:26 -0700)]
microsoft/clc: If local size isn't specified either in the shader or at runtime, set it to (1,1,1)

Otherwise we can end up in situations like having divide-by-zero. If the optimization is smart enough
that we end up with a *constant* divide-by-zero, then the DXIL validator will fail to sign, which
can trigger fatal errors with CLOn12.

We want to run an initial translation of all kernels during program build, but at that point we don't
know the local size to be able to specify it through kernel specialization data.

v2: Metadata output of 0 is used to indicate that the size wasn't explicitly specific. Copy the
    size to the metadata before overriding it to (1,1,1). If conf was explicitly specified,
    update the metadata again (though nobody should be paying attention to it).

Closes: https://github.com/microsoft/OpenCLOn12/issues/20
Closes: https://github.com/darktable-org/darktable/issues/8700
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10303>

3 years agovirgl: resources without any binding can be cached
Stéphane Marchesin [Wed, 14 Apr 2021 06:05:24 +0000 (08:05 +0200)]
virgl: resources without any binding can be cached

Certain games create and destroy lots of resources without binding them.
This can take quite a bit of time and even create unneeded
synchronization. However, we know that if a resource was never bound to
anything, it can be cached. This change does that.

Counting the number of uncached allocation with a tabletop simulator trace:
Before: 2967 uncached allocations over the replay
After: 24 uncached allocations over the replay

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

3 years agonir/lower_tex: do not stumble on 16-bit inputs
Erik Faye-Lund [Wed, 7 Apr 2021 17:29:40 +0000 (19:29 +0200)]
nir/lower_tex: do not stumble on 16-bit inputs

If a has been lowered to float16 here, then we end up trying to
construct a vector of mixed precision, which the validator asserts
about.

So let's make sure we use the same type for all arguments.

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

3 years agolavapipe: implement VK_EXT_custom_border_color
Erik Faye-Lund [Mon, 19 Apr 2021 11:30:22 +0000 (13:30 +0200)]
lavapipe: implement VK_EXT_custom_border_color

This fixes a bunch of piglit failures on Zink.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10320>

3 years agolavapipe: resolve border-color when creating sampler
Erik Faye-Lund [Mon, 19 Apr 2021 11:25:36 +0000 (13:25 +0200)]
lavapipe: resolve border-color when creating sampler

This is going to make it easier to implement the custom border-color
extension.

While we're moving the code, tweak the memset code a bit, so we don't do
any float-ism in the int-case. It doesn't change anything functionally,
just makes it slightly clearer what's going on here.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10320>

3 years agost/pbo: use cso_set_vertex_buffers_and_elements() for st_pbo_draw
Mike Blumenkrantz [Thu, 15 Apr 2021 16:50:19 +0000 (12:50 -0400)]
st/pbo: use cso_set_vertex_buffers_and_elements() for st_pbo_draw

this lets us use the more consistent codepath and ordering (buffers -> elems)
as well as set take_ownership=true to skip the unref

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

3 years agozink: fix tcs input reservation for user vars
Mike Blumenkrantz [Thu, 15 Apr 2021 14:20:29 +0000 (10:20 -0400)]
zink: fix tcs input reservation for user vars

tcs user vars are var_size[32], which isn't actually how many slots they need,
just how big the variable is (oops), so this needs to be divided
by MAX_PATCH_VERTICES to get the real slot count

slot mapping has always been broken for all tcs inputs, but this probably fixes
all of the related issues there, including unlimited crashes when playing Tomb Raider

Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>

3 years agozink: fix tcs slot map eval for user vars
Mike Blumenkrantz [Thu, 15 Apr 2021 14:23:21 +0000 (10:23 -0400)]
zink: fix tcs slot map eval for user vars

tcs user inputs need to have their size adjusted in order to determine whether
they'll overflow the existing slot map

Fixes: 5c5e1abea24 ("zink: evaluate existing slot map during program init and force new map as needed")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>

3 years agozink: always copy the nir shader before compiling
Mike Blumenkrantz [Thu, 15 Apr 2021 14:24:33 +0000 (10:24 -0400)]
zink: always copy the nir shader before compiling

nir_convert_from_ssa and assign_io_locations both modify this unconditionally,
the latter of which possibly re-modifies variables in ways that can break the
slot map and cause stack overflows during vk driver pipeline compilation

Fixes: 2b4609b66cd ("zink: run nir_convert_from_ssa last during compile")
Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

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

3 years agozink: fix stencil-export cap emission
Erik Faye-Lund [Thu, 15 Apr 2021 08:17:55 +0000 (10:17 +0200)]
zink: fix stencil-export cap emission

This cap should only ever be emitted for fragment-shaders, but we
accidentally emit it for all shaders. Let's tighten the check to avoid a
validator warning when emitting non-fragment shaders without support for
VK_EXT_shader_stencil_export.

Fixes: 8724d4fb361 ("zink: check shader stencil output")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10249>

3 years agogallium/util: add easy profiling helpers using TIME_ELAPSED queries
Marek Olšák [Fri, 2 Apr 2021 15:27:31 +0000 (11:27 -0400)]
gallium/util: add easy profiling helpers using TIME_ELAPSED queries

There are no users and that's intentional.

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

3 years agoRevert "r600: don't set an index_bias for indirect draw calls"
Gert Wollny [Mon, 19 Apr 2021 07:42:00 +0000 (09:42 +0200)]
Revert "r600: don't set an index_bias for indirect draw calls"

This reverts commit acdf1a123436cb3fa7d4bbc9cfbb9566c7693de4.

While this commit fixed the gles CTS regressions, it introduced
regressions that made the driver unusable, hence the revert.

Closes #4657

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10311>

3 years agovulkan/util: cast enums to int64_t in switch
Lionel Landwerlin [Sun, 18 Apr 2021 09:45:01 +0000 (12:45 +0300)]
vulkan/util: cast enums to int64_t in switch

With the new Vulkan Video extensions a bunch of enum values have been
added. The problem is that those are behind #ifdef so our generated
code complains that we using enum values not defined.

Since we're not using enum names but integer values, we can silence
all those by casting the enum type to int64_t.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10304>

3 years agoiris: move target to isl dim translate to inline.
Dave Airlie [Sun, 18 Apr 2021 23:36:19 +0000 (09:36 +1000)]
iris: move target to isl dim translate to inline.

This avoids a conflict in namespace when crocus wants to use the
same function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10308>

3 years agoiris: move get_time into a static in bufmgr code.
Dave Airlie [Sun, 18 Apr 2021 23:30:49 +0000 (09:30 +1000)]
iris: move get_time into a static in bufmgr code.

This ends up polluting the namespace if you build iris/crocus
at once, just move it to where it's used for now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10308>