Mauro Rossi [Thu, 29 Oct 2020 22:21:16 +0000 (23:21 +0100)]
android: aco: add aco_form_hard_clauses.cpp to Makefile.sources
Fixes the following building error:
external/mesa/src/amd/compiler/aco_interface.cpp:160:
error: undefined reference to 'aco::form_hard_clauses(aco::Program*)'
Fixes:
3dfbed2a8 ("aco: create s_clause on GFX10+")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7380>
Lucas Stach [Tue, 7 Jul 2020 18:38:33 +0000 (20:38 +0200)]
etnaviv: don't import allocated scanout resources via from_handle
etna_resource_from_handle() recomputes (or second guesses) a lot of
properties we already have available in the allocation call. To make
things a bit more easier to follow, just import the BO without going
through the full handle import.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Thu, 29 Oct 2020 17:09:49 +0000 (18:09 +0100)]
etnaviv: pass correct layout to etna_resource_alloc for scanout resources
Since
b96277653033 (etnaviv: rework compatible render base) the base resource
may be linear and a render compatible resource is allocated as needed. As
scanout surfaces without a modifier are always assumed to be linear, make
sure to pass the correct layout to etna_resource_alloc().
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Thu, 29 Oct 2020 15:50:54 +0000 (16:50 +0100)]
etnaviv: simplify etna_screen_bo_from_handle
There is no need to have a out_stride parameter, as the only callsite
already has the winsys handle, which includes the stride, so there is
no need to pass the stride back and forth.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Tue, 6 Oct 2020 14:30:44 +0000 (16:30 +0200)]
etnaviv: do proper cpu prep/fini when clearing allocated buffer
The debug memset 0 of all allocated buffers did not sync the buffer for CPU
access as required by the UAPI.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Thu, 29 Oct 2020 15:55:17 +0000 (16:55 +0100)]
etnaviv: cosmetic etna_resource_alloc fixes
Get rid if the local bo variable, we can just assign it to the pointer
in the etna_resource struct.
Get rid of superfluous clearing of the TS bo pointer, the struct is already
zero initialized.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Michael Tretter [Wed, 23 Sep 2020 08:50:18 +0000 (10:50 +0200)]
etnaviv: free tgsi tokens when shader state is deleted
The tokens are allocated using tgsi_dup_tokens when the shader state is
created, so we need to free them explicitly when deleting the shader state.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Fri, 30 Oct 2020 08:57:52 +0000 (09:57 +0100)]
etnaviv: tex_desc: fix TS compression enable
The TX_CTRL register has a bit to enable TS compression, the setting in
TS_SAMPLER_CONFIG is ignored for descriptor based textures. Apparently
256B tile mode already implies enabled compression to the HW, as with
the larger tile mode with compression was working fine, only the 128B
tile mode needs this change to work correctly.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Fri, 30 Oct 2020 08:57:08 +0000 (09:57 +0100)]
etnaviv: update headers from rnndb
Update to etna_viv commit
c9a26f3b776a.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Tue, 27 Oct 2020 14:34:13 +0000 (15:34 +0100)]
etnaviv: blt: properly program surface TS offset for clears
We clear the wrong TS region for != level 0 surfaces or TS buffers
with a internal offset.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Lucas Stach [Wed, 28 Oct 2020 18:47:15 +0000 (19:47 +0100)]
etnaviv: drm: fix BO refcount race
There is a race where the BO refcount might drop to 0 before the
dmabuf/name import paths had a chance to grab a reference for a
BO found in the handle_table. The easiest solution is to keep the
refcount stable as long as the table_lock is held.
While a more involved scheme of rechecking the refcount before
actually destroying the BO might also work, the bo_del path isn't
called very often, so micro-optimizing a single mutex_lock seems
to be over-engineered, so go for the easy solution.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
Christian Gmeiner [Thu, 29 Oct 2020 20:30:03 +0000 (21:30 +0100)]
etnaviv: drop etna_pipe_wait(..)
It is unused -> drop it.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7371>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>