mesa.git
3 years agoegl/android: Call createImageFromDmaBufs directly
Kristian H. Kristensen [Thu, 6 Aug 2020 23:38:28 +0000 (16:38 -0700)]
egl/android: Call createImageFromDmaBufs directly

Instead of building up EGL attribute lists and then having to parse
them again, call the DRI driver directly and then use the
dri2_create_image_from_dri() helper to wrap the __DRIimage in an
EGLImage.

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

3 years agofreedreno: Add afuc regression test
Connor Abbott [Tue, 18 Aug 2020 12:38:46 +0000 (14:38 +0200)]
freedreno: Add afuc regression test

a5xx is still TODO, but at least this is a start.

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

3 years agofreedreno/afuc: Install asm/disasm
Connor Abbott [Tue, 18 Aug 2020 12:37:13 +0000 (14:37 +0200)]
freedreno/afuc: Install asm/disasm

Make the name a bit longer, since when installed it's not tucked away
under afuc/ anymore.

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

3 years agofreedreno/afuc: Make 0 a valid number
Connor Abbott [Tue, 18 Aug 2020 12:36:37 +0000 (14:36 +0200)]
freedreno/afuc: Make 0 a valid number

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

3 years agofreedreno/afuc: Handle xmov modifiers
Connor Abbott [Mon, 17 Aug 2020 17:44:14 +0000 (19:44 +0200)]
freedreno/afuc: Handle xmov modifiers

Although it's kind-of similar to "(rptN)" in the shader ISA, I called it
"xmov" to make it clear that it's completely orthogonal to "(rep)",
although you certainly can use both modifiers on the same instruction.

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

3 years agofreedreno/afuc: Add iret
Connor Abbott [Mon, 17 Aug 2020 18:29:20 +0000 (20:29 +0200)]
freedreno/afuc: Add iret

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

3 years agofreedreno/afuc: Handle setsecure opcode
Connor Abbott [Mon, 17 Aug 2020 12:26:49 +0000 (14:26 +0200)]
freedreno/afuc: Handle setsecure opcode

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

3 years agofreedreno/afuc: Fix printing preemptleave on a5xx
Connor Abbott [Mon, 17 Aug 2020 12:11:39 +0000 (14:11 +0200)]
freedreno/afuc: Fix printing preemptleave on a5xx

This opcode is actually used on a5xx, but I'm not sure what it's for.

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

3 years agospirv: Add support for the CL Round instruction
Boris Brezillon [Tue, 28 Jul 2020 06:42:53 +0000 (08:42 +0200)]
spirv: Add support for the CL Round instruction

Add a round() implementation that's conformant with the CL spec.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6256>

3 years agomeson: Make some warnings handled as errors with MSVC
Gert Wollny [Thu, 23 Apr 2020 10:32:02 +0000 (12:32 +0200)]
meson: Make some warnings handled as errors with MSVC

We should really pass the right number and parameter types to
functions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6227>

3 years agomeson: Add MSVC narrowing-int-to-char warnings
Daniel Stone [Mon, 6 Apr 2020 20:35:09 +0000 (21:35 +0100)]
meson: Add MSVC narrowing-int-to-char warnings

MSVC seems quite keen to warn us that we're narrowing an int into a
char, even if it fits entirely within range.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6227>

3 years agoRevert "CI: Disable Panfrost T720/T760 CI"
Tomeu Vizoso [Tue, 18 Aug 2020 12:37:27 +0000 (14:37 +0200)]
Revert "CI: Disable Panfrost T720/T760 CI"

This reverts commit 9ef192c100b4c4520c99a9948bf0cfbd52e363fc.

Revert "CI: Disable Panfrost T860 and AMD Stoney tests"

This reverts commit 3e447c1ad2d605bb234b43ef63c5d9ce53d9ff37.

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

3 years agogallium/aux: reorder vertex attributes in triangle fans according to PV
Gert Wollny [Tue, 14 Jul 2020 13:28:00 +0000 (15:28 +0200)]
gallium/aux: reorder vertex attributes in triangle fans according to PV

With triangle fans when "first vertex convention" is active the
provoking vertex is actually the second vertex so that the different
triangle can have different colors with flat shading. Take this into
account when re-ordering the vertex indices (as proposed by Erik)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

3 years agogallium/indices: translate primitive-restart values
Erik Faye-Lund [Thu, 25 Jun 2020 10:26:54 +0000 (12:26 +0200)]
gallium/indices: translate primitive-restart values

This adds a config-option to u_primconvert that translates primitive
restart values to the max-values for the index size. This allows us to
support arbitrary primitive-restart indices on hardware that only
supports fixed restart-indices.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

3 years agogallium/indices: introduce u_primconvert_config
Erik Faye-Lund [Mon, 22 Jun 2020 13:05:17 +0000 (15:05 +0200)]
gallium/indices: introduce u_primconvert_config

This struct allows us to pass the configuration as a struct, which can
more easily be extended to take more arguemnts as long as we're careful
about zero-initialization.

We keep the old create-function, but implement it as a wrapper on top so
we don't have to update all existing call-sites right now.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

3 years agogallium/indices: implement prim-restart for triangle fans
Erik Faye-Lund [Mon, 22 Jun 2020 18:13:45 +0000 (20:13 +0200)]
gallium/indices: implement prim-restart for triangle fans

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

3 years agogallium/indices: use prim_restart-helper for polygon
Erik Faye-Lund [Mon, 22 Jun 2020 18:08:48 +0000 (20:08 +0200)]
gallium/indices: use prim_restart-helper for polygon

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

3 years agogallium/indices: implement prim-restart for line-loops
Erik Faye-Lund [Mon, 22 Jun 2020 16:38:03 +0000 (18:38 +0200)]
gallium/indices: implement prim-restart for line-loops

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

3 years agogallium/indices: generalize primitive-restart logic
Erik Faye-Lund [Thu, 18 Jun 2020 13:05:13 +0000 (15:05 +0200)]
gallium/indices: generalize primitive-restart logic

These blocks are all the same logic, but with a few details changed.
Let's add a parameterized version and add calls to that instead.

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

3 years agogallium/indices: don't expand prim-type for 8-bit indices
Erik Faye-Lund [Mon, 22 Jun 2020 13:56:45 +0000 (15:56 +0200)]
gallium/indices: don't expand prim-type for 8-bit indices

Expanding the primitive-type has two undesirable effects:

1. It breaks primitive-restart. This is possible to fix by explicitly
   handling primitive-restart in more conversion routines. But
   u_indices_gen.py is kind of a mess, so it's not trivial as-is.
2. It changes the reported gl_VertexID.

While it might be possible to work around this in each driver, it seems
better to avoid this when we can.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

3 years agogallium/util: factor out primitive-restart rewriting logic
Erik Faye-Lund [Wed, 17 Jun 2020 13:52:05 +0000 (15:52 +0200)]
gallium/util: factor out primitive-restart rewriting logic

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

3 years agospirv: Only require bare types to match when copying variables
Danylo Piliaiev [Mon, 17 Aug 2020 09:02:22 +0000 (12:02 +0300)]
spirv: Only require bare types to match when copying variables

OpCopyMemory doesn't care about mismatched decorations, only about
matching types.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3418
Fixes: bf1a1eed882980a1cd08482386e3a001ce64a5a4
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6344>

3 years agoglsl: fix crashes on out of bound matrix access using constant index
Marcin Ślusarz [Mon, 11 May 2020 21:26:40 +0000 (23:26 +0200)]
glsl: fix crashes on out of bound matrix access using constant index

Fixes these piglit tests:
- spec@glsl-1.20@execution@matrix-out-of-bounds-access@fs-mat4-out-of-bounds-2
- spec@glsl-1.20@execution@matrix-out-of-bounds-access@fs-mat4-out-of-bounds-4
- spec@glsl-1.20@execution@matrix-out-of-bounds-access@fs-mat4-out-of-bounds-5

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4998>

3 years agost/mesa: Replace UsesStreams by ActiveStreamMask for GS
Louis-Francis Ratté-Boulianne [Thu, 19 Mar 2020 08:59:27 +0000 (04:59 -0400)]
st/mesa: Replace UsesStreams by ActiveStreamMask for GS

Some drivers need to know which streams are used by a geometry
shader. Adding a mask of active streams makes the use of
UsesStreams superfluous as it's the equivalent of:

    ActiveStreamMask != (1 << 0)

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5984>

3 years agomeson: fix trivial s/dir/dri/ typo
Eric Engestrom [Mon, 17 Aug 2020 18:58:43 +0000 (20:58 +0200)]
meson: fix trivial s/dir/dri/ typo

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6354>

3 years agoCI: Disable Panfrost T720/T760 CI
Daniel Stone [Tue, 18 Aug 2020 10:16:31 +0000 (11:16 +0100)]
CI: Disable Panfrost T720/T760 CI

Lab maintenance has taken down more of the infrastructure than
originally planned; also disable these until it all comes back.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6362>

3 years agost/wgl: do not reject PFD_SUPPORT_GDI
Erik Faye-Lund [Fri, 12 Jun 2020 14:30:01 +0000 (16:30 +0200)]
st/wgl: do not reject PFD_SUPPORT_GDI

The WGL implementation is currently on top of GDI, so it supports GDI
just fine. No need to reject this.

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

3 years agoCI: Skip another flaky GS test on softpipe
Daniel Stone [Mon, 17 Aug 2020 17:49:27 +0000 (18:49 +0100)]
CI: Skip another flaky GS test on softpipe

Seems like it has real issues with GS in general. Just skip it for now
due to random failures seen a couple of times in the wild over the past
couple of weeks.

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

3 years agoCI: Skip flaky CS test on VirGL
Daniel Stone [Mon, 17 Aug 2020 17:47:16 +0000 (18:47 +0100)]
CI: Skip flaky CS test on VirGL

We've seen this crash a few times over the past couple of weeks, but
haven't yet managed to reproduce locally and fix. In the meantime, just
skip.

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

3 years agoCI: Disable Panfrost T860 and AMD Stoney tests
Daniel Stone [Thu, 13 Aug 2020 13:12:54 +0000 (14:12 +0100)]
CI: Disable Panfrost T860 and AMD Stoney tests

Due to scheduled physical lab maintenance to prepare for expansion and
better shard our device types across redundant infrastructure, these
device types will be inaccessible for approx. 3 hours. Disable them
until they are back.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6302>

3 years agonir/vtn: Support OpOrdered and OpUnordered opcodes
Jesse Natalie [Wed, 24 Jun 2020 17:58:36 +0000 (10:58 -0700)]
nir/vtn: Support OpOrdered and OpUnordered opcodes

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir/vtn: Handle LessOrGreater deprecated opcode
Jesse Natalie [Tue, 23 Jun 2020 12:44:39 +0000 (05:44 -0700)]
nir/vtn: Handle LessOrGreater deprecated opcode

Reviewed-by Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir/vtn: Support SpvOpIsFinite via fisfinite
Jesse Natalie [Tue, 23 Jun 2020 22:22:44 +0000 (15:22 -0700)]
nir/vtn: Support SpvOpIsFinite via fisfinite

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir: Add fisfinite op
Jesse Natalie [Tue, 23 Jun 2020 22:22:29 +0000 (15:22 -0700)]
nir: Add fisfinite op

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir/vtn: Support SpvOpIsNormal via fisnormal
Jesse Natalie [Mon, 8 Jun 2020 12:55:39 +0000 (05:55 -0700)]
nir/vtn: Support SpvOpIsNormal via fisnormal

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir: Add fisnormal op
Jesse Natalie [Mon, 8 Jun 2020 12:54:53 +0000 (05:54 -0700)]
nir: Add fisnormal op

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

3 years agonir: Fix i64tof32 lowering
Boris Brezillon [Wed, 12 Aug 2020 12:28:48 +0000 (14:28 +0200)]
nir: Fix i64tof32 lowering

The round-to-nearest-even implementation found in lower_2f() is incorrect
for any value having a significand that is not directly representable
and whose non-representable part lies between 1 and half the minimum
representable value. In this case, the significand is rounded up instead
of being rounded down.

Fixes: 936c58c8fcce ("nir: Extend nir_lower_int64() to support i2f/f2i lowering")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6290>

3 years agollvmpipe: enable GL 4.5
Dave Airlie [Mon, 20 Jul 2020 03:45:09 +0000 (13:45 +1000)]
llvmpipe: enable GL 4.5

This passes conformance on both the master and 4.6.0 (with patches)
branches. I'll be submitting results shortly from the 20.2.x branch
this lands in.

Cc: "20.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6044>

3 years agollvmpipe/blit: for 32-bit unorm depth blits just copy 32-bit
Dave Airlie [Mon, 20 Jul 2020 03:41:34 +0000 (13:41 +1000)]
llvmpipe/blit: for 32-bit unorm depth blits just copy 32-bit

Don't have the shader do a 32-bit unorn to float conversion,
the values don't remain accurate then.

Fixes:
GTF-GL45.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit
for 32-bit unorm depth buffers.

Cc: "20.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6044>

3 years agocompiler/nir: Add new flags to lower pack/unpack split instructions
Boris Brezillon [Tue, 21 Apr 2020 11:41:41 +0000 (04:41 -0700)]
compiler/nir: Add new flags to lower pack/unpack split instructions

And add new rules to do this lowering in nir_opt_algebraic.py.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6309>

3 years agomesa: Move ATTRIBUTE_NOINLINE for glsl_to_tgsi_visitor::visit_expression for MSVC
Jesse Natalie [Mon, 17 Aug 2020 17:32:21 +0000 (10:32 -0700)]
mesa: Move ATTRIBUTE_NOINLINE for glsl_to_tgsi_visitor::visit_expression for MSVC

Fixes 65d7172d ("util/macros: Add ATTRIBUTE_NOINLINE definition for MSVC")

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

3 years agoglsl/test: Don't run whitespace tests in parallel
Daniel Stone [Tue, 11 Aug 2020 11:13:17 +0000 (12:13 +0100)]
glsl/test: Don't run whitespace tests in parallel

For some unfathomable reason, three out of these four tests often time
out when running within CI. On the assumption that there is some
parallelisation badness happening rather than the non-UNIX tests
entering infinite loops, try just marking them as serial-only.

This should have a negligible impact on runtime since they are quick to
execute.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6301>

3 years agodrisw: Port the MIT-SHM check to XCB
Adam Jackson [Wed, 12 Aug 2020 17:54:46 +0000 (13:54 -0400)]
drisw: Port the MIT-SHM check to XCB

The old version isn't thread-safe, and xlib makes it unreasonably
difficult to write thread-safely.

Fixes: mesa/mesa#3398
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6294>

3 years agonir/vtn: CL SPIR-V callers should specify address modes
Jesse Natalie [Thu, 21 May 2020 22:12:15 +0000 (15:12 -0700)]
nir/vtn: CL SPIR-V callers should specify address modes

Instead of inferring the address mode from the environment, allows
callers to override to suit their needs.

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

3 years agonir/builder: Make nir_get_ptr_bitsize take a nir_shader
Jason Ekstrand [Sat, 15 Aug 2020 02:19:07 +0000 (21:19 -0500)]
nir/builder: Make nir_get_ptr_bitsize take a nir_shader

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6330>

3 years agonir: Add nir_address_format_32bit_index_offset_pack64
Jesse Natalie [Mon, 25 May 2020 15:53:00 +0000 (08:53 -0700)]
nir: Add nir_address_format_32bit_index_offset_pack64

This new address mode is supported by nir_lower_explicit_io

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

3 years agonir: Add nir_address_format_32bit_offset_as_64bit
Jesse Natalie [Mon, 25 May 2020 15:57:14 +0000 (08:57 -0700)]
nir: Add nir_address_format_32bit_offset_as_64bit

This new address mode is supported by nir_lower_explicit_io

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

3 years agonir: Optimize mask+downcast to just downcast
Jesse Natalie [Thu, 21 May 2020 22:05:08 +0000 (15:05 -0700)]
nir: Optimize mask+downcast to just downcast

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6330>

3 years agonir: Fix serialize/deserialize of void samplers/images
Jesse Natalie [Fri, 1 May 2020 22:04:06 +0000 (15:04 -0700)]
nir: Fix serialize/deserialize of void samplers/images

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6222>

3 years agoglsl: Add 'bare' shadow sampler type
Jesse Natalie [Mon, 20 Apr 2020 19:27:27 +0000 (12:27 -0700)]
glsl: Add 'bare' shadow sampler type

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6222>

3 years agocompiler/nir: extend lower_fragcoord_wtrans to support VARYING_SLOT_POS
Gert Wollny [Mon, 6 Jul 2020 07:41:25 +0000 (09:41 +0200)]
compiler/nir: extend lower_fragcoord_wtrans to support VARYING_SLOT_POS

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6220>

3 years agocompiler/nir: rewrite lower_fragcoord_wtrans to use nir_lower_instructions
Gert Wollny [Mon, 6 Jul 2020 07:38:01 +0000 (09:38 +0200)]
compiler/nir: rewrite lower_fragcoord_wtrans to use nir_lower_instructions

This compacts the code and makes it easier to extend.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6220>

3 years agoRevert "CI: temp disable t720/t760 jobs."
Tomeu Vizoso [Mon, 17 Aug 2020 07:35:07 +0000 (09:35 +0200)]
Revert "CI: temp disable t720/t760 jobs."

There was an unresponsive server in Collabora's LAVA lab that has been
rebooted. Everything seems to be fine now.

This reverts commit f1001a38275fc4bcc2491b58237a12dec08c621d.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6342>

3 years agonv50/ir/nir: rework indirect function_temp handling
Karol Herbst [Sun, 16 Aug 2020 17:33:02 +0000 (19:33 +0200)]
nv50/ir/nir: rework indirect function_temp handling

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

3 years agopanfrost: Update CI expectations
Alyssa Rosenzweig [Fri, 14 Aug 2020 20:13:33 +0000 (16:13 -0400)]
panfrost: Update CI expectations

The GenXML approach is more stable, so somehow some failing tests
disappeared.

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

3 years agopanfrost: Drop union mali_attr
Alyssa Rosenzweig [Fri, 14 Aug 2020 20:04:47 +0000 (16:04 -0400)]
panfrost: Drop union mali_attr

Now replaced by the XML translation. I left the comment explaining
instancing since this is still very good information about how to
calculate these fields.

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

3 years agopanfrost: Drop hand-rolled pandecode for attribute buffers
Alyssa Rosenzweig [Fri, 14 Aug 2020 20:03:12 +0000 (16:03 -0400)]
panfrost: Drop hand-rolled pandecode for attribute buffers

Sadly, we lose some of the validation, but indeed, much of the
validation has turend out to be wrong after enough development so... meh

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

3 years agopanfrost: Use packs for varying buffers
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:50:13 +0000 (15:50 -0400)]
panfrost: Use packs for varying buffers

In addition to better aesthetics, this automatically fixed multiple
instances of accidental CPU readback of GPU buffers -- in a hot path,
too!

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

3 years agopanfrost: Remove mali_attr_meta
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:25:04 +0000 (15:25 -0400)]
panfrost: Remove mali_attr_meta

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

3 years agopan/bit: Use packs for Bifrost unit tests
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:27:40 +0000 (15:27 -0400)]
pan/bit: Use packs for Bifrost unit tests

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

3 years agopanfrost: Use MALI_ATTRIBUTE_LENGTH
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:23:51 +0000 (15:23 -0400)]
panfrost: Use MALI_ATTRIBUTE_LENGTH

Removes an unwanted reference to mali_attr_meta.

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

3 years agopanfrost: Use pack for general varying
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:23:10 +0000 (15:23 -0400)]
panfrost: Use pack for general varying

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

3 years agopanfrost: Use pack for XFB varying
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:21:20 +0000 (15:21 -0400)]
panfrost: Use pack for XFB varying

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

3 years agopanfrost: Factor out general varying case
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:19:25 +0000 (15:19 -0400)]
panfrost: Factor out general varying case

To avoid hard-to-follow control flow now that we return void.

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

3 years agopanfrost: Pass varying descriptors by reference
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:12:39 +0000 (15:12 -0400)]
panfrost: Pass varying descriptors by reference

Instead of returning by value, as a stepping stone to packing directly.

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

3 years agopanfrost: Reword comment
Alyssa Rosenzweig [Fri, 14 Aug 2020 19:24:35 +0000 (15:24 -0400)]
panfrost: Reword comment

Avoid referencing data structures that no longer exist.

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

3 years agopanfrost: Use packs for vertex built-ins
Alyssa Rosenzweig [Fri, 14 Aug 2020 17:27:51 +0000 (13:27 -0400)]
panfrost: Use packs for vertex built-ins

These probably need a bigger cleanup at some point but let's handle one
thing at a time.

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

3 years agopanfrost: Use packs for vertex attribute buffers
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:51:36 +0000 (12:51 -0400)]
panfrost: Use packs for vertex attribute buffers

Eliminates messy staging, I think.

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

3 years agopanfrost: Inline panfrost_vertex_instanced
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:29:57 +0000 (12:29 -0400)]
panfrost: Inline panfrost_vertex_instanced

We'd like to have attribute code in one place together so we can
refactor effectively; this routine as-is wouldn't fit perfectly outside
Gallium anyway so let's do the simple thing.

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

3 years agopanfrost: Hoist instance_shift/instance_odd fetch
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:25:18 +0000 (12:25 -0400)]
panfrost: Hoist instance_shift/instance_odd fetch

We'll want to pass it as an argument shortly.

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

3 years agopanfrost: Use packs for attributes
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:19:10 +0000 (12:19 -0400)]
panfrost: Use packs for attributes

Now that state is grouped, this is natural.

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

3 years agopanfrost: Move attr_meta emission to the draw routine
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:14:20 +0000 (12:14 -0400)]
panfrost: Move attr_meta emission to the draw routine

It's unfortunate that we can't do more at CSO time, but actually all we
really need is the format after all, and this lets us group the state.

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

3 years agopanfrost: Make attribute-buffer map explicit
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:09:05 +0000 (12:09 -0400)]
panfrost: Make attribute-buffer map explicit

This helps decouple the attribute and attribute buffer emission.

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

3 years agopanfrost: Simplify offset fixup proof
Alyssa Rosenzweig [Fri, 14 Aug 2020 16:01:55 +0000 (12:01 -0400)]
panfrost: Simplify offset fixup proof

No need to put strides and such into it at all.

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

3 years agopanfrost: Use better packs for blits
Alyssa Rosenzweig [Thu, 13 Aug 2020 20:06:12 +0000 (16:06 -0400)]
panfrost: Use better packs for blits

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

3 years agopanfrost: Add XML for attribute buffers
Alyssa Rosenzweig [Thu, 13 Aug 2020 18:44:11 +0000 (14:44 -0400)]
panfrost: Add XML for attribute buffers

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

3 years agopanfrost: Merge attribute packing routines
Alyssa Rosenzweig [Thu, 13 Aug 2020 18:32:23 +0000 (14:32 -0400)]
panfrost: Merge attribute packing routines

In preparation for streamlining the packing, we need related code in one
place.

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

3 years agopanfrost: XMLify attributes
Alyssa Rosenzweig [Thu, 13 Aug 2020 17:27:16 +0000 (13:27 -0400)]
panfrost: XMLify attributes

To keep review manageable, this only ports over pandecode and blitting.
The main uses for vertex data and varying linkage will come next, as
they touch considerably more code.

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

3 years agopanfrost: XMLify mali_channel
Alyssa Rosenzweig [Wed, 12 Aug 2020 20:46:07 +0000 (16:46 -0400)]
panfrost: XMLify mali_channel

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

3 years agopanfrost: Squash 22-bit format field in attr_meta
Alyssa Rosenzweig [Wed, 12 Aug 2020 02:26:03 +0000 (22:26 -0400)]
panfrost: Squash 22-bit format field in attr_meta

This is an intermediate step to support v7 style formats. Now we don't
see the mali_format alone, instead together with the swizzle (and sRGB
flag, unused for attributes of course).

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

3 years agopanfrost: Drop NXR format
Alyssa Rosenzweig [Wed, 12 Aug 2020 02:06:07 +0000 (22:06 -0400)]
panfrost: Drop NXR format

It's not clear this was ever exposed under any GL/DX/CL/VK/... extension
whatsoever...

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

3 years agopanfrost: Set STRIDE_4BYTE_ALIGNED_ONLY
Alyssa Rosenzweig [Thu, 13 Aug 2020 19:19:07 +0000 (15:19 -0400)]
panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY

It isn't clear to me why, but this breaks in some cases (such as some
dEQP cases where the blob does a translate too).

This reverts commit 9f2997dad061ee38e06f654f524dffbffc5b2a4b.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>

3 years agopipebuffer: Remove unused buffer event in slab bufmgr
Louis-Francis Ratté-Boulianne [Wed, 27 May 2020 03:19:08 +0000 (23:19 -0400)]
pipebuffer: Remove unused buffer event in slab bufmgr

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

3 years agonir: handle load_input_vertex in nir_get_io_offset_src
Marek Olšák [Thu, 13 Aug 2020 15:53:17 +0000 (11:53 -0400)]
nir: handle load_input_vertex in nir_get_io_offset_src

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

3 years agonir: remove nir_strip stub declaration
Marek Olšák [Fri, 14 Aug 2020 05:22:05 +0000 (01:22 -0400)]
nir: remove nir_strip stub declaration

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

3 years agocompiler: add glsl_print_type
Marek Olšák [Thu, 13 Aug 2020 17:39:38 +0000 (13:39 -0400)]
compiler: add glsl_print_type

Move it from the glsl compiler. For debugging.

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

3 years agoac/llvm: handle static/shared llvm init separately
Pierre-Eric Pelloux-Prayer [Mon, 10 Aug 2020 08:16:39 +0000 (10:16 +0200)]
ac/llvm: handle static/shared llvm init separately

Having a single init function works as expected for shared llvm, but
when using a static llvm only one llvm will get initialized.

This commit introduces 2 separate init function:
- shared llvm = single public init function
- static llvm = one init function for each module using llvm

Fixes: 50d20dc055d ("ac/llvm: export ac_init_llvm_once in targets")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3376
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6253>

3 years agost/mesa: Enable clip planes lowering for geometry shaders
Louis-Francis Ratté-Boulianne [Mon, 29 Jun 2020 07:21:54 +0000 (03:21 -0400)]
st/mesa: Enable clip planes lowering for geometry shaders

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

3 years agost/mesa: factor ucp-lowering logic into helper
Louis-Francis Ratté-Boulianne [Mon, 29 Jun 2020 07:21:54 +0000 (03:21 -0400)]
st/mesa: factor ucp-lowering logic into helper

This makes the next step easier to follow.

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

3 years agocompiler/glsl: Initialize local variable to zero to fix MSVC RTC error
BillKristiansen [Thu, 11 Jun 2020 17:38:19 +0000 (10:38 -0700)]
compiler/glsl: Initialize local variable to zero to fix MSVC RTC error

Without this, we get a run-time error about using an uninitialized
variable.

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

3 years agovallium: initial import of the vulkan frontend
Dave Airlie [Fri, 19 Jun 2020 06:40:27 +0000 (16:40 +1000)]
vallium: initial import of the vulkan frontend

This is the initial import of the vallium frontend for gallium.
This is only good enough to run the triangle and the gears demo
(wrongly) from Sascha demos.

Improvements are mostly on the llvmpipe side after this.

It contains an implementation of the Vulkan API which is mapped
onto the gallium API, and is suitable only for SOFTWARE drivers.

Command buffers are recordred into malloced memory, then later
they are played back against the gallium API. The command buffers
are mostly just Vulkan API marshalling but in some places the information is
processed before being put into the command buffer (renderpass stuff).

Execution happens on a separate "graphics" thread, againt the gallium API.

There is only a single queue which wraps a single gallium context.

Resources are allocated via the new resource/memory APIs.
Shaders are created via the context and bound/unbound in the
second thread.

(No HW for reasons - memory management, sw paths for lots of paths,
pointless CPU side queue)

v2: drop mesa_icd, drop cpp_args, drop extra flags, change meson config (Eric)
v2.1: use meson-gallium job

meson pieces:
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
overall:

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

3 years agovulkan/wsi: add sw support. (v2)
Dave Airlie [Fri, 19 Jun 2020 06:37:51 +0000 (16:37 +1000)]
vulkan/wsi: add sw support. (v2)

This adds an option to the WSI support for a software path to be
used with the vulkan sw drivers. There is probably some changes
that could be made to improve this and use present, for now
just use put image.

v2: roll out flag across all drivers (Eric)

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

3 years agoutil/format: add some ZS helpers for vallium
Dave Airlie [Fri, 19 Jun 2020 06:44:09 +0000 (16:44 +1000)]
util/format: add some ZS helpers for vallium

The vallium layer has a requirement to insert and extra the 24-bit
unorm value as a unorm value (not as a float etc). Add helpers
to facilitate that.

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

3 years agogallivm/nir: add load push constant support
Dave Airlie [Fri, 19 Jun 2020 06:51:50 +0000 (16:51 +1000)]
gallivm/nir: add load push constant support

This convets the push constant load to a ubo load against the 0 constant buffer,
which is where the vallium layer will bind things.

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

3 years agollvmpipe: add support for memory allocation APIs
Dave Airlie [Fri, 19 Jun 2020 06:27:32 +0000 (16:27 +1000)]
llvmpipe: add support for memory allocation APIs

This adds llvmpipe driver support for the vulkan split memory/resource API
and the the don't overallocate flag.

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

3 years agogallium: add a resource flag to say no over allocation.
Dave Airlie [Fri, 19 Jun 2020 06:25:49 +0000 (16:25 +1000)]
gallium: add a resource flag to say no over allocation.

llvmpipe overallocates buffers for buffers used as render targets,
however this breaks some vulkan apps (UE4), so add a workaround
flag to force llvmpipe to not overallocate certain buffers.

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

3 years agogallium: add an interface for memory allocations.
Dave Airlie [Fri, 19 Jun 2020 06:24:48 +0000 (16:24 +1000)]
gallium: add an interface for memory allocations.

In order to support vulkan over gallium for the sw renderers,
there needs to be a vulkan-like memory allocation API.

It doesn't need to be overly complicated for the needs of the sw
renderers.

The vallium layer will allocate resources and memory separately
and bind them via this API.

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

3 years agoradv: Use getter instead of setter to extract value.
Bas Nieuwenhuizen [Sun, 16 Aug 2020 20:38:22 +0000 (22:38 +0200)]
radv: Use getter instead of setter to extract value.

Oops ...

Fixes: 64768111c30 "radv: Handle slightly different image dimensions."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3417
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6337>

3 years agogallium: Use unpack_rgba() instead of fetch_rgba in translate_generic
Eric Anholt [Thu, 13 Aug 2020 17:14:11 +0000 (10:14 -0700)]
gallium: Use unpack_rgba() instead of fetch_rgba in translate_generic

This is the only user of fetch_rgba outside of llvmpipe, and it's in the
fallback path of this fallback path.  Looking at an example of these two
functions, b8g8r8a8's unpack_rgba is 2.7x as long as fetch_rgba.  It feels
reasonable to sacrifice some perf in this already slow (VBO readback, and
a function pointer call per attribute per vertex) path to reduce our
binary size.  And, if I ever finish getting unpack codegen to switch to
rows instead of rects, that factor will go back down.

Saves 40kb of binary on non-llvmpipe gallium drivers.

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

3 years agoutil: Move fetch_rgba to a separate function table.
Eric Anholt [Thu, 13 Aug 2020 16:37:32 +0000 (09:37 -0700)]
util: Move fetch_rgba to a separate function table.

Only llvmpipe and translate_generic use it, and only in fallbacks, so if
you're not building that then let's not bloat our binaries with it.

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