platform/upstream/mesa.git
20 months agoandroid: -Ddri-drivers= is not needed anymore
Yonggang Luo [Wed, 2 Nov 2022 10:10:08 +0000 (18:10 +0800)]
android: -Ddri-drivers= is not needed anymore

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19462>

20 months agodocs: There is no more swrast driver
Yonggang Luo [Wed, 2 Nov 2022 10:09:07 +0000 (18:09 +0800)]
docs: There is no more swrast driver

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19459>

20 months agodocs: There is only glx=xlib option now
Yonggang Luo [Wed, 2 Nov 2022 10:08:24 +0000 (18:08 +0800)]
docs: There is only glx=xlib option now

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19459>

20 months agodocs: -Ddri-drivers= option is deprecated, do not use it anymore
Yonggang Luo [Wed, 2 Nov 2022 10:05:23 +0000 (18:05 +0800)]
docs:  -Ddri-drivers= option is deprecated, do not use it anymore

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19459>

20 months agodocs: fixup rebase mistake
Erik Faye-Lund [Tue, 25 Oct 2022 10:38:02 +0000 (12:38 +0200)]
docs: fixup rebase mistake

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

20 months agoradeonsi: update db_eqaa even if msaa is disabled
Pierre-Eric Pelloux-Prayer [Wed, 26 Oct 2022 16:28:39 +0000 (18:28 +0200)]
radeonsi: update db_eqaa even if msaa is disabled

This seems to fix rendering in application toggling MSAA on and
off between draw calls.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7537
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19326>

20 months agoradeonsi/gfx11: enable sdma copy DRI_PRIME
Pierre-Eric Pelloux-Prayer [Wed, 26 Oct 2022 13:24:22 +0000 (15:24 +0200)]
radeonsi/gfx11: enable sdma copy DRI_PRIME

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

20 months agodocs: nfs -> NFS
Erik Faye-Lund [Tue, 25 Oct 2022 11:55:56 +0000 (13:55 +0200)]
docs: nfs -> NFS

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: spell ATI codenames in allcaps
Erik Faye-Lund [Tue, 25 Oct 2022 11:45:55 +0000 (13:45 +0200)]
docs: spell ATI codenames in allcaps

This seems to be the official spelling from ATI/AMD as well.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: nVidia -> NVIDIA
Erik Faye-Lund [Tue, 25 Oct 2022 11:45:02 +0000 (13:45 +0200)]
docs: nVidia -> NVIDIA

While we're at it, also spell the code-names in allcaps, like NVIDIA
does. One exception is Fermi, which is spelled like a proper noun.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: gitlab -> GitLab
Erik Faye-Lund [Tue, 25 Oct 2022 11:42:03 +0000 (13:42 +0200)]
docs: gitlab -> GitLab

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: Android.mk -> ndk-build
Erik Faye-Lund [Wed, 19 Oct 2022 09:05:02 +0000 (11:05 +0200)]
docs: Android.mk -> ndk-build

Android.mk is the name of the build-files, but ndk-build is the tool that
builds it.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: link to replacement forum
Erik Faye-Lund [Tue, 18 Oct 2022 15:33:43 +0000 (17:33 +0200)]
docs: link to replacement forum

This news forum no longer exists, and have been migrated to the Khronos
Community. Link there instead.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: add links to usenet groups
Erik Faye-Lund [Tue, 18 Oct 2022 15:32:32 +0000 (17:32 +0200)]
docs: add links to usenet groups

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: add missing link to mesa3d.org
Erik Faye-Lund [Wed, 19 Oct 2022 10:08:20 +0000 (12:08 +0200)]
docs: add missing link to mesa3d.org

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: clean up labels
Erik Faye-Lund [Wed, 19 Oct 2022 08:28:29 +0000 (10:28 +0200)]
docs: clean up labels

This updates the documentation of the labels to match with our actual
labels.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: name correct driver
Erik Faye-Lund [Tue, 25 Oct 2022 10:14:45 +0000 (12:14 +0200)]
docs: name correct driver

The two different swrast drivers we have at the moment are called
LLVMpipe and Softpipe. Let's name the latter instead of the generic
SWRast term that we use to cover *either* of the two.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: do not mention classic swrast
Erik Faye-Lund [Mon, 24 Oct 2022 13:42:20 +0000 (15:42 +0200)]
docs: do not mention classic swrast

It's been removed a while back, no need to talk about it anymore.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: remove non-existent directory
Erik Faye-Lund [Tue, 25 Oct 2022 09:37:11 +0000 (11:37 +0200)]
docs: remove non-existent directory

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: Adreno aXXX -> Adreno XXX
Erik Faye-Lund [Tue, 25 Oct 2022 09:42:42 +0000 (11:42 +0200)]
docs: Adreno aXXX -> Adreno XXX

The names of these are "Adreno XXX" or "aXXX", not "Adreno aXXX".

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: xml -> XML
Erik Faye-Lund [Tue, 25 Oct 2022 10:08:35 +0000 (12:08 +0200)]
docs: xml -> XML

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: yml -> YAML
Erik Faye-Lund [Tue, 25 Oct 2022 09:55:51 +0000 (11:55 +0200)]
docs: yml -> YAML

The name of the file-format is YAML, yml is the extension.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: swr -> OpenSWR
Erik Faye-Lund [Mon, 24 Oct 2022 15:26:53 +0000 (17:26 +0200)]
docs: swr -> OpenSWR

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: ini -> INI
Erik Faye-Lund [Mon, 24 Oct 2022 13:06:01 +0000 (15:06 +0200)]
docs: ini -> INI

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: piglit -> Piglit
Erik Faye-Lund [Tue, 25 Oct 2022 11:15:14 +0000 (13:15 +0200)]
docs: piglit -> Piglit

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: panfrost -> Panfrost
Erik Faye-Lund [Tue, 25 Oct 2022 10:34:06 +0000 (12:34 +0200)]
docs: panfrost -> Panfrost

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: softpipe -> Softpipe
Erik Faye-Lund [Tue, 25 Oct 2022 10:27:47 +0000 (12:27 +0200)]
docs: softpipe -> Softpipe

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: llvmpipe -> LLVMpipe
Erik Faye-Lund [Thu, 20 Oct 2022 09:45:29 +0000 (11:45 +0200)]
docs: llvmpipe -> LLVMpipe

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: freedreno -> Freedreno
Erik Faye-Lund [Thu, 20 Oct 2022 09:28:39 +0000 (11:28 +0200)]
docs: freedreno -> Freedreno

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: de-nominate -> denominate
Erik Faye-Lund [Tue, 25 Oct 2022 11:12:08 +0000 (13:12 +0200)]
docs: de-nominate -> denominate

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: de-duplicated -> deduplicated
Erik Faye-Lund [Tue, 25 Oct 2022 10:12:23 +0000 (12:12 +0200)]
docs: de-duplicated -> deduplicated

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: spell out "transform and lighting"
Erik Faye-Lund [Mon, 24 Oct 2022 13:11:47 +0000 (15:11 +0200)]
docs: spell out "transform and lighting"

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agodocs: spell out "distribution"
Erik Faye-Lund [Thu, 20 Oct 2022 09:30:43 +0000 (11:30 +0200)]
docs: spell out "distribution"

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19297>

20 months agoanv: program 3DSTATE_MESH_DISTRIB with the recommended values
Marcin Ślusarz [Fri, 28 Oct 2022 15:03:30 +0000 (17:03 +0200)]
anv: program 3DSTATE_MESH_DISTRIB with the recommended values

It improves performance of vk_meshlet_cadscene on A770.

Fixes: f083df87108 ("anv: update task/mesh distribution with the recommended values")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19412>

20 months agoanv: set 3DSTATE_[MESH|TASK]_CONTROL.MaximumNumberofThreadGroups
Marcin Ślusarz [Thu, 27 Oct 2022 07:50:51 +0000 (09:50 +0200)]
anv: set 3DSTATE_[MESH|TASK]_CONTROL.MaximumNumberofThreadGroups

Documentation is worded in a confusing way, which may be understood that
we don't have to set this field to get good results.

MESH part of this commit improves performance of vk_meshlet_cadscene
by a factor of 2 on A380.

Fixes: ef04caea9b8 ("anv: Implement Mesh Shading pipeline")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19412>

20 months agointel/genxml: fix width of 3DSTATE_TASK_CONTROL.MaximumNumberofThreadGroups
Marcin Ślusarz [Thu, 27 Oct 2022 08:05:17 +0000 (10:05 +0200)]
intel/genxml: fix width of 3DSTATE_TASK_CONTROL.MaximumNumberofThreadGroups

Fixes: 3567d47f3e7 ("intel/genxml: Inline the BODY structs into the instructions")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19412>

20 months agoutils: Merge util/debug.* into util/u_debug.* and remove util/debug.*
Illia Abernikhin [Tue, 13 Sep 2022 09:49:56 +0000 (12:49 +0300)]
utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*

Rename env_var_as_unsigned() -> debug_get_num_option(), because duplicate
Rename env_var_as_bool() -> debug_get_bool_option(), because duplicate

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

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19336>

20 months agoutils: Move functions from debug.* to u_debug.*
Illia Abernikhin [Mon, 31 Oct 2022 21:59:26 +0000 (05:59 +0800)]
utils: Move functions from debug.* to u_debug.*

Add unit tests for debug_get_bool_option and debug_get_num_option
Merge env_var_as_boolean and debug_get_bool_option and implement
 env_var_as_boolean with debug_get_bool_option in a stricter side.
Merge env_var_as_unsigned and debug_get_num_option and implement
 env_var_as_unsigned with debug_get_num_option in a stricter side.
Move debug_control, parse_debug_string, parse_enable_string,
 comma_separated_list_contains from debug.* to u_debug.*

Main changes:
os_get_option() is used instead of getenv() for env_var_as_boolean
 and env_var_as_unsigned;
also debug_get_bool_option() has logic like "true" always if not "false";
env_var_as_boolean() now uses different logic:
 if env variable is neither "true" nor "false" returns the default value,
 we left the second one; but if you want the behavior to be the same as in
 the old version of debug_get_bool_option() use dfault=true

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19336>

20 months agocrocus: set clear_buffer = u_default_clear_buffer
Thomas Debesse [Wed, 5 Oct 2022 08:33:34 +0000 (10:33 +0200)]
crocus: set clear_buffer = u_default_clear_buffer

This is required when crocus is enabled in rusticl,
the lack of it contributes to this error:

thread '<unnamed>' panicked at 'Context missing features. This should never happen!', ../src/gallium/frontends/rusticl/mesa/pipe/context.rs:44:13

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19001>

20 months agogallium/clover: pass -opaque-pointers to Clang on LLVM 15 and 16
Thomas Debesse [Tue, 25 Oct 2022 05:18:16 +0000 (07:18 +0200)]
gallium/clover: pass -opaque-pointers to Clang on LLVM 15 and 16

This does the exact opposite of 06e96074 from !16129.

Before LLVM commit 702d5de4 opaque pointers were supported but not enabled
by default when building LLVM. They were made default in commit 702d5de4.
LLVM commit d69e9f9d introduced -opaque-pointers/-no-opaque-pointers cc1
options to enable or disable them whatever the LLVM default is.

Those two commits follow llvmorg-15-init and precede llvmorg-15.0.0-rc1 tags.

Since LLVM commit d785a8ea, the CLANG_ENABLE_OPAQUE_POINTERS build option of
LLVM is removed, meaning there is no way to build LLVM with opaque pointers
enabled by default.
It was said at the time it was still possible to explicitly disable opaque
pointers via cc1 -no-opaque-pointers option, but it is known a later commit
broke backward compatibility provided by -no-opaque-pointers as verified with
arbitrary commit d7d586e5, so there is no way to use opaque pointers starting
with LLVM 16.

Those two commits follow llvmorg-16-init and precede llvmorg-16.0.0-rc1 tags.

Since Mesa commit 977dbfc9 opaque pointers are properly implemented in Clover
and used.

If we don't pass -opaque-pointers to Clang on LLVM versions supporting opaque
pointers but disabling them by default, there will be an API mismatch between
Mesa and LLVM and Clover will not work.

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19290>

20 months agoRevert "gallium/clover: pass -no-opaque-pointers to Clang", opaque pointers are now...
Thomas Debesse [Tue, 25 Oct 2022 03:20:29 +0000 (05:20 +0200)]
Revert "gallium/clover: pass -no-opaque-pointers to Clang", opaque pointers are now implemented

This reverts commit 06e9607478b780c9bcc6e08d69cfbe9020b4602c from !16129.

Clover passed -no-opaque-pointers option to Clang to workaround the fact
the Clover code was not ported to opaque pointers yet.

Opaque pointers are now implemented thanks to !19103 so passing this
option to tell Clang to not do opaque pointers while Clover does
is actually breaking Clover.

Here is an example of what happens when using opaque pointers while
passing -no-opaque-pointers at the same time:

  fatal error: cannot open file 'hawaii-amdgcn-mesa-mesa3d.bc':
   Opaque pointers are only supported in -opaque-pointers mode

This fixes one of the last remaining bits to fully support opaque pointers
in Mesa as referenced in #7468, this is the last remaining bit to fully support
opaque points in Clover.

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19290>

20 months agopanfrost: Don't use nir_variable in the compilers
Alyssa Rosenzweig [Mon, 16 May 2022 17:40:51 +0000 (13:40 -0400)]
panfrost: Don't use nir_variable in the compilers

More future proof, simpler, and works with early I/O lowering.

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

20 months agopan/bi: Don't lower outputs for compute
Alyssa Rosenzweig [Sun, 16 Oct 2022 01:38:46 +0000 (21:38 -0400)]
pan/bi: Don't lower outputs for compute

Useless.

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

20 months agonir: Drop infer_non_readable option for nir_opt_access()
Kenneth Graunke [Wed, 19 Oct 2022 11:19:18 +0000 (04:19 -0700)]
nir: Drop infer_non_readable option for nir_opt_access()

Everybody sets it to true now, and the only reason for the option to
exist was to work around a bug that's now been fixed.

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

20 months agost/mesa: Let nir_opt_access() infer non-readable
Kenneth Graunke [Wed, 19 Oct 2022 10:43:51 +0000 (03:43 -0700)]
st/mesa: Let nir_opt_access() infer non-readable

In issue #3278, Danylo noted that nir_opt_access() could desynchronize
the prog->sh.ImageAccess[] and prog->sh.BindlessImage[].access fields,
which are filled out as part of uniform linking, prior to running this
optimization pass.  Those fields are used to fill out pipe_image_view's
shader_access field, which is used by a lot of drivers these days.

There's an easy solution to this issue however: we can simply call the
pass prior to linking, a few lines earlier.

This lets us infer that images are non-readable, which may let drivers
do additional optimizations.

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

20 months agonir/opt_algebraic: Fuse c - a * b to FMA
Alyssa Rosenzweig [Wed, 26 Oct 2022 02:29:31 +0000 (22:29 -0400)]
nir/opt_algebraic: Fuse c - a * b to FMA

Algebraically it is clear that

   -(a * b) + c = (-a) * b + c = fma(-a, b, c)

But this is not clear from the NIR

   ('fadd', ('fneg', ('fmul', a, b)), c)

Add rules to handle this case specially. Note we don't necessarily want
to  solve this by pushing fneg into fmul, because the rule opt_algebraic
(not the late part where FMA fusing happens) specifically pulls fneg out
of fmul to push fneg up multiplication chains.

Noticed in the big glmark2 "terrain" shader, which has a cycle count
reduced by 22% on Mali-G57 thanks to having this pattern a ton and being
FMA bound.

BEFORE: 1249 inst, 16.015625 cycles, 16.015625 fma, ... 632 quadwords
AFTER: 997 inst, 12.437500 cycles, .... 504 quadwords

Results on the same shader on AGX are also quite dramatic:

BEFORE: 1294 inst, 8600 bytes, 50 halfregs, ...
AFTER: 1154 inst, 8040 bytes, 50 halfregs, ...

Similar rules apply for fabs.

v2: Use a loop over the bit sizes (suggested by Emma).

shader-db on Valhall (open + small subset of closed), results on Bifrost
are similar:

total instructions in shared programs: 167975 -> 164970 (-1.79%)
instructions in affected programs: 92642 -> 89637 (-3.24%)
helped: 492
HURT: 25
helped stats (abs) min: 1.0 max: 252.0 x̄: 6.25 x̃: 3
helped stats (rel) min: 0.30% max: 20.18% x̄: 3.21% x̃: 2.91%
HURT stats (abs)   min: 1.0 max: 5.0 x̄: 2.80 x̃: 3
HURT stats (rel)   min: 0.46% max: 9.09% x̄: 3.89% x̃: 3.37%
95% mean confidence interval for instructions value: -6.95 -4.68
95% mean confidence interval for instructions %-change: -3.08% -2.65%
Instructions are helped.

total cycles in shared programs: 10556.89 -> 10538.98 (-0.17%)
cycles in affected programs: 265.56 -> 247.66 (-6.74%)
helped: 88
HURT: 2
helped stats (abs) min: 0.015625 max: 3.578125 x̄: 0.20 x̃: 0
helped stats (rel) min: 0.65% max: 22.34% x̄: 5.65% x̃: 4.25%
HURT stats (abs)   min: 0.0625 max: 0.0625 x̄: 0.06 x̃: 0
HURT stats (rel)   min: 8.33% max: 12.50% x̄: 10.42% x̃: 10.42%
95% mean confidence interval for cycles value: -0.28 -0.12
95% mean confidence interval for cycles %-change: -6.30% -4.30%
Cycles are helped.

total fma in shared programs: 1582.42 -> 1535.06 (-2.99%)
fma in affected programs: 871.58 -> 824.22 (-5.43%)
helped: 502
HURT: 9
helped stats (abs) min: 0.015625 max: 3.578125 x̄: 0.09 x̃: 0
helped stats (rel) min: 0.60% max: 25.00% x̄: 5.46% x̃: 4.82%
HURT stats (abs)   min: 0.015625 max: 0.0625 x̄: 0.03 x̃: 0
HURT stats (rel)   min: 4.35% max: 12.50% x̄: 6.22% x̃: 4.35%
95% mean confidence interval for fma value: -0.11 -0.08
95% mean confidence interval for fma %-change: -5.58% -4.93%
Fma are helped.

total cvt in shared programs: 665.55 -> 665.95 (0.06%)
cvt in affected programs: 61.72 -> 62.12 (0.66%)
helped: 33
HURT: 43
helped stats (abs) min: 0.015625 max: 0.359375 x̄: 0.04 x̃: 0
helped stats (rel) min: 1.01% max: 25.00% x̄: 6.68% x̃: 4.35%
HURT stats (abs)   min: 0.015625 max: 0.109375 x̄: 0.04 x̃: 0
HURT stats (rel)   min: 0.78% max: 38.46% x̄: 10.85% x̃: 6.90%
95% mean confidence interval for cvt value: -0.01 0.02
95% mean confidence interval for cvt %-change: 0.23% 6.24%
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 93376 -> 91736 (-1.76%)
quadwords in affected programs: 25376 -> 23736 (-6.46%)
helped: 169
HURT: 1
helped stats (abs) min: 8.0 max: 128.0 x̄: 9.75 x̃: 8
helped stats (rel) min: 1.52% max: 33.33% x̄: 8.35% x̃: 8.00%
HURT stats (abs)   min: 8.0 max: 8.0 x̄: 8.00 x̃: 8
HURT stats (rel)   min: 25.00% max: 25.00% x̄: 25.00% x̃: 25.00%
95% mean confidence interval for quadwords value: -11.18 -8.11
95% mean confidence interval for quadwords %-change: -8.95% -7.36%
Quadwords are helped.

total threads in shared programs: 4697 -> 4701 (0.09%)
threads in affected programs: 4 -> 8 (100.00%)
helped: 4
HURT: 0
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for threads value: 1.00 1.00
95% mean confidence interval for threads %-change: 100.00% 100.00%
Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Ol<C5><A1><C3><A1>k <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19312>

20 months agogallium: update docs about PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF.
Emma Anholt [Mon, 16 May 2022 23:16:03 +0000 (16:16 -0700)]
gallium: update docs about PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF.

We can provide better guidance on when to (un-)set this given that
everyone's on NIR now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16539>

20 months agoiris: Disable GLSL lower_const_arrays_to_uniforms.
Emma Anholt [Mon, 16 May 2022 23:13:56 +0000 (16:13 -0700)]
iris: Disable GLSL lower_const_arrays_to_uniforms.

We want to use nir_opt_large_constants() instead (which is already
enabled), since that doesn't involve uploading the large immediate data
array again on each CB0 update.  The downside is a bit of addressing math,
since constant_data is accessed using 64-bit global addresses.

The shader-db results are a bit all over:

All Iris driver platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19910185 -> 19913931 (0.02%)
instructions in affected programs: 225374 -> 229120 (1.66%)
helped: 3 / HURT: 348

total cycles in shared programs: 856004856 -> 855016808 (-0.12%)
cycles in affected programs: 22832422 -> 21844374 (-4.33%)
helped: 277 / HURT: 101

total spills in shared programs: 6580 -> 6609 (0.44%)
spills in affected programs: 516 -> 545 (5.62%)
helped: 1 / HURT: 4

total fills in shared programs: 8235 -> 8267 (0.39%)
fills in affected programs: 1022 -> 1054 (3.13%)
helped: 1 / HURT: 3

total sends in shared programs: 1039347 -> 1039095 (-0.02%)
sends in affected programs: 16367 -> 16115 (-1.54%)
helped: 251 / HURT: 0

LOST:   5
GAINED: 2

LOST:
- 3 SIMD16 fragment shaders (Superposition)
- 2 SIMD16 compute shaders (Aztec Ruins)

GAINED:
- fake news... 2 SIMD8 compute shaders that replace the lost SIMD16
  compute shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16539>

20 months agointel/compiler: Run nir_opt_large_constants before scalarizing consts
Kenneth Graunke [Tue, 24 May 2022 08:36:50 +0000 (01:36 -0700)]
intel/compiler: Run nir_opt_large_constants before scalarizing consts

nir_opt_large_constants balks at seeing a store_deref of a variable
where the source is a vecN operation of multiple load_consts, and thinks
that isn't a constant, so it should not bother promoting it.

Unfortunately, we were running nir_lower_load_const_to_scalar before
nir_opt_large_constants, so this prevented a ton of constant promotion.

This commit /used to help/ some shaders in shader-db. Presumably since
!16770 landed, those shaders were already helped.  Currently ther are
no shader-db changes on any Intel platform.

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141998227 -> 141421756 (-0.4%)
Instructions helped: 12515
Instructions hurt: 237

SENDs in all programs: 7437925 -> 7468033 (+0.4%)
SENDs hurt: 12806

Cycles in all programs: 9161655753 -> 9132869800 (-0.3%)
Cycles helped: 10163
Cycles hurt: 2637

Spills in all programs: 19977 -> 18678 (-6.5%)
Spills helped: 384
Spills hurt: 40

Fills in all programs: 32863 -> 31396 (-4.5%)
Fills helped: 385
Fills hurt: 42

Lost: 1

Lots of Shadow of the Tomb Raider fragment shaders and Batman Arkham
Origins vertex shaders were hurt for SENDs in this commit.  A couple
Aztec Ruins compute shaders and Spaceship shaders (multiple stages)
were also hurt.

All of the shaders hurt for spills or fills were Spaceship compute
shaders.  Nearly all of the shaders helped were Shadow of the Tomb
Raider fragmenet shaders.  One Spaceship shader was reall, REALLY helped:

Spills helped fossils/fossil-db/Spaceship.run.9f90a2a226fcc57f.1.foz/0b507d3abe2e3c28/compute: 321 -> 13 (-96.0%)
Fills helped fossils/fossil-db/Spaceship.run.9f90a2a226fcc57f.1.foz/0b507d3abe2e3c28/compute: 279 -> 21 (-92.5%)

Overall this seems like an improvement, but we may want to actually
run these few benchmarks before landing.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16539>

20 months agoiris: Use nir_intrinsic_load_global_constant for large constants
Kenneth Graunke [Tue, 24 May 2022 08:59:42 +0000 (01:59 -0700)]
iris: Use nir_intrinsic_load_global_constant for large constants

We were using the old load_global intrinsic still, which can't be
reordered, limiting optimization opportunities.  We know the data here
is constant, so we can use the newer load_global_constant intrinsic.

This doesn't seem to have any impact on shader-db or fossil-db on any
Intel platform.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16539>

20 months agorusticl: Fix the invalid memory migration flags check.
Emma Anholt [Tue, 1 Nov 2022 20:01:16 +0000 (13:01 -0700)]
rusticl: Fix the invalid memory migration flags check.

We want to know if you have any invalid flags set, not if you don't have
any valid flags set.

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

20 months agofreedreno/pps: loop countables by references
Chia-I Wu [Mon, 31 Oct 2022 21:27:08 +0000 (14:27 -0700)]
freedreno/pps: loop countables by references

Mainly to get rid of alloc/free in collect_countables.  Sampling at 1ms,
perf becomes

   - 22.75% pps::FreedrenoDriver::collect_countables
           22.59% pps::FreedrenoDriver::Countable::collect

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

20 months agofreedreno/pps: use 64-bit reads when possible
Chia-I Wu [Fri, 28 Oct 2022 17:51:53 +0000 (10:51 -0700)]
freedreno/pps: use 64-bit reads when possible

It is always possible on a5xx+ and allows Countable::collect to do 1 ldr rather
than 2.

Sampling at 1ms, perf goes from

   - 34.44% pps::FreedrenoDriver::collect_countables
        25.36% pps::FreedrenoDriver::Countable::collect
        3.92% cfree
      + 2.28% operator new

to

   - 29.60% pps::FreedrenoDriver::collect_countables
        20.70% pps::FreedrenoDriver::Countable::collect
        4.01% cfree
      + 2.35% operator new
        1.09% memcpy

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

20 months agoradv: move GDS counters after reserved GDS offsets for streamout
Samuel Pitoiset [Tue, 1 Nov 2022 15:48:18 +0000 (16:48 +0100)]
radv: move GDS counters after reserved GDS offsets for streamout

Otherwise, queries might return invalid data because they used
the same offsets as NGG streamout.

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

20 months agoradv: use defines instead of magic values for GDS counters offset
Samuel Pitoiset [Tue, 1 Nov 2022 15:45:22 +0000 (16:45 +0100)]
radv: use defines instead of magic values for GDS counters offset

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

20 months agoaco: Use s_pack_ll_b32_b16 for scalar zero extend.
Georg Lehmann [Mon, 31 Oct 2022 10:07:55 +0000 (11:07 +0100)]
aco: Use s_pack_ll_b32_b16 for scalar zero extend.

Foz-DB Navi21:
Totals from 2403 (1.78% of 134913) affected shaders:
CodeSize: 25329156 -> 25311244 (-0.07%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19413>

20 months agoradv/amdgpu: add a kernel GDS management workaround for -ENOMEM
Samuel Pitoiset [Tue, 1 Nov 2022 14:28:42 +0000 (15:28 +0100)]
radv/amdgpu: add a kernel GDS management workaround for -ENOMEM

The kernel keeps returning -ENOMEM if multiple processes allocate GDS,
this always happen while running VKCTS. This solution is loosely based
on RadeonSI, except that it includes a timeout of 1s to exit the loop.

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

20 months agoradv: assign IO var locations for VS/TES with NGG streamout
Samuel Pitoiset [Mon, 31 Oct 2022 09:27:28 +0000 (10:27 +0100)]
radv: assign IO var locations for VS/TES with NGG streamout

NGG streamout lowering requires nir_shader::num_outputs to be set to
the total number of outputs in order to compute the pervertex LDS size
correctly. This is wasting LDS memory but it's currently the only viable
solution.

This fixes a bunch of dEQP-VK.transform_feedback.* failures.

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

20 months agoac/nir: stop using nir_gather_xfb_info_from_intrinsics
Samuel Pitoiset [Tue, 1 Nov 2022 11:06:57 +0000 (12:06 +0100)]
ac/nir: stop using nir_gather_xfb_info_from_intrinsics

Given that we no longer need the slot_to_register mapping, it's
useless to use this function.

This also fixes a bunch of failures with
dEQP-VK.transform_feedback.*omit_write* on RADV because in Vulkan
the spec requires XFB query counters to be incremented even if XFB
outputs aren't written to.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19437>

20 months agonouveau/codegen: Support bindless texture queries
Jason Ekstrand [Tue, 1 Nov 2022 03:49:00 +0000 (22:49 -0500)]
nouveau/codegen: Support bindless texture queries

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

20 months agonir/types: Add some asserts to glsl_get_struct_field()
Jason Ekstrand [Tue, 1 Nov 2022 03:32:19 +0000 (22:32 -0500)]
nir/types: Add some asserts to glsl_get_struct_field()

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

20 months agofrontends/va: fixed an av1 dec image corruption.
Ruijing Dong [Tue, 25 Oct 2022 19:14:21 +0000 (15:14 -0400)]
frontends/va: fixed an av1 dec image corruption.

[problem]
When decoding an av1 bitstream, it shows image corruption
in the middle of the bitstream around key frames.

[analysis]
in av1_spec.pdf page 38/669, there is a sentence below:

if ( frame_type == KEY_FRAME && show_frame ) {
   for ( i = 0; i < NUM_REF_FRAMES; i++) {
      RefValid[ i ] = 0
      ......
   }
   ......
}

This shows that the condition of invalidating current
DPB frames should be the coming frame_type is KEY_FRAME plus
show_frame is equal to 1. Otherwise, some of the frames
in sequence after KEY_FRAME still refer to the reference frames
before KEY_FRAME, and if these before KEY_FRAME reference
frames were invalidated, these frames could not find their
reference frames, and it could cause image corruption.

[solution]
Add condition of show_frame, with the corresponding fix
in ffmpeg, we cannot see this issue any longer.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19386>

20 months agor600/sfn: remove load_uniform handling
Gert Wollny [Mon, 31 Oct 2022 16:04:47 +0000 (17:04 +0100)]
r600/sfn: remove load_uniform handling

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

20 months agor600/sfn: lower uniforms to UBOs
Gert Wollny [Mon, 31 Oct 2022 14:08:14 +0000 (15:08 +0100)]
r600/sfn: lower uniforms to UBOs

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

20 months agoclover: implement CLOVER_DEVICE_TYPE like RUSTICL_DEVICE_TYPE
Thomas Debesse [Mon, 3 Oct 2022 02:12:21 +0000 (04:12 +0200)]
clover: implement CLOVER_DEVICE_TYPE like RUSTICL_DEVICE_TYPE

Allows to make Clover devices appearing as cpu, gpu or accelerator
by setting the CLOVER_DEVICE_TYPE environment variable like
the RUSTICL_DEVICE_TYPE environment variable does.

For example it can make the CPU llvmpipe device appear as GPU or GPU devices
appear as CPU. This is useful for testing OpenCL with applications that may
use different code path given the OpenCL device is a CPU or a GPU.

The initial motivation for RUSTICL_DEVICE_TYPE implementation was to test
rusticl with llvmipe on applications ignoring CPU devices.

This brings Clover on par with rusticl on that topic.

CL_DEVICE_TYPE_CUSTOM isn't implemented or applications may crash when
iterating devices because CL_DEVICE_TYPE_CUSTOM is OpenCL 1.2 and Clover
is OpenCL 1.1.

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18931>

20 months agoaco/gfx11: fix FS input loads in quad-divergent control flow
Rhys Perry [Wed, 26 Oct 2022 20:11:31 +0000 (21:11 +0100)]
aco/gfx11: fix FS input loads in quad-divergent control flow

This is not ideal and it would be great to somehow make it better some
day.

fossil-db (gfx1100):
Totals from 5208 (3.86% of 135032) affected shaders:
MaxWaves: 127058 -> 126962 (-0.08%); split: +0.01%, -0.09%
Instrs: 3983440 -> 4072736 (+2.24%); split: -0.00%, +2.24%
CodeSize: 21872468 -> 22230852 (+1.64%); split: -0.00%, +1.64%
VGPRs: 206688 -> 206984 (+0.14%); split: -0.05%, +0.20%
Latency: 37447383 -> 37491197 (+0.12%); split: -0.05%, +0.17%
InvThroughput: 6421955 -> 6422348 (+0.01%); split: -0.03%, +0.03%
VClause: 71579 -> 71545 (-0.05%); split: -0.09%, +0.04%
SClause: 148289 -> 147146 (-0.77%); split: -0.84%, +0.07%
Copies: 259011 -> 258084 (-0.36%); split: -0.61%, +0.25%
Branches: 101366 -> 101314 (-0.05%); split: -0.10%, +0.05%
PreSGPRs: 223482 -> 223460 (-0.01%); split: -0.21%, +0.20%
PreVGPRs: 184448 -> 184744 (+0.16%)

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

20 months agoaco/gfx11: perform FS input loads in WQM
Rhys Perry [Wed, 26 Oct 2022 20:13:15 +0000 (21:13 +0100)]
aco/gfx11: perform FS input loads in WQM

fossil-db (gfx1100):
Totals from 48184 (35.68% of 135032) affected shaders:
MaxWaves: 1131876 -> 1131960 (+0.01%); split: +0.05%, -0.04%
Instrs: 36755466 -> 36782290 (+0.07%); split: -0.04%, +0.11%
CodeSize: 200812068 -> 200915348 (+0.05%); split: -0.04%, +0.09%
VGPRs: 2163980 -> 2163828 (-0.01%); split: -0.15%, +0.14%
Latency: 484174459 -> 484341018 (+0.03%); split: -0.06%, +0.09%
InvThroughput: 87941284 -> 87944874 (+0.00%); split: -0.04%, +0.04%
VClause: 652984 -> 653085 (+0.02%); split: -0.09%, +0.10%
SClause: 1510995 -> 1528832 (+1.18%); split: -0.40%, +1.58%
Copies: 1997689 -> 2001857 (+0.21%); split: -0.49%, +0.69%
Branches: 676629 -> 676584 (-0.01%); split: -0.02%, +0.01%
PreSGPRs: 2033070 -> 2036725 (+0.18%)
PreVGPRs: 1903922 -> 1903897 (-0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 3730be9873d ("aco: mostly implement FS input loads on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19370>

20 months agoaco: fix typo in branch lowering
Rhys Perry [Thu, 27 Oct 2022 19:32:59 +0000 (20:32 +0100)]
aco: fix typo in branch lowering

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: aadb7aef019 ("aco: add VINTERP instruction format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19370>

20 months agoradv: enable VK_EXT_transform_feedback with NGG streamout on GFX11
Samuel Pitoiset [Thu, 27 Oct 2022 15:11:08 +0000 (17:11 +0200)]
radv: enable VK_EXT_transform_feedback with NGG streamout on GFX11

Untested but it mostly work on GFX10.3.

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

20 months agoradv: allow to enable NGG streamout with RADV_PERFTEST=ngg_streamout
Samuel Pitoiset [Tue, 1 Nov 2022 10:20:58 +0000 (11:20 +0100)]
radv: allow to enable NGG streamout with RADV_PERFTEST=ngg_streamout

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

20 months agoradv: enable all possible features with NGG streamout
Samuel Pitoiset [Thu, 27 Oct 2022 15:10:35 +0000 (17:10 +0200)]
radv: enable all possible features with NGG streamout

Tested by forcing NGG streamout on GFX10.3.

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

20 months agoradv: set the correct buffer size for NGG streamout
Samuel Pitoiset [Tue, 1 Nov 2022 08:11:17 +0000 (09:11 +0100)]
radv: set the correct buffer size for NGG streamout

If the size is passed through CmdBindTransformFeedback() uses that.

This partially fixes dEQP-VK.transform_feedback.simple.multiquery_1
by reporting the correct number of primitives written (the computation
is based on the buffer size). There is still a bug around GDS offsets
that will be fixed later.

Tested on GFX10.3 by forcing NGG streamout.

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

20 months agor600/sfn: Handle load_workgroup_size
Gert Wollny [Sun, 30 Oct 2022 09:20:13 +0000 (10:20 +0100)]
r600/sfn: Handle load_workgroup_size

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
   r600/sfn: rewrite NIR backend

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

20 months agoradv: fix primitives generated query with NGG only
Samuel Pitoiset [Mon, 31 Oct 2022 12:53:05 +0000 (13:53 +0100)]
radv: fix primitives generated query with NGG only

According to the AMD registers database, SAMPLE_STREAMOUTSTATS no
longer exists on GFX11. This fixes primitives generated query if only
the NGG path is used. Tested on GFX10.3 by forcing NGG everywhere.

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

20 months agoradv: suspend/resume primitives generated query separately for legacy/NGG
Samuel Pitoiset [Mon, 31 Oct 2022 12:51:00 +0000 (13:51 +0100)]
radv: suspend/resume primitives generated query separately for legacy/NGG

With NGG only, only the GDS query counter will be incremented.

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

20 months agoradv: use 32-bit GDS counters for primitives generated query with NGG
Samuel Pitoiset [Mon, 31 Oct 2022 12:35:26 +0000 (13:35 +0100)]
radv: use 32-bit GDS counters for primitives generated query with NGG

Do not need to use 64-bit operations.

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

20 months agoradv: reword an incorrect comment about primitives generated query
Samuel Pitoiset [Mon, 31 Oct 2022 12:29:48 +0000 (13:29 +0100)]
radv: reword an incorrect comment about primitives generated query

This is not the XFB counter.

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

20 months agomeson: simplified meson for enabling ray-tracing on Intel
Luis Felipe Strano Moraes [Wed, 26 Oct 2022 22:08:22 +0000 (15:08 -0700)]
meson: simplified meson for enabling ray-tracing on Intel

Removed warning about deprecated usage that was not necessary.
Also added information on whether support is enabled or not to the
summary so it is easier to check when building.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19332>

20 months agogallium: Default to PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Alyssa Rosenzweig [Sat, 29 Oct 2022 02:46:19 +0000 (22:46 -0400)]
gallium: Default to PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

Supported in all hardware and software drivers. Only that don't support
are virgl and svga, depending on host capabilities. I don't think
there's anything to be done there. This does give fewer places to screw
up the CAPs, though, because everyone wants ARB_buffer_storage.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Ol<C5><A1><C3><A1>k <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19392>

20 months agoetnaviv: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Alyssa Rosenzweig [Sat, 29 Oct 2022 02:40:58 +0000 (22:40 -0400)]
etnaviv: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

This CAP only concerns mapping of buffers, not textures. For buffers,
etnaviv does not seem to use any staging resources. In neither case does
etnaviv use explicit syncs or flushes, so persistent/coherent mapping
should come as the implicit default and the cap should be almost free.

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

20 months agoi915g: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Alyssa Rosenzweig [Sat, 29 Oct 2022 02:39:44 +0000 (22:39 -0400)]
i915g: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

Currently buffer_map returns the raw pointer, there is no syncing or
flushing or staging buffers or resource shadowing anywhere. That means
if the driver is currently correct, it is implementing persistent and
coherent behaviour already, so the CAP is trivial.

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

20 months agosoftpipe: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Alyssa Rosenzweig [Sat, 29 Oct 2022 02:36:52 +0000 (22:36 -0400)]
softpipe: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

It's a software rasterizer, all buffers are necessarily persistent and
coherent. There are no staging buffers in transfer_map and no sync/flush
operations, so this is trivial.

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

20 months agoCODEOWNERS: remove rajnesh-kanwal as an Imagination maintainer
Frank Binns [Tue, 11 Oct 2022 07:27:28 +0000 (08:27 +0100)]
CODEOWNERS: remove rajnesh-kanwal as an Imagination maintainer

Rajnesh has moved onto other non-graphics things.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19135>

20 months agoiris: Reduce use of RHWO optimization (Wa_1508744258)
Nanley Chery [Mon, 10 Oct 2022 21:01:36 +0000 (14:01 -0700)]
iris: Reduce use of RHWO optimization (Wa_1508744258)

Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces. MCS partial resolves are done via
software (i.e., not via a HW bit) and so are not expected to need this
workaround.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19360>

20 months agogallium/util: remove network class
António Monteiro [Sun, 30 Oct 2022 14:37:33 +0000 (14:37 +0000)]
gallium/util: remove network class

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19403>

20 months agodocs/panfrost: Document Mali-T620 support
jenneron [Mon, 31 Oct 2022 14:01:36 +0000 (14:01 +0000)]
docs/panfrost: Document Mali-T620 support

This one is already supported

Signed-off-by: Anton Bambura <jenneron@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19415>

20 months agozink: Enable mesa/st frontend shader caching.
Emma Anholt [Mon, 17 Oct 2022 18:46:52 +0000 (11:46 -0700)]
zink: Enable mesa/st frontend shader caching.

This required fixing up the disk cache to hash in stuff that was missing
(like the proper pipeline cache uuid rather than just PCI IDs, and also
zink's build ID).  Once we do that, we can just hand the frontend our disk
cache and avoid GLSL->NIR recompiles.

tu asphalt_9 trace perf +3.14859% +/- 1.36891% (n=4)

Fixes: #7513
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19124>

20 months agod3d12: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT
Jesse Natalie [Sat, 29 Oct 2022 14:53:45 +0000 (07:53 -0700)]
d3d12: Advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

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

20 months agodzn: Set factory flags before creating device
Jesse Natalie [Mon, 31 Oct 2022 16:40:45 +0000 (09:40 -0700)]
dzn: Set factory flags before creating device

I got this in d3d12 but missed it in dzn

Fixes: 74d1c72b ("dzn: Support device factories in addition to global device creation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19420>

20 months agoradv/rt: Set vars.arg in the traversal shader
Konstantin Seurer [Sun, 30 Oct 2022 14:37:04 +0000 (15:37 +0100)]
radv/rt: Set vars.arg in the traversal shader

Fixes: f4270b7 ("radv/rt: create traversal shader independent from main shader")
Closes: #7591
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19402>

20 months agoradeonsi/ci: Test piglit quick_shader profile as well
Michel Dänzer [Thu, 27 Oct 2022 15:49:35 +0000 (17:49 +0200)]
radeonsi/ci: Test piglit quick_shader profile as well

It's useful for catching regressions, e.g. it would have caught
https://gitlab.freedesktop.org/mesa/mesa/-/issues/7567 .

For the radeonsi-stoney-gl:amd64 job, we can use the "gpu" profile,
which contains quick_gl and quick_shader.

For the radeonsi-raven-piglit-gl:amd64 job, that would almost double
the runtime, and bring it dangerously close to the 30 minutes timeout.
Instead, split it up into radeonsi-raven-piglit-quick_gl:amd64 and
radeonsi-raven-piglit-quick_shader:amd64 jobs.

v2:
* Rebase, drop spec@arb_tessellation_shader@execution flakes and add
  one crash instead.

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

20 months agoradv,aco: don't use lower_to_fragment_fetch_amd on GFX11+
Rhys Perry [Tue, 25 Oct 2022 14:45:10 +0000 (15:45 +0100)]
radv,aco: don't use lower_to_fragment_fetch_amd on GFX11+

FMask doesn't exist on GFX11. Have txf_ms take the fragment_fetch_amd
path.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19375>

20 months agoradv/gfx11: don't create texop_samples_identical
Rhys Perry [Tue, 25 Oct 2022 15:00:10 +0000 (16:00 +0100)]
radv/gfx11: don't create texop_samples_identical

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19375>

20 months agoradv/gfx11: don't create fmask copy/expand pipelines
Rhys Perry [Tue, 25 Oct 2022 14:55:22 +0000 (15:55 +0100)]
radv/gfx11: don't create fmask copy/expand pipelines

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19375>

20 months agoac/nir: lower gfx11 vertex parameter exports
Rhys Perry [Tue, 11 Oct 2022 13:00:14 +0000 (14:00 +0100)]
ac/nir: lower gfx11 vertex parameter exports

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19228>

20 months agoaco: don't split swizzled store_buffer_amd on GFX9+
Rhys Perry [Wed, 19 Oct 2022 14:25:51 +0000 (15:25 +0100)]
aco: don't split swizzled store_buffer_amd on GFX9+

This isn't necessary.

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

20 months agonir,ac/nir,aco,radv: replace has_input_*_amd with more general intrinsics
Rhys Perry [Tue, 18 Oct 2022 19:52:53 +0000 (20:52 +0100)]
nir,ac/nir,aco,radv: replace has_input_*_amd with more general intrinsics

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19228>

20 months agoradv: do not unconditionally disable NGG streamout lowering in NIR
Samuel Pitoiset [Wed, 26 Oct 2022 13:10:57 +0000 (13:10 +0000)]
radv: do not unconditionally disable NGG streamout lowering in NIR

This is still always disabled because use_ngg_streamout is FALSE
but it will be turned on at some point.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19317>

20 months agoradv: lower NIR intrinsics for NGG streamout
Samuel Pitoiset [Wed, 26 Oct 2022 12:15:44 +0000 (12:15 +0000)]
radv: lower NIR intrinsics for NGG streamout

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19317>

20 months agoradv: call nir_io_add_intrinsic_xfb_info() after IO lowering
Samuel Pitoiset [Tue, 25 Oct 2022 07:47:43 +0000 (09:47 +0200)]
radv: call nir_io_add_intrinsic_xfb_info() after IO lowering

This is needed for NGG streamout which gets the XFB info directly
from intrinsics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19317>