platform/upstream/mesa.git
2 years agointel/compiler: Implement Mesh Output
Caio Oliveira [Fri, 29 Oct 2021 19:56:22 +0000 (12:56 -0700)]
intel/compiler: Implement Mesh Output

Use the same URB access helpers that were added for Task Output.  The
Arrayed I/O (per-primitive and per-vertex) is handled by applying the
pitch from the MUE layout into the NIR intrinsics and including the
non-arrayed offset on top of it.  After that, the index src can be
used directly for lowering.

Because we keep around the non-arrayed offset AND the pitch is
aligned, we can identify cases where the access is indirect but
guaranteed to be aligned, and dispatch a single message.  Added a TODO
to explore that later.

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

2 years agointel/compiler: Implement Task Output and Mesh Input
Caio Oliveira [Fri, 29 Oct 2021 19:45:17 +0000 (12:45 -0700)]
intel/compiler: Implement Task Output and Mesh Input

Implement the output written by the task *workgroup* and available to
all the mesh *workgroups* dispatched from that task.  We currently
ignore any layout annotations (since they are not really testable) and
produce a (packed) layout ourselves.

The URB messages are only SIMD8, so for larger SIMDs, the functions
will produce multiple messages.  Making this lowering here instead of
the generic lower_simd_width() since it is not just a matter of
zip/unzip, e.g. the offset must be adjusted.

Indirect writes/reads are implemented by handling one component at a
time and using the PER_SLOT variant of the messages.

Note that VK_NV_mesh_shader allows reading outputs, so add support for
that as well.

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

2 years agointel/compiler: Lower Task/Mesh local_invocation_{id,index}
Caio Oliveira [Fri, 29 Oct 2021 19:48:54 +0000 (12:48 -0700)]
intel/compiler: Lower Task/Mesh local_invocation_{id,index}

The Invocation index is provided by the payload, so we can skip the
usual math done to get to it.

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

2 years agointel/compiler: Add backend compiler basics for Task/Mesh
Caio Oliveira [Fri, 29 Oct 2021 19:27:45 +0000 (12:27 -0700)]
intel/compiler: Add backend compiler basics for Task/Mesh

Task/Mesh stages are CS-like stages, and include many
builtins (e.g. workgroup ID/index) and intrinsics (e.g. workgroup
memory primitives) originally present only in CS.

This commit add two new stages (task and mesh) that 'inherit' from CS
by embedding a brw_cs_prog_data in their own prog_data structure, so
that CS functionality can be easily reused.  They also currently use
the same helpers to select the SIMD variant to use -- that was
recently added for CS.

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

2 years agointel/compiler: Export brw_nir_lower_simd
Caio Oliveira [Tue, 18 May 2021 17:37:36 +0000 (10:37 -0700)]
intel/compiler: Export brw_nir_lower_simd

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

2 years agointel/compiler: Make MUE available when setting up FS URB access
Caio Oliveira [Tue, 18 May 2021 18:05:33 +0000 (11:05 -0700)]
intel/compiler: Make MUE available when setting up FS URB access

Allows to assert its existence for per-primitive variables and will
later be useful to implement the "more than 16 attributes" case for
Mesh.

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

2 years agointel/compiler: Add structs to hold TUE/MUE
Caio Oliveira [Tue, 18 May 2021 18:06:59 +0000 (11:06 -0700)]
intel/compiler: Add structs to hold TUE/MUE

Used to specify the layout of 'Task URB Entry' and 'Mesh URB Entry'.

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

2 years agointel/compiler: Don't lower Mesh/Task I/O to temporaries
Caio Oliveira [Fri, 29 Oct 2021 19:10:00 +0000 (12:10 -0700)]
intel/compiler: Don't lower Mesh/Task I/O to temporaries

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

2 years agointel/compiler: Don't stage Task/Mesh outputs in registers
Caio Oliveira [Tue, 18 May 2021 17:58:26 +0000 (10:58 -0700)]
intel/compiler: Don't stage Task/Mesh outputs in registers

Since the outputs are shared among the whole workgroup, these can't be
staged in registers as they will not be always visible for all the
invocations (to read/flush).  If they ever need to be staged, we
should use SLM for that.

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

2 years agointel/compiler: Handle per-primitive inputs in FS
Caio Oliveira [Tue, 18 May 2021 17:17:43 +0000 (10:17 -0700)]
intel/compiler: Handle per-primitive inputs in FS

In Fragment Shader, regular inputs are laid out in the thread payload
in a one dword per each half-GRF, that gives room for having the two
delta dwords needed for interpolation.

Per-primitive inputs are laid out before the regular inputs, and since
there's no need to have delta information, they are packed.  So
half-GRF will be fully filled with 4 dwords of input.

When num_per_primitive_inputs is zero (the default case), behavior
should be the same as before.

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

2 years agointel/compiler: Properly lower WorkgroupId for Task/Mesh
Caio Oliveira [Tue, 18 May 2021 17:11:42 +0000 (10:11 -0700)]
intel/compiler: Properly lower WorkgroupId for Task/Mesh

Task/Mesh currently only support a single dimension (both in NV API
and HW), so make Y and Z be zero.

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

2 years agointel: Add INTEL_DEBUG=task,mesh
Caio Oliveira [Wed, 10 Feb 2021 04:07:22 +0000 (20:07 -0800)]
intel: Add INTEL_DEBUG=task,mesh

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

2 years agomesa: move common/dri into gallium
Dylan Baker [Thu, 5 Aug 2021 18:10:31 +0000 (11:10 -0700)]
mesa: move common/dri into gallium

There are no other consumers, so we can just move this into gallium and
out of mesa.

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa: Merge libmesa_gallium and libmesa_common
Dylan Baker [Thu, 5 Aug 2021 18:00:01 +0000 (11:00 -0700)]
mesa: Merge libmesa_gallium and libmesa_common

Since we don't have libmesa_classic anymore, we don't nee to split
these, and can save a target/ar invocation by not having two targets.
Plus it's just conceptually simpler

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa: Delete libmesa_classic
Dylan Baker [Thu, 5 Aug 2021 17:48:28 +0000 (10:48 -0700)]
mesa: Delete libmesa_classic

We no longer have any classic drivers, so we no longer need
libmesa_classic

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa/main/tests: remove dispatch sanity
Dylan Baker [Fri, 9 Apr 2021 19:21:33 +0000 (12:21 -0700)]
mesa/main/tests: remove dispatch sanity

Thsi test uses a bunch of the classic infastructure, which is about to
be deleted. Since gallium will be the sole user, it will likely be
refactored out anyway.

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoinclude/pci_ids: Move PCI ids supported by both i965 and iris to iris
Dylan Baker [Fri, 9 Apr 2021 19:15:01 +0000 (12:15 -0700)]
include/pci_ids: Move PCI ids supported by both i965 and iris to iris

As crocus won't support any of these (BDW+) they should go into iris.
This also allows us to remove the "prefer_iris" option, as iris is now
the only option

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa/dri: remove mega driver stub
Dylan Baker [Wed, 17 Nov 2021 22:46:57 +0000 (14:46 -0800)]
mesa/dri: remove mega driver stub

As it is now unused.

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoclassic/i965: Remove driver
Dylan Baker [Mon, 12 Apr 2021 18:26:45 +0000 (11:26 -0700)]
classic/i965: Remove driver

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoclassic/i915: Remove driver
Dylan Baker [Fri, 9 Apr 2021 17:00:44 +0000 (10:00 -0700)]
classic/i915: Remove driver

This is only going to be supported in the Amber branch

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoclassic/nouveau: Remove driver
Dylan Baker [Fri, 9 Apr 2021 16:51:38 +0000 (09:51 -0700)]
classic/nouveau: Remove driver

This will now only be available in the Amber branch

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoclassic/r200: Delete driver
Dylan Baker [Fri, 9 Apr 2021 16:49:49 +0000 (09:49 -0700)]
classic/r200: Delete driver

This will now only be available on the Amber branch

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agoclassic/r100: Delete driver
Dylan Baker [Fri, 9 Apr 2021 16:48:36 +0000 (09:48 -0700)]
classic/r100: Delete driver

This is now only going to be available in the Amber branch

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa/x11: Remove the swrast-classic-based fake libGL
Adam Jackson [Thu, 15 Apr 2021 17:07:40 +0000 (10:07 -0700)]
mesa/x11: Remove the swrast-classic-based fake libGL

If you want this you will almost certainly be happier with the gallium
version, giving you llvmpipe instead of swrast-classic.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10153>

2 years agomesa/tests: ensure that util_cpu_detect has been called
Dylan Baker [Fri, 3 Dec 2021 20:54:26 +0000 (12:54 -0800)]
mesa/tests: ensure that util_cpu_detect has been called

I think that this test was passing in some cases because of loader side
effects, that stop happening after classic is removed.

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

2 years agogitlab-ci: detect a3xx gpu hang recovery failure
Ilia Mirkin [Wed, 1 Dec 2021 03:52:49 +0000 (22:52 -0500)]
gitlab-ci: detect a3xx gpu hang recovery failure

But don't bail immediately, instead print out some more lines after the
hang, hopefully catching info about the cause of the hang.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14033>

2 years agogitlab-ci: serial close can leave an active read
Ilia Mirkin [Thu, 2 Dec 2021 06:30:45 +0000 (01:30 -0500)]
gitlab-ci: serial close can leave an active read

So instead cancel the read first, and then close. Make sure the
serial-reading properly detects this cancelled condition under all
circumstances and exits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14033>

2 years agod3d12: Handle depth readback on drivers that require full-resource copies for depth
Jesse Natalie [Fri, 3 Dec 2021 18:45:20 +0000 (10:45 -0800)]
d3d12: Handle depth readback on drivers that require full-resource copies for depth

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14051>

2 years agonir: Print task and mesh shader I/O variable names.
Timur Kristóf [Wed, 1 Dec 2021 18:05:12 +0000 (19:05 +0100)]
nir: Print task and mesh shader I/O variable names.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14007>

2 years agofreedreno/a5xx: enable OES_gpu_shader5
Ilia Mirkin [Fri, 3 Dec 2021 05:45:43 +0000 (00:45 -0500)]
freedreno/a5xx: enable OES_gpu_shader5

This extension is controlled by the ESSL feature level. Bump it up since
all parts of OES_gpu_shader5 should be supported.

This also avoids lowering all of the "advanced" functions (which should
probably not be lowered in the first place since they're part of ES
3.1...)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14035>

2 years agoradv: Use util_widen_mask.
Timur Kristóf [Thu, 2 Dec 2021 08:27:41 +0000 (09:27 +0100)]
radv: Use util_widen_mask.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14005>

2 years agoaco: Use util_widen_mask.
Timur Kristóf [Thu, 2 Dec 2021 08:26:42 +0000 (09:26 +0100)]
aco: Use util_widen_mask.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14005>

2 years agoutil: Add util_widen_mask function.
Timur Kristóf [Wed, 1 Dec 2021 18:37:02 +0000 (19:37 +0100)]
util: Add util_widen_mask function.

Widens the given bit mask by a multiplier, meaning that it will
replicate each bit by that amount.
For example: 0b101 widened by 2 will become: 0b110011

This is typically used in shader I/O to transform a 64-bit
writemask to a 32-bit writemask.

Moving this function here because it is used in multiple places.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14005>

2 years agonir: Fix sorting per-primitive outputs.
Timur Kristóf [Wed, 1 Dec 2021 15:24:43 +0000 (16:24 +0100)]
nir: Fix sorting per-primitive outputs.

Fixes: 59860d487368e18a1d85ea96988c5f4c904879b0
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14006>

2 years agoCI: Don't stream wget directly into bash
Daniel Stone [Fri, 3 Dec 2021 07:07:47 +0000 (07:07 +0000)]
CI: Don't stream wget directly into bash

If our environment has pipefail set, bash could exit early before wget
has completed, and we will die with a broken pipe. Work around this by
first downloading from wget, and then executing from bash.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14036>

2 years agov3d: enable ARB_texture_view
Juan A. Suarez Romero [Fri, 15 Oct 2021 16:20:05 +0000 (18:20 +0200)]
v3d: enable ARB_texture_view

v2 (Iago):
 - Add comments to failing tests

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

2 years agov3d: enable ARB_texture_buffer_object and ARB_texture_buffer_range
Alejandro Piñeiro [Mon, 16 Sep 2019 12:23:07 +0000 (14:23 +0200)]
v3d: enable ARB_texture_buffer_object and ARB_texture_buffer_range

Through their specific PIPE_CAP.

v2 (Iago)
 - Add comment in test failure

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

2 years agost/pbo: set layer coord for array textures
Juan A. Suarez Romero [Thu, 14 Oct 2021 16:40:13 +0000 (18:40 +0200)]
st/pbo: set layer coord for array textures

Even for drivers not supporting layers, we need to include the layer
coordinate (zero in this case) when using array textures in the
download/upload FS.

Otherwise we are missing a component to get the texture, which ends up
in a malformed NIR shader.

v5 (Ilia):
 - Do not emit needless layer code.

v6 (Ilia):
 - Add comment clarifying the code logic behind.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>

2 years agost/pbo: add the image format in the download FS
Juan A. Suarez Romero [Wed, 13 Oct 2021 10:56:15 +0000 (12:56 +0200)]
st/pbo: add the image format in the download FS

In the V3D driver there is a NIR lowering step for `image_store`
intrinsic, where the image store format is required for doing the proper
lowering.

Thus, let's define it for the download FS instead of
keeping it as NONE.

v2 (Illia)
 - Use format only for drivers not supporting format-less writing.

v4 (Illia):
 - Use PIPE_CAP_IMAGE_STORE_FORMATTED to reduce combinations.

v5 (Ilia):
 - Use indirect array for download FS in not formatless-store support
   drivers.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>

2 years agogallium: add new PIPE_CAP_IMAGE_STORE_FORMATTED
Juan A. Suarez Romero [Thu, 25 Nov 2021 11:09:50 +0000 (12:09 +0100)]
gallium: add new PIPE_CAP_IMAGE_STORE_FORMATTED

This capability is enabled for drivers supporting formatless image
writing in shader.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>

2 years agov3d: clamp clear color
Juan A. Suarez Romero [Wed, 22 Sep 2021 07:10:53 +0000 (09:10 +0200)]
v3d: clamp clear color

On clearing a color buffer, clamp the passed color values to the allowed
ones.

Hardware do clamping for TLB values, but not for clear values.

v2 (Iago)
 - Add comment about hardware-based clamping on clear values.

v3 (Iago):
 - Use format utils to simplify clamping
 - Move clamp color function as utility

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

2 years agogallium/util: add helper to clamp colors to valid range
Juan A. Suarez Romero [Fri, 29 Oct 2021 14:04:47 +0000 (16:04 +0200)]
gallium/util: add helper to clamp colors to valid range

v3 (Iago):
 - Fix comment.

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

2 years agost/pbo: do not use GS for NIR preferred shaders
Juan A. Suarez Romero [Wed, 15 Sep 2021 13:51:37 +0000 (15:51 +0200)]
st/pbo: do not use GS for NIR preferred shaders

If PBO require to use a GS, this is created with TGSI.

For drivers preferring NIR shaders, they need to translate it from TGSI
to NIR. But unfortunately TGSI to NIR for GS is not implemented, which
makes it crash.

So let's use a GS only for drivers preferring TGSI.

v3:
 - Add comment (Iago and Alejandro)

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

2 years agomesa: allow TEXTURE_BUFFER target for ARB_texture_buffer_range
Juan A. Suarez Romero [Tue, 14 Sep 2021 07:37:16 +0000 (09:37 +0200)]
mesa: allow TEXTURE_BUFFER target for ARB_texture_buffer_range

While TEXTURE_BUFFER do not support texture parameters in
ARB_texture_buffer_object specification, it does in
ARB_texture_buffer_range, specifically TEXTURE_BUFFER_OFFSET and
TEXTURE_BUFFER_SIZE.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>

2 years agov3d: restrict formats supported for PIPE_BIND_SHADER_IMAGE
Alejandro Piñeiro [Sun, 5 Sep 2021 23:12:52 +0000 (01:12 +0200)]
v3d: restrict formats supported for PIPE_BIND_SHADER_IMAGE

So far we were relying on the supported formats filtering when
creating images from the user API.

But for some other (internal) uses, some of the formats that pass the
filter need to be restricted when binding them as shader images, as they
are not supported for this case.

v3 (Iago):
 - Change commit message.

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

2 years agov3d: add support for no buffer object bound
Alejandro Piñeiro [Thu, 26 Aug 2021 00:01:28 +0000 (02:01 +0200)]
v3d: add support for no buffer object bound

From the GL_OES_texture_buffer spec:

      "If no buffer object is bound to the buffer texture, the results
       of the texel access are undefined."

this can be interpreted as allowing any result to come back, but not
terminate the program.

The current solution is not entirely complete, as it could still try to
get a wrong address for the shader state address.

This can be checked with piglit test
arb_texture_buffer_object-render-no-bo; the test is skip because it
requires OpenGL 3.1, but if overriding the version then it will crash.

Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>

2 years agov3d: support for texture buffer objects
Alejandro Piñeiro [Thu, 17 Oct 2019 13:27:07 +0000 (15:27 +0200)]
v3d: support for texture buffer objects

This commit handles the support for texture buffer objects. In general
it is mostly about using the buffer info from the pipe_image_view
instead of the texture info.

v2:
 - Rework some assertions (Iago)
 - Remove needless comment (Alejandro)
 - Fix comment typos (Iago)

v3:
 - Fix typos (Iago)

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

2 years agonir/algebraic: optimize a*#b & -4
Rhys Perry [Thu, 11 Nov 2021 11:16:06 +0000 (11:16 +0000)]
nir/algebraic: optimize a*#b & -4

fossil-db (Sienna Cichlid):
Totals from 611 (0.47% of 128647) affected shaders:
CodeSize: 3096680 -> 3090976 (-0.18%)
Instrs: 570494 -> 569249 (-0.22%)
Latency: 5765865 -> 5759619 (-0.11%)
InvThroughput: 969840 -> 967608 (-0.23%)
VClause: 9690 -> 9688 (-0.02%)
Copies: 42884 -> 42894 (+0.02%); split: -0.01%, +0.03%
PreVGPRs: 28290 -> 28288 (-0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13752>

2 years agonir/opt_offsets: remove need to loop try_extract_const_addition
Rhys Perry [Thu, 2 Dec 2021 13:51:24 +0000 (13:51 +0000)]
nir/opt_offsets: remove need to loop try_extract_const_addition

fossil-db (Sienna Cichlid):
Totals from 1 (0.00% of 134572) affected shaders:
no stat changes

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14009>

2 years agonir/opt_offsets: fix try_extract_const_addition recursion
Rhys Perry [Thu, 2 Dec 2021 13:14:22 +0000 (13:14 +0000)]
nir/opt_offsets: fix try_extract_const_addition recursion

This initially looks like a miscompilation bug, but I don't think it's
actually possible for it to create incorrect code.

fossil-db (Sienna Cichlid):
Totals from 32 (0.02% of 134572) affected shaders:
VGPRs: 1336 -> 1320 (-1.20%)
CodeSize: 90552 -> 89468 (-1.20%)
Instrs: 17007 -> 16852 (-0.91%); split: -0.92%, +0.01%
Latency: 429040 -> 428136 (-0.21%); split: -0.21%, +0.00%
InvThroughput: 84966 -> 84572 (-0.46%); split: -0.47%, +0.00%
Copies: 1458 -> 1468 (+0.69%); split: -0.07%, +0.75%
Branches: 382 -> 384 (+0.52%)
PreSGPRs: 970 -> 968 (-0.21%)
PreVGPRs: 1029 -> 1011 (-1.75%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14009>

2 years agonir: add NIR_DEBUG envvar
Juan A. Suarez Romero [Wed, 17 Nov 2021 15:10:52 +0000 (16:10 +0100)]
nir: add NIR_DEBUG envvar

Move all the NIR related debug environmental variables in a single
NIR_DEBUG one.

Use NIR_DEBUG=help to print all the available options.

v2:
 - Use a macro to simplify (Marcin, Jason)
 - Remove wrong changes (Marcin)

v3 (Marcin):
 - Remove rendundant NIR mentioning in option descriptions.
 - Unwrap option descriptions.
 - Ensure the constant is unsigned.
 - Use extern array to remove switch.

v4:
 - Add missing kernel shader (Jason).
 - Add unlikely() (Marcin).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13840>

2 years agobroadcom/compiler: improve documentation for Z writes
Iago Toral Quiroga [Fri, 3 Dec 2021 09:44:14 +0000 (10:44 +0100)]
broadcom/compiler: improve documentation for Z writes

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14037>

2 years agov3d,v3dv: don't disable EZ for passthrough Z writes
Iago Toral Quiroga [Fri, 3 Dec 2021 09:29:16 +0000 (10:29 +0100)]
v3d,v3dv: don't disable EZ for passthrough Z writes

The early-Z test uses Z values produced from FEP, so when
we write Z from a shader we need to disable EZ. However, there
are some instances where want to write the FEP-Z from the shader,
in which case we would not need to disable EZ.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14037>

2 years agobroadcom/compiler: track passthrough Z writes
Iago Toral Quiroga [Fri, 3 Dec 2021 09:22:45 +0000 (10:22 +0100)]
broadcom/compiler: track passthrough Z writes

In some cases we need to make the shaders write the Z value produced
from rasterization (FEP). Track these instances because they are relevant
to early EZ setup.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14037>

2 years agobroadcom/compiler: emit passthrough Z write if shader reads Z
Iago Toral Quiroga [Thu, 2 Dec 2021 10:18:13 +0000 (11:18 +0100)]
broadcom/compiler: emit passthrough Z write if shader reads Z

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14037>

2 years agoanv: allow VK_IMAGE_LAYOUT_UNDEFINED as final layout
Tapani Pälli [Thu, 2 Dec 2021 08:44:10 +0000 (10:44 +0200)]
anv: allow VK_IMAGE_LAYOUT_UNDEFINED as final layout

From VK_KHR_synchronization2:
   "Image memory barriers that do not perform an image layout
    transition can be specified by setting oldLayout equal to
    newLayout.

    E.g. the old and new layout can both be set to
    VK_IMAGE_LAYOUT_UNDEFINED, without discarding data in the
    image."

v2: make assert more readable (Lionel Landwerlin)

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14008>

2 years agoiris/batch: Add support for engines contexts
Jordan Justen [Tue, 31 Aug 2021 20:37:12 +0000 (13:37 -0700)]
iris/batch: Add support for engines contexts

As described in "intel: Add intel_gem_create_context_engines", this
should make it easier to support an I915_ENGINE_CLASS_FOO engine in
the future. For example, maybe something like:

https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/98c3bbd5b54eb9914329155bfeddd0ad88f96ad2

Reworks:
 * Tweak engine counting logic (s-b Ken)
 * Tweak init of engine_classes in iris_init_engines_context (s-b Ken)
 * Add STATIC_ASSERT on engine_classes (Jordan)
 * Paulo: Call iris_hw_context_set_unrecoverable() for engines context
 * Rename to has_engines_context (s-b Paulo)
 * Jordan: Handle creating a new engines context when the context needs
   to be replaced.
 * Ken: Tweak context destroy code paths.
 * Call iris_lost_context_state on every batch. (s-b Ken)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris: Make iris_kernel_context_get_priority() public
Jordan Justen [Sat, 20 Nov 2021 00:21:26 +0000 (16:21 -0800)]
iris: Make iris_kernel_context_get_priority() public

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris: Destroy all batches with a new iris_destroy_batches() function
Jordan Justen [Fri, 19 Nov 2021 23:40:16 +0000 (15:40 -0800)]
iris: Destroy all batches with a new iris_destroy_batches() function

Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris: Move away from "hw" for some context terminology
Jordan Justen [Fri, 19 Nov 2021 22:44:41 +0000 (14:44 -0800)]
iris: Move away from "hw" for some context terminology

Kernel contexts can take two forms now. In the older case a kernel
context will have a single hardware context. With an "engines" based
context, the context can now have 1 or more hardware contexts.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris/batch: Add exec_flags field
Jordan Justen [Tue, 31 Aug 2021 20:22:24 +0000 (13:22 -0700)]
iris/batch: Add exec_flags field

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris: extract iris_hw_context_set_unrecoverable()
Paulo Zanoni [Fri, 8 Oct 2021 00:31:33 +0000 (17:31 -0700)]
iris: extract iris_hw_context_set_unrecoverable()

We're going to add a second caller.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris/batch: Move kernel context init to iris_init_non_engine_contexts
Jordan Justen [Tue, 31 Aug 2021 19:38:42 +0000 (12:38 -0700)]
iris/batch: Move kernel context init to iris_init_non_engine_contexts

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agoiris: Add iris_init_batches
Jordan Justen [Thu, 12 Aug 2021 22:09:16 +0000 (15:09 -0700)]
iris: Add iris_init_batches

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agointel: Add intel_gem_create_context_engines
Jordan Justen [Tue, 31 Aug 2021 09:29:41 +0000 (02:29 -0700)]
intel: Add intel_gem_create_context_engines

Engines based contexts operate somewhat different for executing
batches. Previously, we would specify a bitmask value such as
I915_EXEC_RENDER to specify to run the batch on the render ring.

With engines contexts, instead this becomes an array of "engines", and
when the context is created we specify the class and instance of the
engine.

Each index in the array has a separate hardware-context. Previously we
had to create separate kernel level contexts to create multiple
hardware contexts, but now a single kernel context can own multiple
hardware contexts.

Another forward looking advantage to using the engines based contexts
is that the kernel does not plan to add new supported I915_EXEC_FOO
masks, whereas they instead plan to add new I915_ENGINE_CLASS_FOO
engine classes. Therefore some rings may only be usable with an engine
based class.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agointel: Add intel_gem_count_engines
Jordan Justen [Tue, 31 Aug 2021 09:22:44 +0000 (02:22 -0700)]
intel: Add intel_gem_count_engines

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

2 years agodocs: Add calendar entries for 22.0 release candidates.
Dylan Baker [Thu, 2 Dec 2021 23:53:58 +0000 (15:53 -0800)]
docs: Add calendar entries for 22.0 release candidates.

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

2 years agovenus: fix vn_instance_wait_roundtrip when seqno wraps
Chia-I Wu [Thu, 2 Dec 2021 23:01:09 +0000 (15:01 -0800)]
venus: fix vn_instance_wait_roundtrip when seqno wraps

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14026>

2 years agozink/ci: Add GL4.6 tessellation flake
Daniel Stone [Thu, 2 Dec 2021 14:57:02 +0000 (14:57 +0000)]
zink/ci: Add GL4.6 tessellation flake

Seen in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/16318152#L636
which is extremely unrelated.

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

2 years agoci: Use ci-fairy minio login via token file
Guilherme Gallo [Thu, 2 Dec 2021 13:13:10 +0000 (10:13 -0300)]
ci: Use ci-fairy minio login via token file

For every CI job, put JWT content into a file and unset CI_JOB_JWT
environment var
=======

* virgl jobs:
- Share JWT token file to crosvm instance
- Keep using `export -p` due to high complexity in the scripts
  of these jobs. At least, the CI_JOB_JWT will not be leaked,
  since it is being unset at the `before_script` phase of each
  Mesa CI job.

* iris jobs: Update lava_job_submitter to take token file as argument
- generate-env with CI_JOB_JWT_TOKEN_FILE
- create token file during baremetal init stage

* baremetal jobs: Copy token file to bare-metal NFS

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14004>

2 years agoci: Uprev piglit
Guilherme Gallo [Thu, 2 Dec 2021 13:10:26 +0000 (10:10 -0300)]
ci: Uprev piglit

Bring up the piglit replay jwt-file argument feature.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14004>

2 years agoci: Update ci-fairy to version with --token-file support
Guilherme Gallo [Fri, 5 Nov 2021 03:13:01 +0000 (00:13 -0300)]
ci: Update ci-fairy to version with --token-file support

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14004>

2 years agomeson: check for lld split TLSDESC bug (fixes #5665)
Alex Xu (Hello71) [Tue, 23 Nov 2021 20:05:01 +0000 (15:05 -0500)]
meson: check for lld split TLSDESC bug (fixes #5665)

Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13934>

2 years agoegl/wayland: fix surface dma-buf feedback error exits
Leandro Ribeiro [Tue, 30 Nov 2021 16:40:26 +0000 (13:40 -0300)]
egl/wayland: fix surface dma-buf feedback error exits

This fixes a leak that was introduced in 89d15b9a "egl/wayland: add
initial dma-buf feedback support".

Do not leak dri2_surf->wl_dmabuf_feedback when we have to bail out
because of allocation issues.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>

2 years agoegl/wayland: do not try to bind to wl_drm if not advertised
Leandro Ribeiro [Tue, 30 Nov 2021 15:00:51 +0000 (12:00 -0300)]
egl/wayland: do not try to bind to wl_drm if not advertised

This fixes a bug that was introduced in 89d15b9a "egl/wayland: add
initial dma-buf feedback support".

Sometimes we have to fallback to wl_drm. But do not try to bind to it
when it is not advertised by the compositor.

This issue was found by n3rdopolis and reported here:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5697

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>

2 years agoradv: upload shader binaries of a pipeline contiguously in memory
Samuel Pitoiset [Fri, 5 Nov 2021 12:58:12 +0000 (13:58 +0100)]
radv: upload shader binaries of a pipeline contiguously in memory

RGP expects shaders to be contiguous in memory, otherwise it explodes
because we have to generate huge captures with lot of holes.

This reduces capture sizes of Cyberpunk 2077 from ~3.5GiB to ~180MiB.

This should also help for future pipeline libraries.

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

2 years agoradv: pass a pointer to a pipeline for the create/insert cache functions
Samuel Pitoiset [Fri, 5 Nov 2021 12:57:35 +0000 (13:57 +0100)]
radv: pass a pointer to a pipeline for the create/insert cache functions

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

2 years agoradv: upload shader binaries after they are all compiled
Samuel Pitoiset [Fri, 5 Nov 2021 12:30:28 +0000 (13:30 +0100)]
radv: upload shader binaries after they are all compiled

Instead of mixing compilation and upload. This will allow us to
upload all shader binaries contiguously in memory and also for future
pipeline libraries work.

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

2 years agoradv: add a helper function to upload a shader binary
Samuel Pitoiset [Fri, 5 Nov 2021 12:30:06 +0000 (13:30 +0100)]
radv: add a helper function to upload a shader binary

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

2 years agoradv: remove never reached free() when compiling shaders
Samuel Pitoiset [Fri, 5 Nov 2021 12:30:44 +0000 (13:30 +0100)]
radv: remove never reached free() when compiling shaders

binary_out is never NULL and binaries are freed from the pipeline
after they are added to the cache.

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

2 years agofreedreno/ci/a306: split off snorm blending failures
Ilia Mirkin [Wed, 1 Dec 2021 05:17:26 +0000 (00:17 -0500)]
freedreno/ci/a306: split off snorm blending failures

The hardware doesn't support this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13990>

2 years agofreedreno/ci/a306: split off the f32 blend / texturing failures
Ilia Mirkin [Wed, 1 Dec 2021 05:11:30 +0000 (00:11 -0500)]
freedreno/ci/a306: split off the f32 blend / texturing failures

The hardware doesn't support this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13990>

2 years agofreedreno/ci/a306: separate msaa fails
Ilia Mirkin [Wed, 1 Dec 2021 05:04:59 +0000 (00:04 -0500)]
freedreno/ci/a306: separate msaa fails

The driver does not implement MSAA. When that happens these can be split
up further.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13990>

2 years agowindows: Use TLS context/dispatch with shared-glapi
Jesse Natalie [Tue, 2 Nov 2021 18:38:02 +0000 (11:38 -0700)]
windows: Use TLS context/dispatch with shared-glapi

However they have to be called via _glapi_get_dispatch/context. This
would be safe to do on any platform, but the extra indirection is only
necessary on Windows since TLS vars can't be exported from a DLL.

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

2 years agofreedreno/a3xx: add some legacy formats
Ilia Mirkin [Wed, 1 Dec 2021 03:53:15 +0000 (22:53 -0500)]
freedreno/a3xx: add some legacy formats

These can be used in "legacy" buffer textures.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13989>

2 years agofreedreno/ci/a306: add additional skip which hangchecks
Ilia Mirkin [Wed, 1 Dec 2021 04:33:23 +0000 (23:33 -0500)]
freedreno/ci/a306: add additional skip which hangchecks

I was having trouble getting a run to complete without this. Was working
earlier, not sure what changed.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13989>

2 years agofreedreno/a6xx: Set the tess BO ptrs in the program stateobj.
Emma Anholt [Wed, 17 Nov 2021 22:45:03 +0000 (14:45 -0800)]
freedreno/a6xx: Set the tess BO ptrs in the program stateobj.

Saves some draw-time work for tess.

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

2 years agofreedreno/a6xx: Skip emitting tess BO pointers past the shader's constlen.
Emma Anholt [Wed, 17 Nov 2021 22:37:29 +0000 (14:37 -0800)]
freedreno/a6xx: Skip emitting tess BO pointers past the shader's constlen.

Some shaders don't want these pointers, and going past the constlen would
potentially overwrite consts from other draws.  This is a port of a fix
from turnip.

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

2 years agofreedreno/a6xx: Allocate a fixed-size tess factor BO.
Emma Anholt [Wed, 17 Nov 2021 22:10:41 +0000 (14:10 -0800)]
freedreno/a6xx: Allocate a fixed-size tess factor BO.

Saves per-batch allocations, avoids reallocation for various vertex
counts, and avoids needing the indirect tess addrs constobj so that we
could emit the relocs to the tess BO after we'd emitted all the draws.

Also apparently it fixes one of our CTS fails.

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

2 years agoradv: Don't emit framebuffer state if there is no renderpass active.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 12:09:57 +0000 (13:09 +0100)]
radv: Don't emit framebuffer state if there is no renderpass active.

The framebuffer state could still be dirty from when the previous
renderpass was bound.

Fixes: 5632359959f ("radv: Remove the skipping of framebuffer emission if we don't have a framebuffer.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5702
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13969>

2 years agod3d12: Support compat level 330
Jesse Natalie [Sat, 20 Nov 2021 04:07:30 +0000 (20:07 -0800)]
d3d12: Support compat level 330

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14001>

2 years agovenus: ignore framebuffer for VkCommandBuffer executed outside of render pass
Ryan Neph [Tue, 30 Nov 2021 23:39:17 +0000 (15:39 -0800)]
venus: ignore framebuffer for VkCommandBuffer executed outside of render pass

The vulkan spec states[1]:
> If the VkCommandBuffer will not be executed within a render pass instance,
> or if the render pass instance was begun with vkCmdBeginRenderingKHR,
> renderPass, subpass, and framebuffer are ignored.

but venus will still try to encode them, resulting in a guest-side
assert or host-side command stream error.

[1]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandBufferInheritanceInfo.html#_description

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

2 years agonir: Make nir_build_alu() variants per 1-4 arg count.
Emma Anholt [Mon, 22 Nov 2021 19:45:23 +0000 (11:45 -0800)]
nir: Make nir_build_alu() variants per 1-4 arg count.

This saves a bunch of generated code to pack up the extra NULLs to get to
4 args, and saves executing the conditions in nir_build_alu() to then skip
those NULLs.

Saves another 27kb on disk.

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

2 years agonir: Uninline a bunch of nir.h functions.
Emma Anholt [Mon, 22 Nov 2021 19:11:16 +0000 (11:11 -0800)]
nir: Uninline a bunch of nir.h functions.

I aimed for "things that look like big switch statements, or cases where
the compiler is unlikely to be able to constant-propagate an argument into
something useful."

Saves another 80kb on disk.  No perf difference on iris shader-db, n=23.

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

2 years agoiris: Drop redundant iris_resource_disable_aux call
Nanley Chery [Mon, 16 Aug 2021 16:08:24 +0000 (09:08 -0700)]
iris: Drop redundant iris_resource_disable_aux call

Drop the call to iris_resource_disable_aux in
iris_resource_configure_aux. With the previous patches, we no longer
create CCS surfaces and pick the AUX_NONE usage. As a result, if the aux
usage is NONE, all iris_resource fields already indicate that aux is
disabled.

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

2 years agoiris: Enable CCS_E on 32-bpc float formats on TGL+
Nanley Chery [Mon, 16 Aug 2021 15:57:35 +0000 (08:57 -0700)]
iris: Enable CCS_E on 32-bpc float formats on TGL+

Allow CCS_E on these formats on TGL+ for a couple reasons:

1) TGL doesn't have the option to fall back to CCS_D/fast-clears like
   prior platforms do.

2) The CCS compression scheme on TGL improves to encode more than 3
   levels of compression. This should help floating point formats.

In my measurements, enabling this on TGL results in a minor performance
improvement on Paraview (+0.06%) rather than a major regression like on
prior platforms. The improvement was measured by taking the average of 3
runs of: waveletvolume.py -d 256 -f 600.

Also, the Intel performance CI reports a 3.81% ±0.12% FPS improvement in
Bioshock Infinite.

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

2 years agointel/isl: Unify fmt checks in isl_surf_supports_ccs
Nanley Chery [Mon, 16 Aug 2021 15:48:31 +0000 (08:48 -0700)]
intel/isl: Unify fmt checks in isl_surf_supports_ccs

On TGL+, require that the surface format supports CCS_E in order to
support CCS. This aligns with the ISL code that pads the primary
surface for CCS on this platform.

Pre-TGL, require support for either CCS_D or CCS_E.

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

2 years agodocs: update calendar and link releases notes for 21.3.1
Eric Engestrom [Wed, 1 Dec 2021 19:08:02 +0000 (19:08 +0000)]
docs: update calendar and link releases notes for 21.3.1

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

2 years agodocs: add release notes for 21.3.1
Eric Engestrom [Wed, 1 Dec 2021 18:56:57 +0000 (18:56 +0000)]
docs: add release notes for 21.3.1

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

2 years agoCI/d3d12: Add a quick_shader run
Jesse Natalie [Sun, 21 Nov 2021 15:33:16 +0000 (07:33 -0800)]
CI/d3d12: Add a quick_shader run

Refactor the YML for some DRY, and rename the existing pass from
"-windows" to "-quick_gl" to disambiguate it.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13902>