platform/upstream/mesa.git
2 years agodri_interface: remove gl header
Yiwei Zhang [Fri, 15 Oct 2021 20:30:56 +0000 (20:30 +0000)]
dri_interface: remove gl header

Only gl typedefs are used. So just remove the header and update the
types to the underlying types.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>

2 years agodri_interface: remove obsolete interfaces
Yiwei Zhang [Fri, 15 Oct 2021 18:38:32 +0000 (18:38 +0000)]
dri_interface: remove obsolete interfaces

Below are removed:
__DRI_FRAME_TRACKING
__DRI_TEX_OFFSET
__DRI_GET_DRAWABLE_INFO

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>

2 years agonir/serialize: Pack deref modes better
Jason Ekstrand [Fri, 15 Oct 2021 18:25:50 +0000 (13:25 -0500)]
nir/serialize: Pack deref modes better

With nir_var_image, we've now run out of bits in our packed blob for
deref instructions.  We could revert to an unpacked blob or we could be
a bit more clever about how we encode deref modes and pack them into 5
bits.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>

2 years agonir: Re-arrange the variable modes
Jason Ekstrand [Fri, 15 Oct 2021 18:04:45 +0000 (13:04 -0500)]
nir: Re-arrange the variable modes

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>

2 years agonir: s/nir_var_mem_image/nir_var_image/g
Jason Ekstrand [Fri, 15 Oct 2021 17:58:22 +0000 (12:58 -0500)]
nir: s/nir_var_mem_image/nir_var_image/g

We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout.  Images are opaque.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>

2 years agomeson: use gtest protocol for gtest based tests when possible
Dylan Baker [Wed, 13 Jan 2021 21:10:21 +0000 (13:10 -0800)]
meson: use gtest protocol for gtest based tests when possible

With the `gtest` protocol meson will add some extra arguments to the
test to generate better junit results, which may be useful. This
protocol is only available in meson 0.55.0+, so keep using the default
`exitcode` protocol for meson older than that.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8484>

2 years agomicrosoft/compiler: Shadow tex instructions always use shadow samplers
Enrico Galli [Tue, 12 Oct 2021 18:31:27 +0000 (11:31 -0700)]
microsoft/compiler: Shadow tex instructions always use shadow samplers

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

2 years agoaux/pb: more correctly check number of reclaims
Mike Blumenkrantz [Fri, 15 Oct 2021 20:01:52 +0000 (16:01 -0400)]
aux/pb: more correctly check number of reclaims

the increment needs to happen before the comparison here

Fixes: 3d6c8829f54 ("aux/pb: add a tolerance for reclaim failure")

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

2 years agonir: Drop our attempt at typed-based image mode validation
Jason Ekstrand [Fri, 15 Oct 2021 17:46:58 +0000 (12:46 -0500)]
nir: Drop our attempt at typed-based image mode validation

This is broken for bindless images declared as local variables.  It
turns out nir_variable::data::bindless is only used for uniforms and we
already assume anything in nir_var_function_temp or similar is bindless.
We could try to make a tricky assert but now that we have everything
else passing but now that we've got everyone converted the extra
validation probably isn't necessary.

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

2 years agointel: fix INTEL_DEBUG environment variable on 32-bit systems
Marcin Ślusarz [Wed, 13 Oct 2021 09:21:41 +0000 (11:21 +0200)]
intel: fix INTEL_DEBUG environment variable on 32-bit systems

INTEL_DEBUG is defined (since 4015e1876a77162e3444eeaa29a0dfbc47efe90e) as:

 #define INTEL_DEBUG __builtin_expect(intel_debug, 0)

which unfortunately chops off upper 32 bits from intel_debug
on platforms where sizeof(long) != sizeof(uint64_t) because
__builtin_expect is defined only for the long type.

Fix this by changing the definition of INTEL_DEBUG to be function-like
macro with "flags" argument. New definition returns 0 or 1 when
any of the flags match.

Most of the changes in this commit were generated using:
for c in `git grep INTEL_DEBUG | grep "&" | grep -v i915 | awk -F: '{print $1}' | sort | uniq`; do
    perl -pi -e "s/INTEL_DEBUG & ([A-Z0-9a-z_]+)/INTEL_DBG(\1)/" $c
    perl -pi -e "s/INTEL_DEBUG & (\([A-Z0-9_ |]+\))/INTEL_DBG\1/" $c
done
but it didn't handle all cases and required minor cleanups (like removal
of round brackets which were not needed anymore).

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13334>

2 years agovirgl: remove unused pipebuffer include
Mike Blumenkrantz [Fri, 15 Oct 2021 18:15:25 +0000 (14:15 -0400)]
virgl: remove unused pipebuffer include

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

2 years agoaux/pb: add a tolerance for reclaim failure
Mike Blumenkrantz [Wed, 13 Oct 2021 17:34:30 +0000 (13:34 -0400)]
aux/pb: add a tolerance for reclaim failure

originally, a slab attempts to reclaim a single bo. there are two outcomes
to this which can occur:
* the bo is reclaimed
* the bo is not reclaimed

if the bo is reclaimed, great.

if the bo is not reclaimed, it remains at the head of the list until it can
be reclaimed. this means that any bo with a "long" work queue which makes it
into a slab will effectively kill the entire slab. in a benchmarking scenario,
this can occur in rapid succession, and every slab will get 1-2 suballocations
before it reaches a bo that blocks long enough for a new slab to be needed.

the inevitable result of this scenario is that all memory is depleted almost instantly,
all because pb assumes that if the first bo in the reclaim list isn't ready, none of them
can be ready

for drivers like radeonsi, this happens to be a fine assumption

for drivers like zink, this is entirely not workable and explodes the gpu

Cc: mesa-stable
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13345>

2 years agointel/compiler: Build all tests in a single binary
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:27:53 +0000 (23:27 -0700)]
intel/compiler: Build all tests in a single binary

With gtest is possible to filter execution and run only a specific
test suite or individual test, so there's no particular reason here to
generate multiple binaries for the tests of a single module.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>

2 years agointel/compiler: Rename vec4 test fixtures
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:20:39 +0000 (23:20 -0700)]
intel/compiler: Rename vec4 test fixtures

Include vec4 in their names to avoid same names as the fs
counterparts.  This will allow compiling all the tests together in the
future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>

2 years agofreedreno/isa: Add immed reg accessors
Rob Clark [Wed, 13 Oct 2021 22:53:55 +0000 (15:53 -0700)]
freedreno/isa: Add immed reg accessors

This way we can assert that a src that we expect to be an immediate
actually is.

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

2 years agoisaspec: Add bitfield size assertions
Rob Clark [Mon, 11 Oct 2021 18:50:03 +0000 (11:50 -0700)]
isaspec: Add bitfield size assertions

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

2 years agoisaspec: Do not emit duplicate field encodes
Rob Clark [Wed, 13 Oct 2021 17:55:16 +0000 (10:55 -0700)]
isaspec: Do not emit duplicate field encodes

If an <override> overrides the definition of a field, don't emit
encoding for both the override's definition and the fallback.  (See
"SAMP" in #cat5-src3).  It is harmless currently, because (in this
case) it will just re-encode the low bits of "SAMP".  But when we
start asserting on that the field being encoded fits in the allowed
number of bits, the re-encoding of the fallback field definition
will start triggering asserts.

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

2 years agoisaspec: Fix derived field width
Rob Clark [Tue, 12 Oct 2021 21:22:25 +0000 (14:22 -0700)]
isaspec: Fix derived field width

The low/high bit positions should be integers.

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

2 years agofreedreno/ir3: Don't lower s2en if samp/tex is too large
Rob Clark [Wed, 13 Oct 2021 21:14:29 +0000 (14:14 -0700)]
freedreno/ir3: Don't lower s2en if samp/tex is too large

We only have four bits to encode an immediate samp/tex.

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

2 years agofreedreno/ir3/tests: Add additional disasm test vectors
Rob Clark [Tue, 12 Oct 2021 18:32:39 +0000 (11:32 -0700)]
freedreno/ir3/tests: Add additional disasm test vectors

Add branch with negative offset, and a couple others to trigger issues I
found while adding pack_field() overflow asserts.

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

2 years agofreedreno/ir3/tests: Fix indentation
Rob Clark [Wed, 13 Oct 2021 18:11:28 +0000 (11:11 -0700)]
freedreno/ir3/tests: Fix indentation

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

2 years agofreedreno/isa: Fixes for validation
Rob Clark [Tue, 12 Oct 2021 17:23:18 +0000 (10:23 -0700)]
freedreno/isa: Fixes for validation

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

2 years agofreedreno/ir3+isa: Cleanup bindless cat5 samp/tex encoding
Rob Clark [Tue, 12 Oct 2021 17:57:24 +0000 (10:57 -0700)]
freedreno/ir3+isa: Cleanup bindless cat5 samp/tex encoding

Don't let the way they are encoded at the isa level leak thru to the
ir3 level.

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

2 years agoir3: Images are always nir_var_mem_image
Jason Ekstrand [Fri, 1 Oct 2021 04:42:44 +0000 (23:42 -0500)]
ir3: Images are always nir_var_mem_image

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agomicrosoft/clc: Images use nir_var_mem_image
Jesse Natalie [Tue, 28 Sep 2021 19:13:30 +0000 (12:13 -0700)]
microsoft/clc: Images use nir_var_mem_image

The only big change is that lower_vars_to_explicit no longer assigns
a driver_location for images. That means that the storage for the
format/order loads is no longer implicitly "allocated" in the middle
of the kernel args. Instead, manually add the storage for that to the end
of the input args buffer.

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

2 years agonir/gl_nir_lower_images: Require nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 19:24:37 +0000 (14:24 -0500)]
nir/gl_nir_lower_images: Require nir_var_mem_image

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agointel/fs: Stop emitting TGM fences for nir_var_mem_ssbo
Jason Ekstrand [Wed, 15 Sep 2021 18:07:15 +0000 (13:07 -0500)]
intel/fs: Stop emitting TGM fences for nir_var_mem_ssbo

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoaco: Split var_mem_image barrier handling from global/ssbo
Jason Ekstrand [Wed, 15 Sep 2021 16:51:42 +0000 (11:51 -0500)]
aco: Split var_mem_image barrier handling from global/ssbo

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

2 years agonir: Validate image variable modes
Jason Ekstrand [Wed, 15 Sep 2021 16:39:12 +0000 (11:39 -0500)]
nir: Validate image variable modes

We can also significantly simplify the foreach_image_variable helper.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agost/pbo: Use nir_var_mem_image for images
Jason Ekstrand [Wed, 15 Sep 2021 20:27:49 +0000 (15:27 -0500)]
st/pbo: Use nir_var_mem_image for images

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoradv: Use nir_var_mem_image in meta shaders
Rhys Perry [Fri, 17 Sep 2021 13:22:06 +0000 (08:22 -0500)]
radv: Use nir_var_mem_image in meta shaders

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

2 years agottn: Use nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 20:26:17 +0000 (15:26 -0500)]
ttn: Use nir_var_mem_image

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoglsl: Use nir_var_mem_image for images
Jason Ekstrand [Wed, 15 Sep 2021 16:41:09 +0000 (11:41 -0500)]
glsl: Use nir_var_mem_image for images

We don't use it for bindless images because the uniforms in that case
just contain a bindless handle and aren't an actual image.  Bound
images, on the other hand, go in the nir_var_mem_image class.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agospirv: Use nir_var_mem_image
Caio Marcelo de Oliveira Filho [Fri, 2 Jul 2021 08:01:45 +0000 (01:01 -0700)]
spirv: Use nir_var_mem_image

Use the new nir_var_mem_image mode for images that are not known to be
used with a sampler (i.e. storage images).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agospirv: Assert that OpTypeForwardPointer only points to structs
Jason Ekstrand [Mon, 27 Sep 2021 21:43:23 +0000 (16:43 -0500)]
spirv: Assert that OpTypeForwardPointer only points to structs

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoir3: Check for nir_var_mem_image in shared_barrier handling
Jason Ekstrand [Fri, 1 Oct 2021 04:42:06 +0000 (23:42 -0500)]
ir3: Check for nir_var_mem_image in shared_barrier handling

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agozink: Images can live in nir_var_mem_image now
Jason Ekstrand [Thu, 30 Sep 2021 17:32:48 +0000 (12:32 -0500)]
zink: Images can live in nir_var_mem_image now

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

2 years agoclover: Use nir_foreach_image_variable for images
Jason Ekstrand [Mon, 27 Sep 2021 22:11:12 +0000 (17:11 -0500)]
clover: Use nir_foreach_image_variable for images

This splits image and sampler handling into two separate loops.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoclover: Insert dummy uniform variables for images
Jason Ekstrand [Mon, 27 Sep 2021 23:42:20 +0000 (18:42 -0500)]
clover: Insert dummy uniform variables for images

Instead of making images have a well-defined size, insert a dummy
variable of the appropriate type which we can use for the parameter
block layout.  This will work much better when we switch over to
nir_var_mem_image.

Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agonir/lower_readonly_images_to_tex: Also rewrite variable modes
Jason Ekstrand [Mon, 27 Sep 2021 22:08:20 +0000 (17:08 -0500)]
nir/lower_readonly_images_to_tex: Also rewrite variable modes

Storage images will start using nir_var_mem_image but sampled images
still use nir_var_uniform.  If we're going to rewrite types, we need to
rewrite the modes as well.  Otherwise, nir_validate will get grumpy and
drivers might get confused.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agollvmpipe: Support image variables living in nir_var_mem_image
Jason Ekstrand [Wed, 29 Sep 2021 23:21:13 +0000 (18:21 -0500)]
llvmpipe: Support image variables living in nir_var_mem_image

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agontt: Separate image and sampler handling
Jason Ekstrand [Wed, 29 Sep 2021 23:20:46 +0000 (18:20 -0500)]
ntt: Separate image and sampler handling

Use nir_foreach_image_variable for images so we survive the coming
refactor where they get their own mode.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agost/nir: Assign uniform locations to nir_var_mem_image vars
Jason Ekstrand [Wed, 15 Sep 2021 21:53:44 +0000 (16:53 -0500)]
st/nir: Assign uniform locations to nir_var_mem_image vars

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agonir/gl_nir_lower_images: Support nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 19:24:18 +0000 (14:24 -0500)]
nir/gl_nir_lower_images: Support nir_var_mem_image

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agonir/gl_nir_lower_samplers_as_deref: Support nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 21:57:19 +0000 (16:57 -0500)]
nir/gl_nir_lower_samplers_as_deref: Support nir_var_mem_image

Contrary to the name of the pass, it also handles storage images so we
need to support nir_var_mem_image.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoglsl/nir_linker: nir_var_mem_image is also a GL uniform
Jason Ekstrand [Wed, 15 Sep 2021 19:29:15 +0000 (14:29 -0500)]
glsl/nir_linker: nir_var_mem_image is also a GL uniform

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agoaco: Add support for nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 16:50:42 +0000 (11:50 -0500)]
aco: Add support for nir_var_mem_image

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

2 years agoamd/llvm/nir: Add support for nir_var_mem_image
Jason Ekstrand [Wed, 15 Sep 2021 16:50:21 +0000 (11:50 -0500)]
amd/llvm/nir: Add support for nir_var_mem_image

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

2 years agoanv: Use nir_foreach_image_variable
Caio Marcelo de Oliveira Filho [Fri, 25 Jun 2021 21:40:35 +0000 (14:40 -0700)]
anv: Use nir_foreach_image_variable

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

2 years agoi965/uniforms: Handle images as a separate pass
Jason Ekstrand [Wed, 15 Sep 2021 16:34:06 +0000 (11:34 -0500)]
i965/uniforms: Handle images as a separate pass

Instead of walking all uniforms and handling images as a special case,
walk "normal" uniforms first and images as a second pass.  This lets us
use nir_foreach_image_variable which will survive the upcoming refactor.
While we're at it, use nir_foreach_image_variable in
brw_nir_lower_gl_images too.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agointel/fs: Consider nir_var_mem_image for TGM fences
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 22:48:17 +0000 (14:48 -0800)]
intel/fs: Consider nir_var_mem_image for TGM fences

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

2 years agonir: Add a nir_foreach_image_variable() iterator
Jason Ekstrand [Wed, 15 Sep 2021 16:22:59 +0000 (11:22 -0500)]
nir: Add a nir_foreach_image_variable() iterator

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>

2 years agonir: Add nir_var_mem_image
Caio Marcelo de Oliveira Filho [Wed, 8 Jan 2020 21:54:47 +0000 (13:54 -0800)]
nir: Add nir_var_mem_image

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

2 years agonir/schedule: Handle nir_intrisic_scoped_barrier
Caio Marcelo de Oliveira Filho [Thu, 9 Jan 2020 18:37:48 +0000 (10:37 -0800)]
nir/schedule: Handle nir_intrisic_scoped_barrier

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

2 years agofreedreno: Fix for large epilogues
Rob Clark [Thu, 14 Oct 2021 18:36:46 +0000 (11:36 -0700)]
freedreno: Fix for large epilogues

Apparently Rocket League overflows the fixed size epilogue.  Switch it
to be growable.

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

2 years agov3dv: enable VK_KHR_swapchain_mutable_format
Ella-0 [Sun, 10 Oct 2021 14:24:00 +0000 (14:24 +0000)]
v3dv: enable VK_KHR_swapchain_mutable_format

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

2 years agoaco: do not return an empty string when disassembly is not supported
Samuel Pitoiset [Wed, 13 Oct 2021 11:05:54 +0000 (13:05 +0200)]
aco: do not return an empty string when disassembly is not supported

Fixes dEQP-VK.pipeline.executable_properties.* on GFX6-7 when
clrxdisasm isn't found. Other generations are also affected if RADV
is built without LLVM.

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13333>

2 years agoiris: fix scratch address patching for TESS_EVAL stage
Marcin Ślusarz [Thu, 14 Oct 2021 11:22:08 +0000 (13:22 +0200)]
iris: fix scratch address patching for TESS_EVAL stage

Scratch patching code in iris_upload_dirty_render_state (see MERGE_SCRATCH_ADDR
calls) assumes that in all shader stages derived_data field stores 3DSTATE_XS
packet first.

This is not true for TESS_EVAL (DS), so we end up patching 3DSTATE_TE
instead of 3DSTATE_DS leading to DWordLength becoming 11 instead of 9
(9 == 3DSTATE_DS.DWordLength, 2 == 3DSTATE_TE.DWordLength, and 9|2 == 11),
and hardware hanging on the next instruction.

Fix this by reversing the order of packets for TESS_EVAL stage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5499

Fixes: 4256f7ed584 ("iris: Fill out scratch base address dynamically")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13358>

2 years agocrocus: Delete the MI_COPY_MEM_MEM resource_copy_region implementation.
Dave Airlie [Wed, 15 Sep 2021 04:26:36 +0000 (14:26 +1000)]
crocus: Delete the MI_COPY_MEM_MEM resource_copy_region implementation.

(ported from iris - airlied)

The MI_COPY_MEM_MEM version of resource_copy_region has known bugs:

    It's failing to set valid_buffer_range correctly
    It's missing iris_emit_buffer_barrier_for() for the source/destination, so there may be missing flushes.
    There are some bad interactions with the tile cache and VF using L3.

Even with those fixed, if you expand the "no more than 16 bytes" restriction to allow copies up to 1024 bytes, then it starts failing Piglit tests on Icelake.

We could probably fix this. However, I had originally only measured a 0.689096% +/- 0.473968% (n=4) speedup in Shadow of Mordor's OpenGL port, which is already fairly small, especially before adding missing flushes. Further, some of that likely came from not switching between render and compute...which we'll soon be able to avoid thanks to BLOCS.

Folks were also worried that MI_COPY_MEM_MEM can't be pipelined, and that stalling the command streamer may actually slow things down, especially as the GPUs become more powerful. We aren't really sure about this, but it's another concern.

So, let's just get rid of this optimization. It seemed like a good idea at the time, but it's just causing issues for very little gain.

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

2 years agoegl: set TSD as NULL after deinit
Maniraj D [Mon, 11 Oct 2021 17:07:02 +0000 (22:37 +0530)]
egl: set TSD as NULL after deinit

When eglReleaseThread() is called from application's
destructor (API with __attribute__((destructor))),
it crashes due to invalid memory access.

In this case, _egl_TLS is freed in the flow of
_eglAtExit() as below but _egl_TLS is not set to NULL.

    _eglDestroyThreadInfo
        _eglFiniTSD
            _eglAtExit
                _run_exit_handlers
                    exit

Later when the eglReleaseThread is called from
application's destructor, it ends-up accessing
the freed _egl_TLS pointer.

    eglReleaseThread -> in libEGL_mesa
        eglReleaseThread -> in libEGL(glvnd)
            destructor() -> App's destructor

To resolve the invalid access, setting the _egl_TLS
pointer as NULL after freeing it.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5466
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13302>

2 years agov3dv: implement VK_EXT_host_query_reset
Ella-0 [Tue, 12 Oct 2021 16:58:33 +0000 (16:58 +0000)]
v3dv: implement VK_EXT_host_query_reset

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

2 years agoi965: Emit a NULL surface for buffer textures with no buffer
Jason Ekstrand [Wed, 13 Oct 2021 21:31:57 +0000 (16:31 -0500)]
i965: Emit a NULL surface for buffer textures with no buffer

This is a preexisting bug but it was uncovered by 231653ea3506
("intel/isl: Add a max_buffer_size limit to isl_device") which added an
assert(num_elements > 0) for typed buffers.

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

2 years agozink: Do not access just freed zink_batch_state
Witold Baryluk [Thu, 14 Oct 2021 22:29:47 +0000 (00:29 +0200)]
zink: Do not access just freed zink_batch_state

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13370>

2 years agoanv: don't advertise vk conformance on GPUs that aren't conformant
Clayton Craft [Wed, 13 Oct 2021 23:06:51 +0000 (16:06 -0700)]
anv: don't advertise vk conformance on GPUs that aren't conformant

This sets the conformance version to 0.0.0.0 for GPUs that have
incomplete support for vulkan, so that it's easier to check if vulkan is
fully supported by a GPU at runtime for applications/libraries.

    $ vulkaninfo|grep conf
    MESA-INTEL: warning: Ivy Bridge Vulkan support is incomplete
        conformanceVersion = 0.0.0.0

Signed-off-by: Clayton Craft <clayton@craftyguy.net>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13275>

2 years agodocs: update calendar and link releases notes for 21.2.4
Dylan Baker [Thu, 14 Oct 2021 20:23:18 +0000 (13:23 -0700)]
docs: update calendar and link releases notes for 21.2.4

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

2 years agodocs: add sha256 sum for 21.2.4 release
Dylan Baker [Thu, 14 Oct 2021 20:17:10 +0000 (13:17 -0700)]
docs: add sha256 sum for 21.2.4 release

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

2 years agodocs: add release notes for 21.2.4
Dylan Baker [Thu, 14 Oct 2021 19:56:02 +0000 (12:56 -0700)]
docs: add release notes for 21.2.4

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

2 years agodocs: update calendar for 21.3.0-rc1
Eric Engestrom [Thu, 14 Oct 2021 19:51:08 +0000 (20:51 +0100)]
docs: update calendar for 21.3.0-rc1

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

2 years agoir3/freedreno: account for component in build_tessfactor_base
Danylo Piliaiev [Wed, 13 Oct 2021 12:54:23 +0000 (15:54 +0300)]
ir3/freedreno: account for component in build_tessfactor_base

The burden was put on the caller, which caused:
- Reading of tess levels back in TCS not accounting for component
- Reading patch outputs in TES account for component twice

Fixes vkd3d tests:
- test_tessellation_read_tesslevel
- test_tessellation_primitive_id
- test_line_tessellation_dxbc

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

2 years agoloader: Avoid enumerating drm devices just to get an fd's PCI ID.
Emma Anholt [Tue, 12 Oct 2021 21:31:31 +0000 (14:31 -0700)]
loader: Avoid enumerating drm devices just to get an fd's PCI ID.

Cuts 1/3 of the runtime of the VA-API unit tests (which do a separate
pipe-loader init per test) on radeonsi on my system by not faffing around
in sysfs so much.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13324>

2 years agovulkan/wsi/win32: Delete the wrapper entrypoints
Jason Ekstrand [Wed, 13 Oct 2021 21:58:38 +0000 (16:58 -0500)]
vulkan/wsi/win32: Delete the wrapper entrypoints

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13352>

2 years agonir/print: print bindless info as applicable
Mike Blumenkrantz [Tue, 14 Sep 2021 19:28:24 +0000 (15:28 -0400)]
nir/print: print bindless info as applicable

this is useful to know

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

2 years agovulkan/log: Don't assert on non-client-visible objects
Jason Ekstrand [Wed, 13 Oct 2021 16:07:24 +0000 (11:07 -0500)]
vulkan/log: Don't assert on non-client-visible objects

We already have code to deal with non-client-visible objects but we were
asserting if it didn't fall into one of the clearly mappable error
cases.  However, we didn't have a mapping for VK_ERROR_NOT_PERMITTED
which can happen during object creation.  Let's just be sloppy and drop
the assert.  Worst case, the client gets an error with no object.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13341>

2 years agovulkan/log: Tweak our handling of a couple error enums
Jason Ekstrand [Wed, 13 Oct 2021 16:05:48 +0000 (11:05 -0500)]
vulkan/log: Tweak our handling of a couple error enums

VK_ERROR_INITIALIZATION_FAILED can happen as part of device creation and
isn't really an instance error in that case.
VK_ERROR_EXTENSION_NOT_PRESENT, on the other hand, is always an instance
thing and we should handle it as such.

Fixes: 0cad3beb2a0d ("vulkan/log: Add common vk_error and vk_errorf helpers")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13341>

2 years agovulkan: Set unused entrypoints to vk_entrypoint_stub when compiling with MSVC
Boris Brezillon [Thu, 14 Oct 2021 08:34:37 +0000 (10:34 +0200)]
vulkan: Set unused entrypoints to vk_entrypoint_stub when compiling with MSVC

If we don't do that we hit the assert(entry[i] != NULL) added by commit
6d44b21d4fd ("vulkan: Fix weak symbol emulation when compiling with MSVC").

Fixes: 6d44b21d4fd ("vulkan: Fix weak symbol emulation when compiling with MSVC")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13355>

2 years agoradv: Fix modifier property query.
Bas Nieuwenhuizen [Wed, 13 Oct 2021 20:37:35 +0000 (22:37 +0200)]
radv: Fix modifier property query.

radv_get_modifier_flags read the format properties, doesn't write any. Setting
the central format properties based on the drm format properties doesn't make
any sense.

Fixes: 5dee0d9da96 "radv: switch to VK_FORMAT_FEATURE_2_XXX/VkFormatProperties3KHR"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5498
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13357>

2 years agov3dv: fix TLB buffer to image copy path for 3D images
Iago Toral Quiroga [Thu, 14 Oct 2021 08:42:23 +0000 (10:42 +0200)]
v3dv: fix TLB buffer to image copy path for 3D images

Another instance of not taking the Z offset from the right place. We had
not seen this one until now because we typically use the TFU path, where
we also fixed this same issue in commit df1d08533c4.

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

2 years agovulkan: Fix weak symbol emulation when compiling with MSVC
Boris Brezillon [Wed, 13 Oct 2021 19:50:59 +0000 (21:50 +0200)]
vulkan: Fix weak symbol emulation when compiling with MSVC

Mapping unimplemented entrypoints to a global function pointer variable
initialized to NULL is a bit cumbersome, and actually led to a bug
in the vk_xxx_dispatch_table_from_entrypoints() template: the !override
case didn't have the right check on the source table entries. Instead of
fixing that case, let's simplify the logic by creating a stub function
and making the alternatename pragma point to this stub. This way we get
rid of all those uneeded xxx_Null symbols/variables and simplify the
tests in vk_xxxx_dispatch_table_from_entrypoints().

Cc: mesa-stable
Fixes: 98c622a96e28 ("vulkan: Update dispatch table gen for Windows")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13348>

2 years agonir/loop_unroll: Always unroll loops that iterate at most once
Ian Romanick [Tue, 12 Oct 2021 20:06:04 +0000 (13:06 -0700)]
nir/loop_unroll: Always unroll loops that iterate at most once

Two carchase compute shaders (shader-db) and two Fallout 4 fragment
shaders (fossil-db) were helped.  Based on the NIR of the shaders, all
four had structures like

    for (i = 0; i < 1; i++) {
        ...

for (...) {
            ...
}
    }

All HSW+ platforms had similar results. (Ice Lake shown)
total loops in shared programs: 6033 -> 6031 (-0.03%)
loops in affected programs: 4 -> 2 (-50.00%)
helped: 2
HURT: 0

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 143692018 -> 143692006 (-0.0%)
SENDs in all programs: 6947154 -> 6947154 (+0.0%)
Loops in all programs: 38285 -> 38283 (-0.0%)
Cycles in all programs: 8434822225 -> 8434476815 (-0.0%)
Spills in all programs: 191665 -> 191665 (+0.0%)
Fills in all programs: 298822 -> 298822 (+0.0%)

In the presense of loop unrolling like this, the change in cycles is not
accurate.

v2: Rearrange the logic in the if-condition to read a little better.
Suggested by Tim.

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

2 years agobrw/nir: remove unused function prototypes.
Dave Airlie [Wed, 13 Oct 2021 05:14:34 +0000 (15:14 +1000)]
brw/nir: remove unused function prototypes.

These got moved into common code a good while ago.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13328>

2 years agoanv: Enable tessellation redistribution
Anuj Phogat [Fri, 5 Jun 2020 21:40:25 +0000 (14:40 -0700)]
anv: Enable tessellation redistribution

This patch adds Tessellation Distribution on top of Geometry
Distribution. Using recommended values based on performance studies
across a range of workloads.

Rework:
- Add comment for new packet bits (Sagar)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@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/12091>

2 years agoiris: Enable tessellation redistribution
Anuj Phogat [Thu, 4 Jun 2020 18:50:35 +0000 (11:50 -0700)]
iris: Enable tessellation redistribution

This patch adds Tessellation Distribution on top of Geometry
Distribution. Using recommended values based on performance studies
across a range of workloads.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@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/12091>

2 years agoanv: Enable geometry distribution
Anuj Phogat [Fri, 5 Jun 2020 21:39:25 +0000 (14:39 -0700)]
anv: Enable geometry distribution

Using recommended values based on performance studies across a range
of workloads.

Rework:
 * Always enable geometry distribution
 * Set ListCutIndexEnable if primitive restart is enabled
 * Set distribution mode based on TEEnable
 * Add comment explaining the 3DSTATE_VFG bits (Sagar)

v2:
- Emit 3DSTATE_VFG dynamically based on primitive restart (Ken)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@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/12091>

2 years agoiris: Enable geometry distribution
Anuj Phogat [Wed, 3 Jun 2020 18:50:38 +0000 (11:50 -0700)]
iris: Enable geometry distribution

Using recommended values based on performance studies across a range
of workloads.

Rework:
 * Always enable geometry distribution
 * Set ListCutIndexEnable if primitive restart is enabled
 * Set distribution mode based on TEEnable

v2:
- Flag missing IRIS_DIRTY_VFG bit (Ken)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@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/12091>

2 years agogenxml/gen125: Update 3DSTATE_TE fields
Anuj Phogat [Thu, 4 Jun 2020 18:49:07 +0000 (11:49 -0700)]
genxml/gen125: Update 3DSTATE_TE fields

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@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/12091>

2 years agointel/genxml: Update genxml to support tessellation/geometry distribution
Jordan Justen [Tue, 20 Jul 2021 05:01:24 +0000 (22:01 -0700)]
intel/genxml: Update genxml to support tessellation/geometry distribution

Rework:
- Fix 3DSTATE_VFG opcode (Lionel)
- Fix distribution mode values (Sagar)
- Update 3DSTATE_VFG fields (Anuj)

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12091>

2 years agoci/lvp: Skip some slow tests under ASan.
Emma Anholt [Wed, 13 Oct 2021 19:04:40 +0000 (12:04 -0700)]
ci/lvp: Skip some slow tests under ASan.

depending on the runner's load, we might see timeouts.  The
subgroupbroadcast one has hit us a couple times this week.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13346>

2 years agov3d/clif: add support for dumping GS shader state
Alejandro Piñeiro [Fri, 8 Oct 2021 12:20:22 +0000 (14:20 +0200)]
v3d/clif: add support for dumping GS shader state

The basic vertex+fragment shader state uses the packet
GL_SHADER_STATE, but when geometry shader are involved, the packet
used is GL_SHADER_STATE_INCLUDING_GS.

Without this commit any program using a geometry shader would dump
their shader state (and their shader state record and attribues) as
binaries.

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

2 years agov3dv/pipeline: don't clone the nir shader at pipeline_state_create_binning
Alejandro Piñeiro [Tue, 12 Oct 2021 21:33:43 +0000 (23:33 +0200)]
v3dv/pipeline: don't clone the nir shader at pipeline_state_create_binning

At that point we didn't call all the v3dv lowerings. So the reference
nir shader used to call the v3d compiler could be different.

Note that at that point the nir shader is only available for internal
shaders (like gs multiview).

This specifically affected multiview tests that wrote gl_PointSize, as
the nir shader for the geometry shader were wrongly exposing
per_vertex_point_size as false, as we were basing our check on the
nir_shader_info, and that was gathered calling nir_shader_gather_info
at pipeline_lower_nir.

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

2 years agoVERSION: bump to 22.0
Eric Engestrom [Wed, 13 Oct 2021 19:52:19 +0000 (20:52 +0100)]
VERSION: bump to 22.0

I mistakenly bumped it from 21.3 to 21.4, but there is no 4 (:

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

2 years agodocs: reset new_features.txt
Eric Engestrom [Wed, 13 Oct 2021 19:29:27 +0000 (20:29 +0100)]
docs: reset new_features.txt

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2 years agoVERSION: bump to 21.4
Eric Engestrom [Wed, 13 Oct 2021 19:28:29 +0000 (20:28 +0100)]
VERSION: bump to 21.4

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2 years agoiris: Require a 4K alignment for extra clear color BOs.
Kenneth Graunke [Wed, 13 Oct 2021 01:09:04 +0000 (18:09 -0700)]
iris: Require a 4K alignment for extra clear color BOs.

Apparently, we've been requiring a 4K alignment for internally allocated
clear color addresses to work around some unknown issues.  There's a
comment to that effect in iris_resource_create_with_modifiers().

When importing a dmabuf and tacking on an additional clear color BO, we
only required an alignment of 1.  This wasn't a problem for a long time
because all BO allocations were naturally aligned to the 4K page size.

However, once we enabled suballocation, we were able to allocate "BOs"
at 256B granularity, making this no longer 4K aligned.  Increase the
alignment requirement to 4K to match the behavior of our normal
allocations and also our previous behavior.

Fixes Piglit's ext_image_dma_buf_import-intel-modifiers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5482
Fixes: ce2e2296ab6 ("iris: Suballocate BO using the Gallium pb_slab mechanism")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13326>

2 years agointel/compiler: Remove unused `ret` declaration
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:19:59 +0000 (23:19 -0700)]
intel/compiler: Remove unused `ret` declaration

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

2 years agointel/compiler: Convert test_eu_compact to use gtest
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 05:41:00 +0000 (22:41 -0700)]
intel/compiler: Convert test_eu_compact to use gtest

Be consistent with the other test suites in intel/compiler.

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

2 years agoradv: move alpha_adjust into conditional during vertex input updating
Mike Blumenkrantz [Wed, 8 Sep 2021 19:11:56 +0000 (15:11 -0400)]
radv: move alpha_adjust into conditional during vertex input updating

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13320>

2 years agoradv: add a mask of bound descriptor buffers for dynamic vertex input
Mike Blumenkrantz [Wed, 8 Sep 2021 19:10:29 +0000 (15:10 -0400)]
radv: add a mask of bound descriptor buffers for dynamic vertex input

unnecessarily dereferencing the vertex buffer info array here causes a
ton of cpu overhead due to bad cache locality, so just use a mask to
avoid loading X more cachelines into memory unnecessarily

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13320>

2 years agoradv: pre-calc "simple" dynamic vertex input values
Mike Blumenkrantz [Thu, 1 Jul 2021 19:20:36 +0000 (15:20 -0400)]
radv: pre-calc "simple" dynamic vertex input values

when the shader pipeline is known to not require any of the more complex
calculations, those calculations can be excluded from the dynamic update
code

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13320>

2 years agoradv: dynamically calculate misaligned_mask for dynamic vertex input
Mike Blumenkrantz [Thu, 1 Jul 2021 18:42:59 +0000 (14:42 -0400)]
radv: dynamically calculate misaligned_mask for dynamic vertex input

this avoids incurring overhead at draw time, instead shifting it to vertex
binding commands

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13320>

2 years agoradv: don't use invalid stride for triggering vertex state change
Mike Blumenkrantz [Wed, 13 Oct 2021 14:31:56 +0000 (10:31 -0400)]
radv: don't use invalid stride for triggering vertex state change

NULL here means this was regular CmdBindVertexBuffers, so the stride
cannot be used

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13320>