platform/upstream/mesa.git
3 years agoradeonsi: implement inlinable uniforms
Marek Olšák [Tue, 29 Sep 2020 21:43:24 +0000 (17:43 -0400)]
radeonsi: implement inlinable uniforms

This improves performance for uber shaders.

It must be enabled using the new driconf option.

The driver compiles the specialized shaders in another thread without stalls,
same as all other optimizations.

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

3 years agoaco: Fix accidental copies, attempt two
James Park [Thu, 29 Oct 2020 18:03:07 +0000 (11:03 -0700)]
aco: Fix accidental copies, attempt two

Use auto to avoid mistyping the constness of the pair key, which
triggers implicit conversions rather than compilation errors.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7346>

3 years agointel/dev: Bump Max EU per subslice/dualsubslice
Lionel Landwerlin [Fri, 23 Oct 2020 08:40:00 +0000 (11:40 +0300)]
intel/dev: Bump Max EU per subslice/dualsubslice

This isn't a problem right now because the previous max would give the
same result when aligned to a byte (8bits).

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

3 years agoglthread: pin driver threads to the same L3 as the main thread regularly
Marek Olšák [Wed, 7 Oct 2020 11:41:41 +0000 (07:41 -0400)]
glthread: pin driver threads to the same L3 as the main thread regularly

This improves performance on my Ryzen 3900X, which has 4 L3 caches and
6 threads per L3.

The best improvement is 33% if the kernel CPU scheduler doesn't move
the main thread too often.

v2: pin only once in 128 batch flushes

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

3 years agoutil: completely rewrite and do AMD Zen L3 cache pinning correctly
Marek Olšák [Tue, 6 Oct 2020 23:05:29 +0000 (19:05 -0400)]
util: completely rewrite and do AMD Zen L3 cache pinning correctly

This queries the CPU cache topology correctly.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7054>

3 years agoutil: add util_get_current_cpu using sched_getcpu and Windows equivalent
Marek Olšák [Wed, 7 Oct 2020 11:09:01 +0000 (07:09 -0400)]
util: add util_get_current_cpu using sched_getcpu and Windows equivalent

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

3 years agoutil: add util_set_thread_affinity helpers including Windows support
Marek Olšák [Tue, 6 Oct 2020 22:44:08 +0000 (18:44 -0400)]
util: add util_set_thread_affinity helpers including Windows support

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

3 years agost/mesa: remove random L3 pinning heuristic for glthread
Marek Olšák [Wed, 7 Oct 2020 01:37:01 +0000 (21:37 -0400)]
st/mesa: remove random L3 pinning heuristic for glthread

This is not very effective. A better solution will be added to glthread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7054>

3 years agoutil: consolidate thread_get_time functions
Marek Olšák [Tue, 6 Oct 2020 22:59:31 +0000 (18:59 -0400)]
util: consolidate thread_get_time functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7054>

3 years agoutil: remove unused util_get_L3_for_pinned_thread
Marek Olšák [Tue, 6 Oct 2020 22:54:15 +0000 (18:54 -0400)]
util: remove unused util_get_L3_for_pinned_thread

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7054>

3 years agoandroid: fix libsync dependencies (v2)
Mauro Rossi [Fri, 30 Oct 2020 00:24:08 +0000 (01:24 +0100)]
android: fix libsync dependencies (v2)

(v2) Remove include from Android.common.mk
     Avoid adding libsync shared dependency in Android.common.mk
     Add libsync shared dependency where needed, for easier tracking

(v1) Fixes the following building errors:

In file included from external/mesa/src/gallium/drivers/freedreno/a3xx/fd3_query.c:27:
In file included from external/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.h:33:
In file included from external/mesa/src/gallium/drivers/freedreno/freedreno_context.h:33:
external/mesa/src/util/libsync.h:48:10: fatal error: 'android/sync.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

In file included from external/mesa/src/mesa/drivers/dri/i965/brw_sync.c:41:
external/mesa/src/util/libsync.h:48:10: fatal error: 'android/sync.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

In file included from external/mesa/src/gallium/auxiliary/util/u_tests.c:513:
external/mesa/src/util/libsync.h:48:10: fatal error: 'android/sync.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

FAILED: out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/i965_dri_intermediates/LINKED/i965_dri.so
...
external/mesa/src/mesa/drivers/dri/i965/brw_sync.c:223: error: undefined reference to 'sync_wait'
external/mesa/src/mesa/drivers/dri/i965/brw_sync.c:287: error: undefined reference to 'sync_wait'

FAILED: out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
external/mesa/src/util/libsync.h:142: error: undefined reference to 'sync_merge'
external/mesa/src/gallium/drivers/freedreno/freedreno_fence.c:94: error: undefined reference to 'sync_wait'
external/mesa/src/gallium/auxiliary/util/u_tests.c:575: error: undefined reference to 'sync_wait'

Fixes: 27b888794624 ("android: Add pre-4.7 Android kernel compatibility to our libsync header.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7306>

3 years agoglsl: add extra pp tokens workaround and enable for CoR
Timothy Arceri [Thu, 29 Oct 2020 03:19:01 +0000 (14:19 +1100)]
glsl: add extra pp tokens workaround and enable for CoR

The CTS now tests to make sure these are not allowed. However, previously
drivers (including Mesa) would allow them to exist and just issue a
warning. Some old applications such as Champions of Regnum seem to
depend on this.

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

Fixes: 43047384c331 ("glsl/glcpp: Promote "extra token at end of directive" from warning to error")

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

3 years agointel/fs: Don't emit_uniformize when getting a constant SSBO index
Caio Marcelo de Oliveira Filho [Tue, 27 Oct 2020 17:15:30 +0000 (10:15 -0700)]
intel/fs: Don't emit_uniformize when getting a constant SSBO index

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

3 years agov3d/format: use XYZ1 swizzle for three-component formats
Alejandro Piñeiro [Thu, 29 Oct 2020 10:19:18 +0000 (11:19 +0100)]
v3d/format: use XYZ1 swizzle for three-component formats

R11G11B10_FLOAT and R9G9B9E5_FLOAT are three-component formats, so we
shouldn't use 1 for the alpha component.

We don't know about any test/app getting fixed with this change, but
it is the equivalent to v3dv commit
e07c5467633431377ce4c9890f96d58cc7a77fdc. Vulkan CTS has some tests
that used that format and failed if not using XYZ1.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7365>

3 years agogallivm: zero init the temporary register storage.
Dave Airlie [Thu, 29 Oct 2020 03:06:43 +0000 (13:06 +1000)]
gallivm: zero init the temporary register storage.

Due to flow control we can end up with random values in here having
side effects.

This fixes a crash in gtk4-demo.

Fixes: 44a6b0107b37 ("gallivm: add nir->llvm translation (v2)")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7327>

3 years agoaco: handle SDWA in the optimizer
Rhys Perry [Thu, 5 Dec 2019 14:12:39 +0000 (14:12 +0000)]
aco: handle SDWA in the optimizer

Apply SGPRs/modifiers when possible and try not to break when SDWA
instructions are encountered.

No shader-db changes.

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

3 years agoaco: don't allow destination opsel for v_cvt_pknorm
Rhys Perry [Mon, 17 Aug 2020 10:36:24 +0000 (11:36 +0100)]
aco: don't allow destination opsel for v_cvt_pknorm

It doesn't make sense to do this.

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

3 years agoaco: fix combine_inverse_comparison()
Rhys Perry [Mon, 16 Dec 2019 15:35:14 +0000 (15:35 +0000)]
aco: fix combine_inverse_comparison()

fossil-db (Navi):
Totals from 16 (0.01% of 137413) affected shaders:
CodeSize: 6788 -> 6724 (-0.94%)
Instrs: 1250 -> 1234 (-1.28%)
Cycles: 4984 -> 4920 (-1.28%)

fossil-db (Polaris):
Totals from 16 (0.01% of 138881) affected shaders:
CodeSize: 7024 -> 6960 (-0.91%)
Instrs: 1337 -> 1321 (-1.20%)
Cycles: 5332 -> 5268 (-1.20%)

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

3 years agoaco: fix printing of some sdwa sels
Rhys Perry [Wed, 12 Aug 2020 13:20:56 +0000 (14:20 +0100)]
aco: fix printing of some sdwa sels

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

3 years agoaco: assert a label only uses one of the members in ssa_info's union
Rhys Perry [Wed, 12 Aug 2020 12:52:55 +0000 (13:52 +0100)]
aco: assert a label only uses one of the members in ssa_info's union

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

3 years agoaco: create s_clause on GFX10+
Rhys Perry [Mon, 13 Jul 2020 12:42:24 +0000 (13:42 +0100)]
aco: create s_clause on GFX10+

This seems to give no measurable benefit to Strange Brigade or Shadow of
Mordor, but it's simple to do, helps in theory and all other compilers do
it.

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

3 years agoaco: refactor split_store_data() to always split into evenly sized elements
Daniel Schürmann [Tue, 13 Oct 2020 17:35:44 +0000 (19:35 +0200)]
aco: refactor split_store_data() to always split into evenly sized elements

This fixes a couple of issues on GFX67 and
has no negative impact on newer hardware

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

3 years agointel/genxml: don't generate identical code for different branches
Marcin Ślusarz [Wed, 28 Oct 2020 16:39:57 +0000 (17:39 +0100)]
intel/genxml: don't generate identical code for different branches

Quiets 16 Coverity warnings like:

CID 1403401: Identical code for different branches (IDENTICAL_BRANCHES)

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7351>

3 years agointel/tools: fix invalid type in argument to printf
Marcin Ślusarz [Wed, 28 Oct 2020 16:08:54 +0000 (17:08 +0100)]
intel/tools: fix invalid type in argument to printf

$2 is exp2, exp2 is defined to be llint and llint is defined to be
unsigned long long int.

Fixes error reported by Coverity:
CID 1451141: Invalid type in argument to printf format specifier (PRINTF_ARGS)

Fixes: 70308a5a8a8 ("intel/tools: New i965 instruction assembler tool")

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7351>

3 years agogallium/dri: fix dri2_from_planar for multiplanar images
Philipp Zabel [Thu, 14 Feb 2019 17:40:57 +0000 (18:40 +0100)]
gallium/dri: fix dri2_from_planar for multiplanar images

Fix the gbm_dri_bo_get_handle_for_plane use case by allowing plane > 0
in dri2_from_planar for images with multiple planes in separate chained
texture resources.

Not all multiplanar resources are chained, though. The iris aux buffer
is a separate plane in the same resource.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>

3 years agogallium/dri: fix dri2_query_image for multiplanar images
Philipp Zabel [Thu, 14 Feb 2019 17:40:57 +0000 (18:40 +0100)]
gallium/dri: fix dri2_query_image for multiplanar images

Images with multiple planes in separate chained texture resources should
report the correct number of planes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>

3 years agogallium/dri: allow create image for formats that only support SV or RT binding
Lucas Stach [Wed, 4 Jul 2018 13:19:17 +0000 (15:19 +0200)]
gallium/dri: allow create image for formats that only support SV or RT binding

Unconditionally requesting both bindings can lead to premature
failure to create a valid image.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>

3 years agonv50/ir/nir: don't use designated initializers
Karol Herbst [Tue, 27 Oct 2020 12:51:47 +0000 (13:51 +0100)]
nv50/ir/nir: don't use designated initializers

This is a C++20 feature...

Fixes: 8850a63161ab58d89c534a1069cda845bf69ecc8 ("radv/aco,nir/lower_subgroups: don't lower elect")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3693
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Andrew Randrianasulu <randrianasulu@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7338>

3 years agov3dv/format: use XYZ1 swizzle for three-component formats
Alejandro Piñeiro [Wed, 28 Oct 2020 13:08:10 +0000 (14:08 +0100)]
v3dv/format: use XYZ1 swizzle for three-component formats

So far for the formats E5B9G9R9_UFLOAT_PACK32 and
B10G11R11_UFLOAT_PACK32 we were using a XYZW swizzle. But from Vulkan
spec those are three-component, without alpha, formats. So we should
use XYZ1 instead, as we were already doing for other three-component
formats.

Curiously the only case where this raised a problem were when using
clamp to border with transparent black. This change allows us to
remove the code that handled only that specific case.

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

3 years agovirgl: Correctly align size of blobs
Tomeu Vizoso [Tue, 27 Oct 2020 08:29:27 +0000 (09:29 +0100)]
virgl: Correctly align size of blobs

Probably a copy-paste error.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: cd31f46f08a7 ("virgl/drm: add resource create blob function")
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7332>

3 years agoglsl: Update loop_terminator constructor to accept parameters.
Vinson Lee [Fri, 23 Oct 2020 00:31:19 +0000 (17:31 -0700)]
glsl: Update loop_terminator constructor to accept parameters.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member continue_from_then is not
initialized in this constructor nor in any functions that it calls.

Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7283>

3 years agoaco/ngg: Incorporate GS invocations into workgroup size calculation.
Timur Kristóf [Thu, 15 Oct 2020 08:33:18 +0000 (10:33 +0200)]
aco/ngg: Incorporate GS invocations into workgroup size calculation.

If the workgroup_size variable is lower than the actual workgroup size,
that means it's possible that ACO won't emit some s_barrier instructions
when in fact it should. This can possibly cause a GPU hang.

This is just for the sake of general correctness, currently this
can't cause a real problem because the maximum vertex count is always
greater than (or equal to) the primitive count in GS, and already
takes into account the number of GS invocations.

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

3 years agoaco/ngg: Export a zero-area triangle when primitive count is 0.
Timur Kristóf [Thu, 15 Oct 2020 21:17:12 +0000 (23:17 +0200)]
aco/ngg: Export a zero-area triangle when primitive count is 0.

This is a workaround for a bug in Navi 1x NGG HW.

Very rarely, the Navi 1x PA can hang when an NGG workgroup exports
0 total primitives. According to AMD, we always need this workaround
when it is possible that the number of primitives is 0.

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

3 years agoaco: Add a few assertions about LDS usage.
Timur Kristóf [Thu, 15 Oct 2020 16:18:21 +0000 (18:18 +0200)]
aco: Add a few assertions about LDS usage.

This is to make sure we don't compile a shader which doesn't
fit the available LDS space.

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

3 years agoaco: Make emitting reduction instructions a bit more convenient.
Timur Kristóf [Thu, 15 Oct 2020 08:24:49 +0000 (10:24 +0200)]
aco: Make emitting reduction instructions a bit more convenient.

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

3 years agoaco: Add some validation for PSEUDO_REDUCTION instructions.
Timur Kristóf [Thu, 15 Oct 2020 08:23:42 +0000 (10:23 +0200)]
aco: Add some validation for PSEUDO_REDUCTION instructions.

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

3 years agoaco/ngg: Put shader query reduction operand into a VGPR.
Timur Kristóf [Wed, 14 Oct 2020 15:23:15 +0000 (17:23 +0200)]
aco/ngg: Put shader query reduction operand into a VGPR.

The p_reduce instruction only works if this operand is in a VGPR,
and otherwise gets lowered to incorrect code.

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

3 years agoaco: Assert that workgroup barriers are not used inappropriately.
Timur Kristóf [Thu, 15 Oct 2020 08:58:34 +0000 (10:58 +0200)]
aco: Assert that workgroup barriers are not used inappropriately.

Example:
It is possible for some NGG GS waves to have 0 ES and/or GS invocations,
and in that case having an s_barrier inside divergent control flow can
very possibly hang the GPU.

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

3 years agoci/bare-metal: suppress 'No such file or directory'
Christian Gmeiner [Wed, 28 Oct 2020 11:00:00 +0000 (12:00 +0100)]
ci/bare-metal: suppress 'No such file or directory'

It fills the serial log with unimportant messages.

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

3 years agoaco: switch aco_print_asm to a FILE *
Rhys Perry [Thu, 15 Oct 2020 15:38:13 +0000 (16:38 +0100)]
aco: switch aco_print_asm to a FILE *

Streams are really stateful and (IMO) difficult to read for non-trivial
usage. This is also more consistent with NIR and the rest of ACO.

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

3 years agoaco: refactor repeated instruction disassembly
Rhys Perry [Thu, 15 Oct 2020 15:10:55 +0000 (16:10 +0100)]
aco: refactor repeated instruction disassembly

This seems simpler to me. It should also work correctly when repeated
instructions cross blocks.

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

3 years agoaco: move individual instruction disassembly to its own helper
Rhys Perry [Thu, 15 Oct 2020 15:03:00 +0000 (16:03 +0100)]
aco: move individual instruction disassembly to its own helper

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

3 years agodocs/features: Update extensions for swr
Adam Jackson [Thu, 22 Oct 2020 20:16:55 +0000 (16:16 -0400)]
docs/features: Update extensions for swr

The following are all supported:

- GL_ARB_shader_atomic_counters
- GL_ARB_shader_image_load_store
- GL_ARB_shader_image_size
- GL_ARB_texture_multisample
- GL_KHR_texture_compression_astc_ldr
- GL_KHR_texture_compression_astc_sliced_3d
- GL_OES_texture_float
- GL_OES_texture_float_linear
- GL_OES_texture_half_float
- GL_OES_texture_half_float_linear

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

3 years agodocs/features: Update extensions for softpipe
Adam Jackson [Thu, 22 Oct 2020 19:50:50 +0000 (15:50 -0400)]
docs/features: Update extensions for softpipe

GLES 3.1 is supported, as are:

- GL_KHR_texture_compression_astc_ldr
- GL_KHR_texture_compression_astc_sliced_3d
- GL_EXT_render_snorm
- GL_EXT_texture_norm16

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

3 years agoaco: use mubuf helper in select_gs_copy_shader
Rhys Perry [Tue, 28 Jul 2020 12:50:08 +0000 (13:50 +0100)]
aco: use mubuf helper in select_gs_copy_shader

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

3 years agoaco: use control flow creation helpers in select_gs_copy_shader
Rhys Perry [Tue, 28 Jul 2020 12:42:44 +0000 (13:42 +0100)]
aco: use control flow creation helpers in select_gs_copy_shader

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

3 years agoaco: round bytes_written to dwords if larger than 4 bytes
Rhys Perry [Tue, 27 Oct 2020 13:23:07 +0000 (13:23 +0000)]
aco: round bytes_written to dwords if larger than 4 bytes

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

3 years agoaco: default to a definition size of 32
Rhys Perry [Wed, 21 Oct 2020 15:00:36 +0000 (16:00 +0100)]
aco: default to a definition size of 32

For non-arithmetic opcodes such as buffer_load_dword and buffer_load_short,
default to a definition size of 32.

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

3 years agodocs: s3tc -> S3TC
Erik Faye-Lund [Wed, 30 Sep 2020 13:15:02 +0000 (15:15 +0200)]
docs: s3tc -> S3TC

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: clang -> Clang
Erik Faye-Lund [Wed, 30 Sep 2020 13:09:37 +0000 (15:09 +0200)]
docs: clang -> Clang

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: gcc -> GCC
Erik Faye-Lund [Wed, 30 Sep 2020 13:08:33 +0000 (15:08 +0200)]
docs: gcc -> GCC

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: fbo -> FBO
Erik Faye-Lund [Wed, 30 Sep 2020 13:03:03 +0000 (15:03 +0200)]
docs: fbo -> FBO

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: hud -> HUD
Erik Faye-Lund [Wed, 30 Sep 2020 08:36:29 +0000 (10:36 +0200)]
docs: hud -> HUD

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: api -> API
Erik Faye-Lund [Wed, 30 Sep 2020 08:33:25 +0000 (10:33 +0200)]
docs: api -> API

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: anistropy -> anisotropy
Erik Faye-Lund [Wed, 30 Sep 2020 13:20:15 +0000 (15:20 +0200)]
docs: anistropy -> anisotropy

While one of these is referring to an identifier, the actual identifier
is correctly spelled.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: eg. -> e.g.
Erik Faye-Lund [Wed, 30 Sep 2020 13:24:01 +0000 (15:24 +0200)]
docs: eg. -> e.g.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: ie. -> i.e.
Erik Faye-Lund [Wed, 30 Sep 2020 08:30:19 +0000 (10:30 +0200)]
docs: ie. -> i.e.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agoradv: remove call to nir_lower_pack()
Daniel Schürmann [Fri, 23 Oct 2020 14:04:33 +0000 (16:04 +0200)]
radv: remove call to nir_lower_pack()

The pack_* instructions are now lowered via nir_lower_alu_to_scalar()
and unpack_* are not lowered anymore.

These bitcasts are no-ops, and lowering prevents
some optimizations like vectorization.

Note: There are still some *_split variations remaining
from different other NIR passes.

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

3 years agoradv: lower pack_[64/32]_* via nir_lower_alu_to_scalar()
Daniel Schürmann [Mon, 21 Sep 2020 13:02:33 +0000 (14:02 +0100)]
radv: lower pack_[64/32]_* via nir_lower_alu_to_scalar()

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

3 years agonir: add options to lower nir_op_pack_[64/32]_* via nir_lower_alu_to_scalar()
Daniel Schürmann [Mon, 21 Sep 2020 13:01:24 +0000 (14:01 +0100)]
nir: add options to lower nir_op_pack_[64/32]_* via nir_lower_alu_to_scalar()

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

3 years agoac/nir: implement nir_op_[un]pack_64_4x16
Daniel Schürmann [Mon, 26 Oct 2020 10:52:00 +0000 (11:52 +0100)]
ac/nir: implement nir_op_[un]pack_64_4x16

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

3 years agoaco: implement nir_op_unpack_[64/32]_*
Daniel Schürmann [Mon, 31 Aug 2020 16:37:25 +0000 (17:37 +0100)]
aco: implement nir_op_unpack_[64/32]_*

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

3 years agov3dv: enable alphaToOne feature
Iago Toral Quiroga [Tue, 27 Oct 2020 11:39:53 +0000 (12:39 +0100)]
v3dv: enable alphaToOne feature

This is another case of a feature that is implemented in the compiler
and that only required that we set the shader key properly from the
pipeline state, which we were already doing.

I verified we pass the tests in dEQP-VK.pipeline.multisample.alpha_to_one.*
(we only support 4x multisampling, so we can only pass a single test there),
however, the tests seem to have a bug by which they always pass, even if
the driver doesn't actually implement alpha to one correctly. I submitted
a fix to Khronos and verified that we also pass the fixed tests (and that
we failed them if we don't actually set te shader key correctly).

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

3 years agoradv: Do not access set layout during vkCmdBindDescriptorSets.
Bas Nieuwenhuizen [Sun, 18 Oct 2020 13:14:36 +0000 (15:14 +0200)]
radv: Do not access set layout during vkCmdBindDescriptorSets.

The spec says:

"
VkDescriptorSetLayout objects may be accessed by commands that operate on descriptor sets allocated using that layout
"

So our behavior is valid here, but this is a temporary workaround for an issue with Baldur's Gate 3.

CC: mesa-stable
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3607
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7207>

3 years agoradv: Fix 1D compressed mipmaps on GFX9.
Bas Nieuwenhuizen [Wed, 21 Oct 2020 01:35:26 +0000 (03:35 +0200)]
radv: Fix 1D compressed mipmaps on GFX9.

Partial rollback as GFX9 really requires height = 1 to work.

The two substantial parts of the fix remaining:

1) Deal with views with multiple levels.
2) Limit the expansion to the base mip pitch/height. On GFX9 this
   is exactly equal to the surf_pitch that was used before. I've
   done some investigation to make sure that on GFX10 this always
   results in the right physical layout.

Remaining stupid question is how the actual extents for bounds
checking never end up too low when the size gets clamped, but
this change and the previous change don't change that ...

Fixes: 1fb3e1fb708 "radv: Fix mipmap extent adjustment on GFX9+."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7245>

3 years agointel/mi_builder: Support gen11 command-streamer based register offsets
Jordan Justen [Sun, 14 Apr 2019 10:11:25 +0000 (03:11 -0700)]
intel/mi_builder: Support gen11 command-streamer based register offsets

Reworks:
 * Automatically apply to any register in the range 0x2000 - 0x4000

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5466>

3 years agoFix VMware capitalization.
Vinson Lee [Wed, 21 Oct 2020 22:13:03 +0000 (15:13 -0700)]
Fix VMware capitalization.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7260>

3 years agoutil: use dllexport for mingw too
Michel Zou [Sat, 24 Oct 2020 20:27:06 +0000 (22:27 +0200)]
util: use dllexport for mingw too

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agolavapipe: configure suffix in icd json
Michel Zou [Sun, 18 Oct 2020 17:55:21 +0000 (19:55 +0200)]
lavapipe: configure suffix in icd json

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agogallium: use libpipe_loader_links
Michel Zou [Sun, 18 Oct 2020 09:45:44 +0000 (11:45 +0200)]
gallium: use libpipe_loader_links

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agowsi: move drm code to wsi_common_drm.c
Michel Zou [Sun, 18 Oct 2020 09:30:35 +0000 (11:30 +0200)]
wsi: move drm code to wsi_common_drm.c

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agolavapipe: fix usleep usage in lvp_device
Michel Zou [Mon, 19 Oct 2020 18:52:26 +0000 (20:52 +0200)]
lavapipe: fix usleep usage in lvp_device

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agointel/dev: Add device info for ADL-S
Jordan Justen [Wed, 8 Apr 2020 01:10:22 +0000 (18:10 -0700)]
intel/dev: Add device info for ADL-S

Signed-off-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/7322>

3 years agoaco: ignore the ACO-inserted continue in create_continue_phis()
Rhys Perry [Wed, 14 Oct 2020 20:42:01 +0000 (21:42 +0100)]
aco: ignore the ACO-inserted continue in create_continue_phis()

Otherwise, for loops without continue_or_break, create_continue_phis()
always returns an undef operand.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 638cbc21a1c ("aco: handle when ACO adds new continue edges")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2848
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7148>

3 years agoCI: remove llvmpipe cl flake test
Dave Airlie [Tue, 27 Oct 2020 05:25:24 +0000 (15:25 +1000)]
CI: remove llvmpipe cl flake test

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

3 years agoanv: Drop warning about gen12 not being supported
Jordan Justen [Tue, 27 Oct 2020 09:24:36 +0000 (02:24 -0700)]
anv: Drop warning about gen12 not being supported

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

3 years agopanfrost: AFBC compress Z16 depth buffers
Icecream95 [Fri, 16 Oct 2020 12:49:58 +0000 (01:49 +1300)]
panfrost: AFBC compress Z16 depth buffers

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

3 years agopanfrost: Z16 depth buffer support
Icecream95 [Fri, 16 Oct 2020 12:49:31 +0000 (01:49 +1300)]
panfrost: Z16 depth buffer support

Only for MFBD GPUs as on t720 it causes some dEQP tests to fail.

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

3 years agopanfrost: Move zs format handling code out of the !afbc case
Icecream95 [Fri, 16 Oct 2020 12:42:16 +0000 (01:42 +1300)]
panfrost: Move zs format handling code out of the !afbc case

This will allow supporting more AFBC depth/stencil formats without
duplicating the format handling.

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

3 years agodocs: Specify when branch points happen
Jason Ekstrand [Wed, 14 Oct 2020 21:38:25 +0000 (16:38 -0500)]
docs: Specify when branch points happen

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

3 years agovulkan/util,vulkan/wsi,radv: Add typed outarray API
James Park [Fri, 7 Aug 2020 03:57:10 +0000 (20:57 -0700)]
vulkan/util,vulkan/wsi,radv: Add typed outarray API

MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)

Add adjacent functions to allow specifying types manually.

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

3 years agoaco: remove all-undef phi opt
Rhys Perry [Fri, 16 Oct 2020 14:50:39 +0000 (15:50 +0100)]
aco: remove all-undef phi opt

This doesn't look like it would create correct IR for 8/16-bit phis and
doesn't seem to help anything. If we ever want to do this, it's probably
better done in nir_opt_remove_phis().

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: use v_mov_b32_sdwa for some 16-bit constants
Rhys Perry [Fri, 16 Oct 2020 12:18:08 +0000 (13:18 +0100)]
aco: use v_mov_b32_sdwa for some 16-bit constants

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: remove some unused optimizations
Rhys Perry [Thu, 15 Oct 2020 14:18:40 +0000 (15:18 +0100)]
aco: remove some unused optimizations

These are unused now that we almost always use p_parallelcopy for simple
copies.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: use Builder::copy more
Rhys Perry [Thu, 15 Oct 2020 14:09:20 +0000 (15:09 +0100)]
aco: use Builder::copy more

fossil-db (Navi):
Totals from 6973 (5.07% of 137413) affected shaders:
SGPRs: 381768 -> 381776 (+0.00%)
VGPRs: 306092 -> 306096 (+0.00%); split: -0.00%, +0.00%
CodeSize: 24440844 -> 24421196 (-0.08%); split: -0.09%, +0.01%
MaxWaves: 86581 -> 86583 (+0.00%)
Instrs: 4682161 -> 4679578 (-0.06%); split: -0.06%, +0.00%
Cycles: 68793116 -> 68261648 (-0.77%); split: -0.83%, +0.05%

fossil-db (Polaris):
Totals from 8154 (5.87% of 138881) affected shaders:
VGPRs: 338916 -> 338920 (+0.00%); split: -0.00%, +0.00%
CodeSize: 23540428 -> 23540488 (+0.00%); split: -0.00%, +0.00%
MaxWaves: 49090 -> 49091 (+0.00%)
Instrs: 4576085 -> 4576101 (+0.00%); split: -0.00%, +0.00%
Cycles: 51720704 -> 51720888 (+0.00%); split: -0.00%, +0.00%

Most of the Navi cycle/instruction changes are from 8/16-bit parallel-rdp
shaders. They appear to be improved because the p_create_vector from
lower_subdword_phis() was blocking constant propagation.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: always use p_parallelcopy for pre-RA copies
Rhys Perry [Wed, 14 Oct 2020 12:50:24 +0000 (13:50 +0100)]
aco: always use p_parallelcopy for pre-RA copies

Most fossil-db changes are because literals are applied earlier
(in label_instruction), so use counts are more accurate and more literals
are applied.

fossil-db (Navi):
Totals from 79551 (57.89% of 137413) affected shaders:
SGPRs: 4549610 -> 4542802 (-0.15%); split: -0.19%, +0.04%
VGPRs: 3326764 -> 3324172 (-0.08%); split: -0.10%, +0.03%
SpillSGPRs: 38886 -> 34562 (-11.12%); split: -11.14%, +0.02%
CodeSize: 240143456 -> 240001008 (-0.06%); split: -0.11%, +0.05%
MaxWaves: 1078919 -> 1079281 (+0.03%); split: +0.04%, -0.01%
Instrs: 46627073 -> 46528490 (-0.21%); split: -0.22%, +0.01%

fossil-db (Polaris):
Totals from 98463 (70.90% of 138881) affected shaders:
SGPRs: 5164689 -> 5164353 (-0.01%); split: -0.02%, +0.01%
VGPRs: 3920936 -> 3921856 (+0.02%); split: -0.00%, +0.03%
SpillSGPRs: 56298 -> 52259 (-7.17%); split: -7.22%, +0.04%
CodeSize: 258680092 -> 258692712 (+0.00%); split: -0.02%, +0.03%
MaxWaves: 620863 -> 620823 (-0.01%); split: +0.00%, -0.01%
Instrs: 50776289 -> 50757577 (-0.04%); split: -0.04%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: allow literals on sub-dword p_parallelcopy
Rhys Perry [Thu, 15 Oct 2020 21:09:45 +0000 (22:09 +0100)]
aco: allow literals on sub-dword p_parallelcopy

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: don't use bld.copy() in handle_operands()
Rhys Perry [Thu, 15 Oct 2020 18:39:37 +0000 (19:39 +0100)]
aco: don't use bld.copy() in handle_operands()

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: expand vectors passed as copy operands
Rhys Perry [Thu, 15 Oct 2020 13:49:34 +0000 (14:49 +0100)]
aco: expand vectors passed as copy operands

Most copies which hit this case use p_create_vector, but in the future
p_parallelcopy will be used instead.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: copy-propgate through p_create_vector during value numbering
Rhys Perry [Wed, 14 Oct 2020 14:35:20 +0000 (15:35 +0100)]
aco: copy-propgate through p_create_vector during value numbering

fossil-db (Navi):
Totals from 182 (0.13% of 137413) affected shaders:
SGPRs: 9304 -> 9312 (+0.09%)
VGPRs: 7636 -> 7620 (-0.21%); split: -0.26%, +0.05%
CodeSize: 733516 -> 733092 (-0.06%); split: -0.07%, +0.01%
MaxWaves: 2478 -> 2479 (+0.04%)
Instrs: 139664 -> 139561 (-0.07%); split: -0.09%, +0.02%
Cycles: 3215104 -> 3214080 (-0.03%); split: -0.04%, +0.01%

fossil-db (Polaris):
Totals from 161 (0.12% of 138881) affected shaders:
VGPRs: 5608 -> 5596 (-0.21%); split: -0.29%, +0.07%
CodeSize: 605336 -> 605120 (-0.04%); split: -0.05%, +0.02%
Instrs: 117957 -> 117902 (-0.05%); split: -0.07%, +0.02%
Cycles: 3105008 -> 3103876 (-0.04%); split: -0.04%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: skip value numbering of copies
Rhys Perry [Mon, 26 Oct 2020 19:22:14 +0000 (19:22 +0000)]
aco: skip value numbering of copies

Instead, copy-propagate through and remove them.

This improves value numbering in this situation:
a = ...
b = copy a
c = copy a
use(b)
use(c)

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

3 years agoaco: don't do divergent break+discard
Rhys Perry [Mon, 19 Oct 2020 10:03:34 +0000 (11:03 +0100)]
aco: don't do divergent break+discard

If the shader does:
loop {
   if (divergent)
      discard
   else
      a()
   b()
}
then a()'s block will dominate b()'s block in the logical CFG, but not the
linear CFG. This will cause value numbering to try to combine SLAU from
a() and b().

This didn't happen with break/continue because sanitize_if() would move
a() out of the branch. Using sanitize_if() to fix this doesn't look easy,
because discards are not control flow instructions in NIR.

No fossil-db changes.

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

3 years agoaco: update phi_map in add_subdword_operand()
Rhys Perry [Tue, 27 Oct 2020 10:59:35 +0000 (10:59 +0000)]
aco: update phi_map in add_subdword_operand()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 56345b8c610 ("aco: allow reading/writing upper halves/bytes when possible")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: Clean up some C++ usages
James Park [Fri, 23 Oct 2020 03:40:04 +0000 (20:40 -0700)]
aco: Clean up some C++ usages

Iterate over maps by reference to avoid copies.

Replace find/insert with insert to avoid double search.

Use range-based for loop, avoiding copies by reference. Delete comment.

Erase by iterator instead of key to avoid repeat search.

Iterators unneeded to modify unwaited_instrs. Use range-based for loop.

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7285>

3 years agoradv: enable VK_AMD_mixed_attachment_samples on GFX6-GFX7
Samuel Pitoiset [Wed, 6 May 2020 09:43:24 +0000 (11:43 +0200)]
radv: enable VK_AMD_mixed_attachment_samples on GFX6-GFX7

Now that dEQP-VK.pipeline.multisample.mixed_attachment_samples.* pass,
it should be safe to also enable this extension on these old chips.

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

3 years agoradv: flush CB before and after FMASK_DECOMPRESS or DCC_DECOMPRESS
Samuel Pitoiset [Wed, 6 May 2020 09:42:43 +0000 (11:42 +0200)]
radv: flush CB before and after FMASK_DECOMPRESS or DCC_DECOMPRESS

According to RadeonSI and AMDVLK, it seems required to flush CB
before and after FMASK_DECOMPRESS or DCC_DECOMPRESS.

This shouldn't much affect performance because the driver already
flushes CB after these operations (including FCE too).

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

3 years agodocs: add link to extension spec
Erik Faye-Lund [Mon, 26 Oct 2020 11:27:41 +0000 (12:27 +0100)]
docs: add link to extension spec

We already do this for all the other VK extensions, so we might as well
do this for VK_EXT_vertex_attribute_divisor as well.

Fixes: 2ff97847d19 ("docs: document zink's gl > 3.0 requirements")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7312>

3 years agoCI: Only run OpenCL tests when we need to
Daniel Stone [Tue, 27 Oct 2020 07:42:15 +0000 (07:42 +0000)]
CI: Only run OpenCL tests when we need to

Like the other drivers, set up rules so we don't run piglit-cl unless we
need to.

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

3 years agoradv: do not perform a FMASK expand for non-writeable MSAA images
Samuel Pitoiset [Thu, 22 Oct 2020 12:54:03 +0000 (14:54 +0200)]
radv: do not perform a FMASK expand for non-writeable MSAA images

It should only be required for writeable MSAA images.

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

3 years agoaco: fix GFX8 16-bit packing
Daniel Schürmann [Tue, 27 Oct 2020 10:35:27 +0000 (11:35 +0100)]
aco: fix GFX8 16-bit packing

def.physReg() was uninitialized.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: d96f387e7ac448b450091b900ab089eea3eb7b86 ('aco: improve code sequences for 16bit packing')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7334>