mesa.git
14 months agoVERSION: bump for 21.1.0-rc2mesa-21.1.0-rc2
Eric Engestrom [Wed, 21 Apr 2021 20:04:01 +0000 (21 22:04 +0200)]
VERSION: bump for 21.1.0-rc2

14 months agozink: add clear-on-flush mechanic deeper into flush codepath
Mike Blumenkrantz [Tue, 20 Apr 2021 19:08:17 +0000 (20 15:08 -0400)]
zink: add clear-on-flush mechanic deeper into flush codepath

we should probably trigger this any time a flush occurs just to avoid
doing too much (unexpected) cmdstream rewriting

both calls must be kept, however, as the one in the base flush hook will change
the behavior of flushing if no other work is queued

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit 04241e826eabf9fab16596d0454fffb48d476c93)

14 months agozink: directly set batch->state->flush_res from flush_resource hook
Mike Blumenkrantz [Tue, 20 Apr 2021 19:07:26 +0000 (20 15:07 -0400)]
zink: directly set batch->state->flush_res from flush_resource hook

there's no need to have an intermediate pointer here since that only
complicates keeping scanout synchronized

this also eliminates the pointer on the context since it isn't used anymore

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit be6532ecdfa448919f277c07391d38dcc50a6ab4)

14 months agozink: move wsi flush info conditional to queue submission
Mike Blumenkrantz [Tue, 20 Apr 2021 19:05:37 +0000 (20 15:05 -0400)]
zink: move wsi flush info conditional to queue submission

having a resource pointer on batch states is now a requirement for
keeping scanout objects in sync

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit 7af40bb595881a5bdef8870df7ca8605b86d2107)

14 months agozink: add a flag indicating whether scanout object needs updating
Mike Blumenkrantz [Tue, 20 Apr 2021 19:04:11 +0000 (20 15:04 -0400)]
zink: add a flag indicating whether scanout object needs updating

this minimizes overhead of maintaining scanout objects

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit 4dcd477d123e62f144210c6b624627f9c42d5924)

14 months agozink: move scanout sync to end of batch
Mike Blumenkrantz [Tue, 20 Apr 2021 18:42:29 +0000 (20 14:42 -0400)]
zink: move scanout sync to end of batch

this is called from the non-deferred flush path, which means it should always
be triggering work, which means it will always result in a queue submission

instead of relying on the pipe_context::flush hook to be triggered, which is
not a guarantee, do scanout sync during queue submission to ensure that scanout
objects are always in sync

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit dd8b15b2bbe9a115f4df921449234cc12ea63f31)

14 months agozink: use undefined layout for first scanout obj transition
Mike Blumenkrantz [Tue, 13 Apr 2021 13:14:15 +0000 (13 09:14 -0400)]
zink: use undefined layout for first scanout obj transition

doesn't really matter, but technically an error

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10213>
(cherry picked from commit 7c2c0813c56baf522f39584150046c613a18931f)

14 months agopanfrost: Fix ZS reloading on Bifrost v6
Boris Brezillon [Thu, 15 Apr 2021 08:10:16 +0000 (15 10:10 +0200)]
panfrost: Fix ZS reloading on Bifrost v6

EARLY_ZS_ALWAYS was introduced in Bifrost v7. Use ALWAYS (or INTERSECT
depending on the situation) on v6.

Fixes: 8ba2f9f69858 ("panfrost: Create a blitter library to replace the existing preload helpers")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10250>
(cherry picked from commit 1de393fec5394e4423de20f8542f4a20cd1a38df)

14 months agopanfrost: Fix indirect draws
Boris Brezillon [Wed, 21 Apr 2021 08:24:37 +0000 (21 10:24 +0200)]
panfrost: Fix indirect draws

Use panfrost_batch_reserve_tls() to reserve the TSD.

Cc: mesa-stable
Fixes: ff3eada7eb4e ("panfrost: Use the generic preload and FB helpers in the gallium driver")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10369>
(cherry picked from commit 19849a6501e9f613b3a20a148e83fc38a0913c28)

14 months agoaco: allow SDWA sels smaller than the operand size
Rhys Perry [Mon, 19 Apr 2021 10:32:56 +0000 (19 11:32 +0100)]
aco: allow SDWA sels smaller than the operand size

p_extract_vector copy-propagation can create byte sels for v2b operands.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10315>
(cherry picked from commit 2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3)

14 months agoaco: don't update register demand during RA validation
Rhys Perry [Mon, 19 Apr 2021 10:24:03 +0000 (19 11:24 +0100)]
aco: don't update register demand during RA validation

It isn't intended to be accurate after RA, so num_waves can become zero,
breaking the sgpr_limit calculation.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10315>
(cherry picked from commit 655ba1e3a9b2a1acbf56937c39a1bd25d48d0246)

14 months agoRevert "radeonsi: set TRUNC_COORD=0 for Total War: WARHAMMER to fix it"
Rhys Perry [Tue, 6 Apr 2021 08:52:26 +0000 (6 09:52 +0100)]
Revert "radeonsi: set TRUNC_COORD=0 for Total War: WARHAMMER to fix it"

This reverts commit cd12fcff96cc7db794047e2a045142ea861254a2.

The terrain looks fine now that TRUNC_COORD=0 for textureGather().

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
(cherry picked from commit 9fb1f9303b5e082f1aa6133c76a71cbf075bfd11)

14 months agoac/nir: set TRUNC_COORD=0 for nir_texop_tg4
Rhys Perry [Mon, 5 Apr 2021 13:26:33 +0000 (5 14:26 +0100)]
ac/nir: set TRUNC_COORD=0 for nir_texop_tg4

Fixes black squares in Assassin's Creed: Valhalla and rendering of
FidelityFX-CACAO demo.

shader-db (sienna cichlid):
Totals:
SGPRS: 2977068 -> 2977220 (0.01 %)
VGPRS: 1929624 -> 1929616 (-0.00 %)
Spilled SGPRs: 5769 -> 5769 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 61423092 -> 61424672 (0.00 %) bytes
Max Waves: 895765 -> 895766 (0.00 %)

Totals from affected shaders:
SGPRS: 9520 -> 9672 (1.60 %)
VGPRS: 7464 -> 7456 (-0.11 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 527432 -> 529012 (0.30 %) bytes
Max Waves: 1819 -> 1820 (0.05 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 58f25098a0d ("radv: Use TRUNC_COORD on samplers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
(cherry picked from commit 6a7b89c89df9acea080ccc4f7c2852699ba3a0f9)

14 months agoaco: set TRUNC_COORD=0 for nir_texop_tg4
Rhys Perry [Mon, 5 Apr 2021 13:10:25 +0000 (5 14:10 +0100)]
aco: set TRUNC_COORD=0 for nir_texop_tg4

Fixes black squares in Assassin's Creed: Valhalla and rendering of
FidelityFX-CACAO demo.

fossil-db (sienna cichlid):
Totals from 3052 (2.09% of 146267) affected shaders:
SpillSGPRs: 8437 -> 8646 (+2.48%)
CodeSize: 30993832 -> 31116916 (+0.40%); split: -0.00%, +0.40%
Instrs: 5869934 -> 5886783 (+0.29%); split: -0.00%, +0.29%
Latency: 250330521 -> 250463770 (+0.05%); split: -0.00%, +0.05%
InvThroughput: 59797617 -> 59814584 (+0.03%); split: -0.00%, +0.03%
VClause: 92114 -> 92132 (+0.02%)
SClause: 197373 -> 197338 (-0.02%); split: -0.02%, +0.01%
Copies: 479482 -> 482394 (+0.61%); split: -0.01%, +0.61%
Branches: 219629 -> 219635 (+0.00%)
PreSGPRs: 248970 -> 249366 (+0.16%)

fossil-db (polaris10):
Totals from 3050 (2.06% of 147787) affected shaders:
SGPRs: 282864 -> 282912 (+0.02%); split: -0.01%, +0.02%
VGPRs: 242572 -> 242612 (+0.02%)
SpillSGPRs: 10387 -> 10675 (+2.77%)
CodeSize: 31872460 -> 31996128 (+0.39%)
MaxWaves: 10924 -> 10925 (+0.01%)
Instrs: 6222217 -> 6239072 (+0.27%)
Latency: 317482545 -> 317773685 (+0.09%); split: -0.00%, +0.09%
InvThroughput: 156149624 -> 156242072 (+0.06%); split: -0.00%, +0.06%
VClause: 92295 -> 92254 (-0.04%); split: -0.05%, +0.01%
SClause: 243342 -> 243321 (-0.01%); split: -0.01%, +0.00%
Copies: 678902 -> 681700 (+0.41%); split: -0.00%, +0.41%
Branches: 219698 -> 219703 (+0.00%)
PreSGPRs: 244251 -> 244644 (+0.16%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 58f25098a0d ("radv: Use TRUNC_COORD on samplers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3110
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
(cherry picked from commit 3cbe9894f74e064e7e6136a146aa4793c77fee3e)

14 months ago.pick_status.json: Update to fcb5ba58165cd407408f8dd9a102f0c5e16a9956
Eric Engestrom [Wed, 21 Apr 2021 18:01:59 +0000 (21 20:01 +0200)]
.pick_status.json: Update to fcb5ba58165cd407408f8dd9a102f0c5e16a9956

14 months agoci/virgl: Mark a couple of new Crash tests as flakes.
Eric Anholt [Thu, 15 Apr 2021 23:48:57 +0000 (15 16:48 -0700)]
ci/virgl: Mark a couple of new Crash tests as flakes.

These have shown up in CI runs since the deqp uprev.  Also, link the bug
report I made for one of the failing tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10274>
(cherry picked from commit afa965b7c5f556ada4e0626abe933d2fd6874035)

14 months agozink: force scanout sync when mapping scanout resource
Mike Blumenkrantz [Mon, 19 Apr 2021 19:49:54 +0000 (19 15:49 -0400)]
zink: force scanout sync when mapping scanout resource

this is just for unit tests where the scanout object is redundant and
the only time a flush occurs is from stalling on readback

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239>
(cherry picked from commit 874535752b497bd8ab49cf97add6de2ed9b16f81)

14 months agozink: merge copy-to-scanout path into non-deferred flush path
Mike Blumenkrantz [Wed, 14 Apr 2021 16:47:53 +0000 (14 12:47 -0400)]
zink: merge copy-to-scanout path into non-deferred flush path

this eliminates any desync between scanout presentation and clears

Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239>
(cherry picked from commit 2138aef7c925483e5cad25ba897b56d4ef5d4d24)

14 months agoamd/common: Use cap to test kernel modifier support.
Bas Nieuwenhuizen [Tue, 20 Apr 2021 00:29:22 +0000 (20 02:29 +0200)]
amd/common: Use cap to test kernel modifier support.

Turns out both kernel v5.10 and v5.11 have the same amdgpu driver
version and only one has modifiers ... In addition the version check
is kinda annoying for backports.

So lets use the cap. Since the cap is technically about ADDFB2 I
tested that this works on rendernodes (and reading the code there
is no distinction from what kind of node this is called).

Fixes: 9a937330efb ("radeonsi: Only set modifier creation function for GFX9+ & with kernel support.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10337>
(cherry picked from commit 9da4590df8b7d08d51464874987313d230adfee8)

14 months agopanfrost: Reserve thread storage descriptor in panfrost_launch_grid()
Boris Brezillon [Mon, 19 Apr 2021 07:43:48 +0000 (19 09:43 +0200)]
panfrost: Reserve thread storage descriptor in panfrost_launch_grid()

If we don't do that the compute batch is left with an empty thread
storage descriptor, and panfrost_batch_submit() tries to emit an FB
descriptors using invalid FB information.

Reported-by: Italo Nicola <italonicola@collabora.com>
Fixes: ff3eada7eb4e ("panfrost: Use the generic preload and FB helpers in the gallium driver")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10312>
(cherry picked from commit 8d9b52f45a6b3fa39feddd16cc4d63b499c12640)

14 months agoradv: fix emitting depth bias when beginning a command buffer
Samuel Pitoiset [Mon, 19 Apr 2021 06:44:40 +0000 (19 08:44 +0200)]
radv: fix emitting depth bias when beginning a command buffer

If depth bias is enabled but zero values used, they were never
emitted to the command buffer because they are equal to the default
values.

Previously, they were always emitted when the bound DS attachment
changed.

This should fix some sort of Z fighting with Dota2 on all GPUs.
This also fixes a different issue (ie. some occlusion queries failures)
on GFX6 because CLEAR_STATE is not used on that chip.

Fixes: 8a47422d977 ("radv: do not scale the depth bias for D16_UNORM depth surfaces")
Cc: 21.1 mesa-stable
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/10310>
(cherry picked from commit 1d3542694bd26d6a912e558af6421aef8e62758f)

14 months agoradv: fix fast clearing depth-only or stencil-only aspects with HTILE
Samuel Pitoiset [Fri, 16 Apr 2021 07:25:42 +0000 (16 09:25 +0200)]
radv: fix fast clearing depth-only or stencil-only aspects with HTILE

DB isn't coherent with L2 on GFX6-8. This is needed when the
clear HTILE mask path is selected.

This fixes an issue with avatars in Heroes of The Storm.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3362
Cc: 21.1 mesa-stable
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/10277>
(cherry picked from commit e4c0724dc6e735da738262de0d26d3e583b746bb)

14 months agogallivm: handle 16-bit input in i2b32
Erik Faye-Lund [Mon, 12 Apr 2021 14:20:06 +0000 (12 16:20 +0200)]
gallivm: handle 16-bit input in i2b32

Fixes: dac8cb981f4 ("gallivm/nir: allow 8/16-bit conversion and comparison.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
(cherry picked from commit da5f346e6c63a17352ed8aacd6b1c182a1a9971d)

14 months agoxmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 19:21:36 +0000 (19 12:21 -0700)]
xmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 2b69dd68097ef86d3226aa074cb1bab6e6187707)

14 months agollvmpipe: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 19:21:27 +0000 (19 12:21 -0700)]
llvmpipe: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit b678115480757e0c5283ab0de27a056ded984272)

14 months agogallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 18:53:04 +0000 (19 11:53 -0700)]
gallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 4a3f0444732fb95883b70bef1b1ffda86af46e4a)

14 months agoshader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 18:52:12 +0000 (19 11:52 -0700)]
shader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)

The warning is triggered when assigning into inputs_read, which is 64bit.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 0e2566a8a7e327b21087e7889d8e8028a5cc5edd)

14 months agomicrosoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:08:52 +0000 (19 10:08 -0700)]
microsoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 67b5fba62ae578f4748ec9acd667d7b74644cb3c)

14 months agomicrosoft/clc: Fix undeclared function warning
Jesse Natalie [Mon, 19 Apr 2021 17:08:43 +0000 (19 10:08 -0700)]
microsoft/clc: Fix undeclared function warning

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 53786d2eb2d173b2e050dd40c4120a5cc461f0f9)

14 months agomicrosoft/clc: Fix MSVC unreferenced variable warnings
Jesse Natalie [Mon, 19 Apr 2021 17:08:15 +0000 (19 10:08 -0700)]
microsoft/clc: Fix MSVC unreferenced variable warnings

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit d641adca6a632740e4158774aa6eebf20739ab22)

14 months agod3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:07:40 +0000 (19 10:07 -0700)]
d3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 1a0fbca1bdf7e27e609d6fc8d7a26cd055fcc7a7)

14 months agonir: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Jesse Natalie [Mon, 19 Apr 2021 17:07:21 +0000 (19 10:07 -0700)]
nir: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 09440ce3fb0d7f2e66d7b793eb39b9ff2a7dbf8c)

14 months agovirgl: move new added field to the end.
Lepton Wu [Mon, 19 Apr 2021 21:18:58 +0000 (19 14:18 -0700)]
virgl: move new added field to the end.

This field was introduced 2 months ago and it breaks virgl
compatibility between guest/host. Switch the new added field
to the end. We will still have compatibility issue but the
"bug window" is much smaller.

Fixes: e778aceaae0 ("virgl: update headers")

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10333>
(cherry picked from commit 5322572c7825f55e583ccc37a01c4b6f891c9821)

14 months agomeson: OpenMP is supposed to be optional
Dylan Baker [Fri, 16 Apr 2021 16:24:27 +0000 (16 09:24 -0700)]
meson: OpenMP is supposed to be optional

The code around it checks that it is found, so clearly it was meant to
be optional, not arequired.

Fixes: cd2832ee5107201493d59f70983f162653e53c7d
       ("meson: add an optional OpenMP dependency for AMD tests")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10286>
(cherry picked from commit 5b9253c28706f3719bffd147b4fa803c7ef544a7)

14 months agofreedreno/a6xx: Don't try to do Z-as-RGBA blits for mismatched formats.
Eric Anholt [Mon, 19 Apr 2021 18:49:14 +0000 (19 11:49 -0700)]
freedreno/a6xx: Don't try to do Z-as-RGBA blits for mismatched formats.

Fixes piglit crashes doing glCopyTexSubImage from (for example)
PIPE_FORMAT_Z24_UNORM_S8_UINT to PIPE_FORMAT_Z32_FLOAT_S8X24_UINT where,
in addition to reading the source Z values incorrectly, we would try to
dereference the missing separate stencil of the Z24S8 buffer.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10328>
(cherry picked from commit ed04fd44ca5d7827100b334840c7fa95d38d23ce)

14 months agospirv: fix uToAccelerationStructure handling
Lionel Landwerlin [Mon, 19 Apr 2021 15:48:09 +0000 (19 18:48 +0300)]
spirv: fix uToAccelerationStructure handling

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7f223a2329a7d3 ("spirv: Implement SpvOpConvertUToAccelerationStructureKHR")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10324>
(cherry picked from commit 856953b131d573cab6f304df54b4ba877fb7d52c)

14 months agoradv: Fix memory leak on descriptor pool reset with layout_size=0.
Bas Nieuwenhuizen [Mon, 19 Apr 2021 11:23:23 +0000 (19 13:23 +0200)]
radv: Fix memory leak on descriptor pool reset with  layout_size=0.

Gotta track those sets too to free them. Alse changed the search
on destroy to check for set instead of offset since offset is not
necessarily unique anymore.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4652
CC: mesa-stable
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10317>
(cherry picked from commit a144fa608d606807d8ae3af14000abe450d52907)

14 months agoandroid: panfrost/lib: add pan_cs.c to Makefile.sources
Mauro Rossi [Sat, 17 Apr 2021 11:41:10 +0000 (17 13:41 +0200)]
android: panfrost/lib: add pan_cs.c to Makefile.sources

Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: pan_emit_tls
>>> referenced by pan_cmdstream.c:2279 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2279)
...
ld.lld: error: undefined symbol: pan_emit_fbd
>>> referenced by pan_cmdstream.c:2302 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2302)
...
ld.lld: error: undefined symbol: pan_emit_fragment_job
>>> referenced by pan_cmdstream.c:2382 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2382)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler_heap
>>> referenced by pan_job.c:718 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:718)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler
>>> referenced by pan_job.c:723 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:723)
...
ld.lld: error: undefined symbol: pan_fbd_has_zs_crc_ext
>>> referenced by pan_job.c:893 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:893)
...
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: 21.1 <mesa-stable@lists.freedesktop.org>
Fixes: 387f8c037d38 ("panfrost: Add various helpers to simplify FB desc emission")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10299>
(cherry picked from commit 63c2dfe132452a7da7471d62e7ff91109ef61597)

14 months agoradeonsi: Report multi-plane formats as unsupported
Drew Davenport [Tue, 9 Mar 2021 23:49:47 +0000 (9 16:49 -0700)]
radeonsi: Report multi-plane formats as unsupported

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693 added
NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM, which regressed some
video decode use cases in radeonsi, for example CtsDecodeTestCases in
android CTS. There are also discolored frames in video playback use
cases (i.e. youtube).

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3632
previously fixed similar issues in radeonsi. This change takes that a
step further to report any multi-plane format as unsupported.

Fixes: 826a10255f5 ("st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9490>
(cherry picked from commit 9b7814779b2d3226ee8c3ed145e30f301ff4b2e5)

14 months agoaco: fix opquantize2f16 on GFX6-7
Samuel Pitoiset [Mon, 19 Apr 2021 11:47:14 +0000 (19 13:47 +0200)]
aco: fix opquantize2f16 on GFX6-7

Make sure to preserve signed zeroes.

Fixes dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
on GFX6 (Pitcairn). Untested on GFX7.

Fixes: 54a09545ec6 ("aco: optimize a*0.0")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10319>
(cherry picked from commit 9434675d607ccdb552d4a3e09bd0ac439d160494)

14 months agozink: fix tcs input reservation for user vars
Mike Blumenkrantz [Thu, 15 Apr 2021 14:20:29 +0000 (15 10:20 -0400)]
zink: fix tcs input reservation for user vars

tcs user vars are var_size[32], which isn't actually how many slots they need,
just how big the variable is (oops), so this needs to be divided
by MAX_PATCH_VERTICES to get the real slot count

slot mapping has always been broken for all tcs inputs, but this probably fixes
all of the related issues there, including unlimited crashes when playing Tomb Raider

Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
(cherry picked from commit 001c6f820164be6c80b3e0d05b84f083234c90e9)

14 months agozink: fix tcs slot map eval for user vars
Mike Blumenkrantz [Thu, 15 Apr 2021 14:23:21 +0000 (15 10:23 -0400)]
zink: fix tcs slot map eval for user vars

tcs user inputs need to have their size adjusted in order to determine whether
they'll overflow the existing slot map

Fixes: 5c5e1abea24 ("zink: evaluate existing slot map during program init and force new map as needed")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
(cherry picked from commit a8ba8eb12f8bc03927effebd926f18952a26f13a)

14 months agozink: always copy the nir shader before compiling
Mike Blumenkrantz [Thu, 15 Apr 2021 14:24:33 +0000 (15 10:24 -0400)]
zink: always copy the nir shader before compiling

nir_convert_from_ssa and assign_io_locations both modify this unconditionally,
the latter of which possibly re-modifies variables in ways that can break the
slot map and cause stack overflows during vk driver pipeline compilation

Fixes: 2b4609b66cd ("zink: run nir_convert_from_ssa last during compile")
Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
(cherry picked from commit a1c7aff88a5390947fe4cba732ff03423e0c517d)

14 months agozink: fix stencil-export cap emission
Erik Faye-Lund [Thu, 15 Apr 2021 08:17:55 +0000 (15 10:17 +0200)]
zink: fix stencil-export cap emission

This cap should only ever be emitted for fragment-shaders, but we
accidentally emit it for all shaders. Let's tighten the check to avoid a
validator warning when emitting non-fragment shaders without support for
VK_EXT_shader_stencil_export.

Fixes: 8724d4fb361 ("zink: check shader stencil output")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10249>
(cherry picked from commit d09442461f66955cd1ddc7367a0060db03d0fd0c)

14 months agoRevert "r600: don't set an index_bias for indirect draw calls"
Gert Wollny [Mon, 19 Apr 2021 07:42:00 +0000 (19 09:42 +0200)]
Revert "r600: don't set an index_bias for indirect draw calls"

This reverts commit acdf1a123436cb3fa7d4bbc9cfbb9566c7693de4.

While this commit fixed the gles CTS regressions, it introduced
regressions that made the driver unusable, hence the revert.

Closes #4657

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10311>
(cherry picked from commit 1b5851fadb268c03fa607a7dd422c3399c9d4840)

14 months ago.pick_status.json: Update to 95d9d811c91076d50385b2fbd330335b68688c69
Eric Engestrom [Tue, 20 Apr 2021 17:32:16 +0000 (20 19:32 +0200)]
.pick_status.json: Update to 95d9d811c91076d50385b2fbd330335b68688c69

15 months agoradeonsi: fix automatic DCC retiling after compute image stores
Marek Olšák [Thu, 15 Apr 2021 00:08:03 +0000 (14 20:08 -0400)]
radeonsi: fix automatic DCC retiling after compute image stores

Only internal compute shaders use DCC stores, so the TODOs are not
critical yet.

Fixes: 1d64a1045ea - radeonsi: enable dcc image stores on gfx10+

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
(cherry picked from commit a1653854f50aa429cb1a5e0ece063900cc988554)

15 months agoradeonsi: fix automatic DCC retiling after DCC clear and DCC decompression
Marek Olšák [Thu, 15 Apr 2021 00:08:03 +0000 (14 20:08 -0400)]
radeonsi: fix automatic DCC retiling after DCC clear and DCC decompression

Fixes: d4f7962d48b - radeonsi: Add displayable DCC flushing without explicit flushes.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
(cherry picked from commit 4d7dd094e3607ad628847bf01b6ab92442f94d1b)

15 months agoradeonsi: don't decompress DCC for float formats in si_compute_copy_image
Marek Olšák [Wed, 24 Mar 2021 00:49:18 +0000 (23 20:49 -0400)]
radeonsi: don't decompress DCC for float formats in si_compute_copy_image

Format reinterpretation disabled it.

Fixes: 1d64a1045ea205ee0297d2f741a824811570fc6d "radeonsi: enable dcc image stores on gfx10+"

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
(cherry picked from commit e0ffd1f9281c8f009f21ec5a8d97db3c6d502124)

15 months agonir: Generate load_ubo_vec4 directly for !PIPE_CAP_NATIVE_INTEGERS
Eric Anholt [Fri, 9 Apr 2021 23:10:30 +0000 (9 16:10 -0700)]
nir: Generate load_ubo_vec4 directly for !PIPE_CAP_NATIVE_INTEGERS

The prog_to_nir->NIR-to-TGSI change ended up causing regressions on r300,
and svga against r300-class hardware, because nir_lower_uniforms_to_ubo()
introduced shifts that nir_lower_ubo_vec4() tried to reverse, but that NIR
couldn't prove are no-ops (since shifting up and back down may drop bits),
and the hardware can't do the integer ops.

Instead, make it so that nir_lower_uniforms_to_ubo can generate
nir_intrinsic_load_ubo_vec4 directly for !INTEGER hardware.

Fixes: cf3fc79cd0ab ("st/mesa: Replace mesa_to_tgsi() with prog_to_nir() and nir_to_tgsi().")
Closes: #4602
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10194>
(cherry picked from commit 5de3cbbb2e66fcdb7d6219b78b89ad932ecadbd5)

15 months agonir_to_tgsi: Use ARL instead of UARL in the !native_integers case.
Eric Anholt [Mon, 12 Apr 2021 18:47:45 +0000 (12 11:47 -0700)]
nir_to_tgsi: Use ARL instead of UARL in the !native_integers case.

Our "integer" index is stored as a float in this case, and we just need to
use teh right opcode for loading it, which will be the only one supported
by !native_integers hardware.

Fixes: cf3fc79cd0ab ("st/mesa: Replace mesa_to_tgsi() with prog_to_nir() and nir_to_tgsi().")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10194>
(cherry picked from commit 71d6d1b1ab917cff0f2f442391964e0ea8fc222b)

15 months agozink: compare against screen batch id when determining which semaphore to use
Mike Blumenkrantz [Thu, 15 Apr 2021 19:46:36 +0000 (15 15:46 -0400)]
zink: compare against screen batch id when determining which semaphore to use

semaphores are per-screen now, so check the screen value

Fixes: fa36a16c684 ("zink: make timeline semaphores per-screen")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10267>
(cherry picked from commit 5b9c3cb7b9daeae04c1211c4124038fc2327ad94)

15 months agoiris/gen12: Work around push constant corruption on context switch.
Francisco Jerez [Mon, 29 Mar 2021 19:26:41 +0000 (29 12:26 -0700)]
iris/gen12: Work around push constant corruption on context switch.

This has been confirmed to fix sporadic graphics corruption on Gen12
platforms for a number of workloads (including Heaven, Valley and
CS:GO among others).  Corruption seems to occur during context switch
fairly consistently, but unfortunately this problem doesn't seem to be
documented.  Until the hardware team comes up with a better
workaround, fix the problem by reemitting constants at the beginning
of each batch.

No corruption has been observed so far in GL due to preemption,
however this is a possibility to keep in mind, it may be necessary to
disable preemption in addition to this patch in order to fully address
this problem (see also 81201e461772a06ed2).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4412
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4454
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 20e2c7308f67412234847fd66fb330969ae30de0)

15 months agost/nine: Fix compilation error on non-x86 platforms
Axel Davy [Thu, 15 Apr 2021 19:59:18 +0000 (15 21:59 +0200)]
st/nine: Fix compilation error on non-x86 platforms

The unused variable was improperly declared.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4647
Fixes: d9e79bfe4f ("st/nine: Disable fpu exceptions during init")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10263>
(cherry picked from commit 5613984fd944a150d48e6a582daaeb8b2dde7e32)

15 months agoanv: disable baked in pipeline bits from dynamic emission path
Lionel Landwerlin [Tue, 13 Apr 2021 14:53:18 +0000 (13 17:53 +0300)]
anv: disable baked in pipeline bits from dynamic emission path

In 27ee40f4c9d86e ("anv: Add support for sample locations") we
introduced the ability to emit sample locations baked in as part of
the pipeline or dynamically.

This is different from the previous dynamic states that were always
removed from the pipeline batch and instead emitted dynamically all
the time.

The mistake in 27ee40f4c9d86e is that sample locations are now emitted
all the time, leading to bigger command buffers for unnecessary
reasons.

This change introduces a bit fields of what is baked in the pipeline
and doesn't need to be dynamically emitted.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ad4cd89069bfc ("anv: Enabled the VK_EXT_sample_locations extension")
Cc: <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10282>
(cherry picked from commit 505d176a8ebfb6a2c7d0b0a51753332036ae6f75)

15 months agoanv: fix 3DSTATE_MULTISAMPLE emission on gen8+
Lionel Landwerlin [Fri, 16 Apr 2021 08:08:46 +0000 (16 11:08 +0300)]
anv: fix 3DSTATE_MULTISAMPLE emission on gen8+

When pipeline->dynamic_state.sample_locations.samples is not set
because the state is dynamic, we're currently calling
genX(emit_multisample) with a 0 samples value which is incorrect.

Found when using renderdoc with the drawing overlay.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ad4cd89069bfc ("anv: Enabled the VK_EXT_sample_locations extension")
Cc: <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10282>
(cherry picked from commit 30bc562bdaec2efbfae4cc01548b2adbae2c0c4b)

15 months agoradv: fix clearing DCC-compressed e5b9g9r9 images
Rhys Perry [Fri, 9 Apr 2021 15:14:50 +0000 (9 16:14 +0100)]
radv: fix clearing DCC-compressed e5b9g9r9 images

Fixes
dEQP-VK.api.image_clearing.core.clear_color_image.2d.optimal.single_layer.e5b9g9r9_ufloat_pack32_33x128
with RADV_DEBUG=forcecompress on GFX10.3.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 21.1 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10176>
(cherry picked from commit 86d903e88ddab658c4806bdbc0656a2eeaac949c)

15 months agoradv: keep DCC compressed for clears on compute with image stores
Samuel Pitoiset [Mon, 12 Apr 2021 07:24:46 +0000 (12 09:24 +0200)]
radv: keep DCC compressed for clears on compute with image stores

Without image stores, DCC is always decompressed on compute.

Cc: 21.1 <mesa-stable@lists.freedesktop.org>
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/10168>
(cherry picked from commit 66e1b42d066480301de8ba669f015b03d22f1541)

15 months agoRevert "intel/compiler: Silence unused parameter warning in update_inst_scoreboard"
Jordan Justen [Fri, 17 Apr 2020 22:31:18 +0000 (17 15:31 -0700)]
Revert "intel/compiler: Silence unused parameter warning in update_inst_scoreboard"

This was a placeholder for the XeHP cross-pipeline synchronization
code, bring it back.

This reverts commit a80e44902f66244d257c523afe77558cf334d624.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
(cherry picked from commit 78b643fb7f7ad6f48062714a23b0d6d9f213c8cb)

15 months agomesa: texparam: Add a clamping macro to handle out-of-range floats returned as integers.
Alexander Shi [Wed, 14 Apr 2021 02:22:57 +0000 (13 19:22 -0700)]
mesa: texparam: Add a clamping macro to handle out-of-range floats returned as integers.

The parameters GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD,
GL_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE_LOD_BIAS are stored as floats but
returned as integers. Setting their values outside of the integer range results
has undefined behaviour when the c-runtime method lroundf converts the value
back to an integer.

Fixes: 53c36dfc('replace IROUND with util functions')
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10244>
(cherry picked from commit 55fb9417a6a3fd5908a459b94de5f38b6e3a14ba)

15 months agogallium/xlib: Fix for recent gl_config changes
Adam Jackson [Thu, 1 Apr 2021 17:44:52 +0000 (1 13:44 -0400)]
gallium/xlib: Fix for recent gl_config changes

This mirrors the changes needed elsewhere for parts of !9817:

Fixes: 4daef7ffe37 mesa: Remove redundant gl_config::sampleBuffers
Fixes: 4fbe1cbe4cc mesa: Stop tracking visual rating in gl_config
Fixes: d21b8afa3de mesa: Remove the pretense of aux buffer support
Fixes: 78dfab95b80 mesa: Remove unused gl_config::level
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4544
Acked-by: Eric Anholt <eric@anholt.net>
Tested-by: Jan Zielinski <jan.zielinski@intel.com>
Acked-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10050>
(cherry picked from commit 31dba8d51b08ef160537c37d381b304c09091ee3)

15 months agopanfrost: Unset shared/scanout binding flags for staging resources
Icecream95 [Thu, 15 Apr 2021 21:45:48 +0000 (16 09:45 +1200)]
panfrost: Unset shared/scanout binding flags for staging resources

Fixes Xwayland crashes when starting non-GL applications.

Fixes: e00d94f14f7 ("panfrost: Enable AFBC buffer sharing")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>
(cherry picked from commit 3af12216e38ac9c4bdc4d8dc370d969e2a2b2976)

15 months agoRevert "glx: Lift sending the MakeCurrent request to top-level code"
Adam Jackson [Thu, 15 Apr 2021 18:25:09 +0000 (15 14:25 -0400)]
Revert "glx: Lift sending the MakeCurrent request to top-level code"

This provokes crashes in Cinnamon for some reason that I haven't
diagnosed yet.

This reverts commit 80b67a3b444f31462890a8e390650fa77c4d2010.

Fixes: 80b67a3b444 glx: Lift sending the MakeCurrent request to top-level code
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4639
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10260>
(cherry picked from commit fc9b3b260e08677aa78f74c0b4cf574175bd5d4d)

15 months agofreedreno: Fix YUV sampler regression.
Eric Anholt [Wed, 14 Apr 2021 22:09:18 +0000 (14 15:09 -0700)]
freedreno: Fix YUV sampler regression.

We have to keep sampler uniforms around for later YUV lowering, and we
only need to remove uniforms that take up storage space.  Code comes from
radeonsi.

Closes: #4644.
Fixes: de17b4aab568 ("freedreno: Remove uniform variables after finalizing NIR.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10246>
(cherry picked from commit 7d234da6ee3693286c2ad796c5c4c24856a86573)

15 months agotu: Correctly preserve old push descriptor contents
Connor Abbott [Tue, 10 Nov 2020 15:54:07 +0000 (10 16:54 +0100)]
tu: Correctly preserve old push descriptor contents

We were never setting set->size, so we were always copying 0 bytes. But
as we only copy the contents when the layout and therefore the size is
the same, we don't have to take the old size into account anyway.

This fixes some VK_EXT_robustness2 tests that use push descriptors.

Fixes: 6d4f33e ("turnip: initial implementation of VK_KHR_push_descriptor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
(cherry picked from commit cb02a48f831da750c4124ea6fa7c95861a4f4609)

15 months agoir3: Fix list corruption in legalize_block()
Connor Abbott [Tue, 10 Nov 2020 10:50:29 +0000 (10 11:50 +0100)]
ir3: Fix list corruption in legalize_block()

We forgot to remove the instruction under consideration from instr_list
before inserting it into the block's list, which caused instr_list to
become corrupted. This happened to work but caused further corruption in
some rare scenarios.

Fixes: adf1659 ("freedreno/ir3: use standard list implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
(cherry picked from commit 8e11f0560e80e6057d1149bca0b40c7e88a4d981)

15 months agoradv: fix barrier in radv_decompress_dcc_compute shader
Rhys Perry [Wed, 10 Mar 2021 10:42:15 +0000 (10 10:42 +0000)]
radv: fix barrier in radv_decompress_dcc_compute shader

ACO doesn't create a waitcnt for barriers between texture samples and
image stores because texture samples are supposed to use read-only
memory. It could also schedule the barrier to above the texture sample.
We also have use a larger memory scope to avoid an ACO optimization.

Tested on GFX8 with Sachsa Willems deferred sample. With some DCC
decompressions and the compute path forced.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 21.1 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9496>
(cherry picked from commit ec70882238683a95bc93387a12c2439488e2c084)

15 months agoradv: Allocate buffer list for MUTABLE descriptor types as well.
Hans-Kristian Arntzen [Mon, 12 Apr 2021 10:15:47 +0000 (12 12:15 +0200)]
radv: Allocate buffer list for MUTABLE descriptor types as well.

Fixes: 86644b84b94 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
(cherry picked from commit 08fdaec473c9596aba2fe9947eb800b0282bdf26)

15 months agoradv: Take image alignment into account when allocating MUTABLE pool.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 09:57:06 +0000 (9 11:57 +0200)]
radv: Take image alignment into account when allocating MUTABLE pool.

Allocating a descriptor set is aligned to 32 bytes, so just like the
other buffer types, bump the descriptor size to 32 bytes when allocating
MUTABLE descriptor types from a pool.

Fixes: 86644b84b94 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
(cherry picked from commit b60bc59180abbe4277c72fb25b085896ae7744d7)

15 months agov3dv: fix descriptor set limits
Iago Toral Quiroga [Thu, 15 Apr 2021 09:59:34 +0000 (15 11:59 +0200)]
v3dv: fix descriptor set limits

There were various issues here:
   - MAX_DYNAMIC_UNIFORM_BUFFERS was larger than MAX_UNIFORM_BUFFERS.
   - In some cases we were exposing more than the minimums required.
     While that is not incorrect, it is not following what we have
     been doing in general.
   - The Vulkan spec states that some of the MaxDescriptorSet limits
     need to be multipled by 6 to include all shader stages, even
     if the implementation doesn't support all shader stages.

Fixes: cbd299b051 ('v3dv/device: do not compute per-pipeline limits multiplying per-stage')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10252>
(cherry picked from commit e7e8464d94f0ab90d6695ac2d74e29fed87d9939)

15 months agopanfrost: Don't advertise AFBC mods when the format is not supported
Boris Brezillon [Wed, 14 Apr 2021 09:08:03 +0000 (14 11:08 +0200)]
panfrost: Don't advertise AFBC mods when the format is not supported

On Bifrost, AFBC is not supported if the format has a non-identity
swizzle. For internal resources we fix the format at runtime, but this
fixup is not applicable when we export the resource. Don't advertise
AFBC modifiers on such formats.

Fixes: 44217be92134 ("panfrost: Adjust the format for AFBC textures on Bifrost v7")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10233>
(cherry picked from commit 660b4d6e25011a2479538928419eed981a4cdf2f)

15 months agoaco/ra: remove live-in temporary from live_out_per_block when moving it
Rhys Perry [Wed, 14 Apr 2021 13:48:33 +0000 (14 14:48 +0100)]
aco/ra: remove live-in temporary from live_out_per_block when moving it

Otherwise, handle_loop_phis() might pass it to handle_live_in() and then
we could have two phis for this variable.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 7c64623e948 ("aco/ra: refactor SSA repairing during register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10236>
(cherry picked from commit 5b8a4516e6bd384ef20624624d0139931dc23037)

15 months agoaco/ra: use original names when renaming loop carried phi operands
Rhys Perry [Wed, 14 Apr 2021 15:02:00 +0000 (14 16:02 +0100)]
aco/ra: use original names when renaming loop carried phi operands

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 7c64623e948 ("aco/ra: refactor SSA repairing during register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10236>
(cherry picked from commit 11fde1247c291f836b28ad57984104a038e5cc51)

15 months ago.pick_status.json: Update to c74d93cf0187e07cdfacc448a947a8cae485eb41
Eric Engestrom [Sun, 18 Apr 2021 20:10:20 +0000 (18 22:10 +0200)]
.pick_status.json: Update to c74d93cf0187e07cdfacc448a947a8cae485eb41

15 months agofreedreno: Add missing foreach macros and update indentation
Rob Clark [Wed, 14 Apr 2021 23:48:04 +0000 (14 16:48 -0700)]
freedreno: Add missing foreach macros and update indentation

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

15 months agofreedreno: Manual fixups
Rob Clark [Fri, 5 Feb 2021 21:42:42 +0000 (5 13:42 -0800)]
freedreno: Manual fixups

Things I couldn't figure out how to get clang-format to not mess up.

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

15 months agofreedreno: Re-indent
Rob Clark [Wed, 14 Apr 2021 15:04:06 +0000 (14 08:04 -0700)]
freedreno: Re-indent

clang-format -fallback-style=none --style=file -i src/gallium/drivers/freedreno/*.[ch] src/gallium/drivers/freedreno/*/*.[ch]

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

15 months agofreedreno: Some manual reformatting
Rob Clark [Fri, 5 Feb 2021 20:26:16 +0000 (5 12:26 -0800)]
freedreno: Some manual reformatting

Take care of a few things that clang-format makes a hash of.

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

15 months agofreedreno: Add .clang-format
Rob Clark [Fri, 5 Feb 2021 20:22:59 +0000 (5 12:22 -0800)]
freedreno: Add .clang-format

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

15 months agoVERSION: bump to 21.1.0-rc1mesa-21.1.0-rc1
Eric Engestrom [Wed, 14 Apr 2021 19:47:27 +0000 (14 21:47 +0200)]
VERSION: bump to 21.1.0-rc1

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
15 months agoanv: bump internal descriptor index fields to 32bits21.1-branchpoint
Lionel Landwerlin [Wed, 14 Apr 2021 08:58:06 +0000 (14 11:58 +0300)]
anv: bump internal descriptor index fields to 32bits

Prior to supporting VK_EXT_descriptor_indexing all of our descriptor
limits where below 64k which fitted a uint16_t. Now all of those can
go up to 2^20 entries so we need 32bits indexes to keep track of them.

This change leaves the dynamic indexes at 16bits. We could arguably
bump them too, up to the reviewer's taste.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6e230d7607f9b3 ("anv: Implement VK_EXT_descriptor_indexing")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4636
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10228>

15 months agoac: add missing BUF_DATA_FORMAT_10_11_11 vertex format on GFX10+
Samuel Pitoiset [Wed, 14 Apr 2021 08:25:43 +0000 (14 10:25 +0200)]
ac: add missing BUF_DATA_FORMAT_10_11_11 vertex format on GFX10+

This format is supported by the driver.

Fixes vertex explosion in Dirt 5.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4635
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10226>

15 months agoir3/sched: Don't schedule too many tex/SFU instructions
Connor Abbott [Wed, 11 Nov 2020 14:31:09 +0000 (11 15:31 +0100)]
ir3/sched: Don't schedule too many tex/SFU instructions

Consider a simple loop that does a series of texture instructions and
then reduces the results:

vec4 sum = vec4(0);
for (int i = 0; i < N; i++) {
   sum += texture(...);
}

Assume that the loop is unrolled and we schedule the resulting basic
block. Right now, after we schedule the first texture instruction, the
only instructions available to schedule that don't incur a sync are the
instructions to setup the second texture instruction. So we keep picking
the texture instructions, no matter how large N is, resulting in a
pathological schedule for register pressure when N is very large:

sum1 = texture(...);
sum2 = texture(...);
sum3 = texture(...);
...
sum = sum1 + sum2 + sum3 + ...;

In particular this happens with some CTS tests for VK_EXT_robustness2,
where a loop like that with many iterations is marked as [[unroll]],
forcing NIR to unroll it.

This solution is a balance between the current approach and always
scheduling for register pressure (and ignoring sync's). We only allow a
certain number of texture fetches to be in flight before considering
textures to "sync", even though they don't really, both because they
likely *will* sync in reality (overflowing the internal queue of waiting
texture instructions) and because at some point we need the normal
algorithm to kick in and start lowering register pressure.

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

15 months agoir3/sched: Don't penalize uses of already-waited tex/SFU
Connor Abbott [Wed, 11 Nov 2020 14:04:22 +0000 (11 15:04 +0100)]
ir3/sched: Don't penalize uses of already-waited tex/SFU

Once we insert a use of a given tex or SFU instruction, then we must
wait for that tex/SFU instruction (as well as all earlier ones) to
complete, so we shouldn't penalize further uses, even if a subsequent
tex/SFU instruction gets scheduled after the first use. This especially
matters after the next commit when we start forcibly breaking up long
sequences of texture instructions, since if we schedule a group of 8
texture instructions then we want to schedule the uses of those
instructions in parallel with the next 8 texture instructions to reduce
register pressure.

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

15 months agozink: verify that source-format support linear-filter
Erik Faye-Lund [Wed, 14 Apr 2021 14:47:42 +0000 (14 16:47 +0200)]
zink: verify that source-format support linear-filter

Similar to the previous commit, we should also verify that the
source-format support linear-filter if we try to blit with it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10234>

15 months agozink: verify that src/dst support blitting
Erik Faye-Lund [Wed, 14 Apr 2021 14:03:38 +0000 (14 16:03 +0200)]
zink: verify that src/dst support blitting

Some Vulkan-drivers don't support blitting between all formats and
layouts. So let's verify this while blitting, and fall back to the
normal rendering code-path instead.

This fixes a crash on start-up in OpenArena on V3DV.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10234>

15 months agoradv/winsys: Remove use_local_bos
Bas Nieuwenhuizen [Wed, 14 Apr 2021 13:43:12 +0000 (14 15:43 +0200)]
radv/winsys: Remove use_local_bos

Now that perftest is stored in the winsys.

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

15 months agoradv: Use VRAM cmdbuffers in more situations.
Bas Nieuwenhuizen [Tue, 13 Apr 2021 01:14:54 +0000 (13 03:14 +0200)]
radv: Use VRAM cmdbuffers in more situations.

In most games I tested we use 32 MiB of cmdbuffers+cmd upload buffers
at most. Especially since we have mutable descriptors it seems
somewhat unlikely anything else will eat it up so be a bit more
aggressive allocating them in VRAM.

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

15 months agoradv: Refactor cs_domain to be a winsys function.
Bas Nieuwenhuizen [Tue, 13 Apr 2021 01:10:49 +0000 (13 03:10 +0200)]
radv: Refactor cs_domain to be a winsys function.

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

15 months agozink: do not dereference NULL pointer
Erik Faye-Lund [Wed, 14 Apr 2021 13:44:16 +0000 (14 15:44 +0200)]
zink: do not dereference NULL pointer

If first_frame_done isn't set, but fence is NULL, we end up dereferncing
that NULL-pointer.

This can happen in the case where the first submitted batch has no work,
and pfence was passed as a NULL-pointer.

While we're at it, simplify the check with the surrounding code, which
also checks for a NULL-pointer here.

Fixes: e93ca92d4ae ("zink: force explicit fence only on first frame flush")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10235>

15 months agoaco: Add a simple heuristic to decide early or late primitive export.
Timur Kristóf [Thu, 8 Apr 2021 15:40:28 +0000 (8 17:40 +0200)]
aco: Add a simple heuristic to decide early or late primitive export.

Late export is theoretically better if used with LATE_ALLOC,
but in practice, the early export has an advantage of
lower register usage, therefore more concurrent waves.

The idea of this commit is that "small" shaders benefit from early
primitive export more, due to being able to launch much more waves.

Let's consider a NIR shader "small" when it has only 1 block.
This yields both better performance, and better stats, than always
using late export.

Fossil DB on Sienna:

Totals from 12807 (8.76% of 146265) affected shaders:
VGPRs: 609128 -> 620216 (+1.82%); split: -0.01%, +1.83%
SpillSGPRs: 1458 -> 1538 (+5.49%)
CodeSize: 37028204 -> 37019320 (-0.02%); split: -0.17%, +0.14%
MaxWaves: 282902 -> 278516 (-1.55%)
Instrs: 7163142 -> 7162925 (-0.00%); split: -0.18%, +0.18%
VClause: 169285 -> 169547 (+0.15%); split: -1.15%, +1.30%
SClause: 267373 -> 267151 (-0.08%); split: -0.24%, +0.16%
Copies: 446442 -> 444567 (-0.42%); split: -2.68%, +2.26%
Branches: 156245 -> 156195 (-0.03%); split: -0.30%, +0.26%
PreSGPRs: 434701 -> 447396 (+2.92%)
PreVGPRs: 527783 -> 540527 (+2.41%)

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

15 months agoaco: Emit fewer branches for NGG VS/TES with late primitive export.
Timur Kristóf [Thu, 8 Apr 2021 15:37:13 +0000 (8 17:37 +0200)]
aco: Emit fewer branches for NGG VS/TES with late primitive export.

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

15 months agoaco: Set block_kind_export_end in create_vs/fs_exports.
Timur Kristóf [Thu, 8 Apr 2021 13:42:17 +0000 (8 15:42 +0200)]
aco: Set block_kind_export_end in create_vs/fs_exports.

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

15 months agoaco: Extract ngg_nogs_export_prim_id to a separate function.
Timur Kristóf [Thu, 8 Apr 2021 13:39:39 +0000 (8 15:39 +0200)]
aco: Extract ngg_nogs_export_prim_id to a separate function.

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

15 months agoaco: Use s_setprio 3 at the beginning of every VS and TES.
Timur Kristóf [Thu, 8 Apr 2021 11:38:13 +0000 (8 13:38 +0200)]
aco: Use s_setprio 3 at the beginning of every VS and TES.

The user-set priority of shaders matters very little, but we hope
this might still help speed up VS input loads especially.

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

15 months agoaco: Remove useless s_setprio near gs_alloc_req.
Timur Kristóf [Thu, 8 Apr 2021 11:32:01 +0000 (8 13:32 +0200)]
aco: Remove useless s_setprio near gs_alloc_req.

We learned that the gs_alloc_req is not actually when the export
space allocation happens. So it makes no sense to prioritize it.

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

15 months agozink: fall back from cached to non-cached memory
Erik Faye-Lund [Wed, 14 Apr 2021 11:35:34 +0000 (14 13:35 +0200)]
zink: fall back from cached to non-cached memory

This fixes basic rendering on top of V3DV, which doesn't seem to expose
the cached memory we expect and love.

Fixes: 598dc3dca41 ("zink: use cached memory for all resources when possible")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10230>

15 months agoaco: Align NGG scratch size to 16 so a single ds_read can always read it.
Timur Kristóf [Sat, 10 Apr 2021 12:51:56 +0000 (10 14:51 +0200)]
aco: Align NGG scratch size to 16 so a single ds_read can always read it.

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

15 months agoaco: Optimize workgroup exclusive scan to better avoid bank conflicts.
Timur Kristóf [Sat, 10 Apr 2021 12:52:55 +0000 (10 14:52 +0200)]
aco: Optimize workgroup exclusive scan to better avoid bank conflicts.

Previously, every wave had multiple active lanes read the LDS, and
the data was processed by VALU DPP instructions.

Now, only the first lane reads the LDS in order to avoid bank
conflicts, and the results are processed by SALU.

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

15 months agopanfrost: Fix pan_blitter_get_blit_shader()
Boris Brezillon [Wed, 14 Apr 2021 12:11:19 +0000 (14 14:11 +0200)]
panfrost: Fix pan_blitter_get_blit_shader()

The key passed to _mesa_hash_table_search() is wrong, fix it.

Fixes: 8ba2f9f69858 ("panfrost: Create a blitter library to replace the existing preload helpers")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10232>