platform/upstream/mesa.git
16 months agor600/sfn: move kill handling to fully scheduling
Gert Wollny [Sun, 14 May 2023 12:48:51 +0000 (14:48 +0200)]
r600/sfn: move kill handling to fully scheduling

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

16 months agor600: fix handling of use_sb flag
Gert Wollny [Sun, 14 May 2023 12:50:24 +0000 (14:50 +0200)]
r600: fix handling of use_sb flag

The compiler will use the unsigned bit pattern of the check and combine this
with the 1 bit, which will always result in use_sb to be zero.

Fix this by making use_sb a bool

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

16 months agozink: add a dgc debug mode for testing
Mike Blumenkrantz [Wed, 31 May 2023 15:20:17 +0000 (11:20 -0400)]
zink: add a dgc debug mode for testing

this is useful for drivers trying to implement DGC since there is no cts

do not use.

it will not make anything faster.

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

16 months agointel/fs: handle load_global_constant_uniform_block_intel
Lionel Landwerlin [Thu, 8 Jun 2023 18:53:02 +0000 (21:53 +0300)]
intel/fs: handle load_global_constant_uniform_block_intel

Again, load the data just once in GRF, share it across lanes.

Shader-db on dg2:

total instructions in shared programs: 23214555 -> 23215400 (<.01%)
instructions in affected programs: 199977 -> 200822 (0.42%)
helped: 3
HURT: 38
helped stats (abs) min: 5 max: 670 x̄: 283.67 x̃: 176
helped stats (rel) min: 1.34% max: 49.41% x̄: 22.15% x̃: 15.70%
HURT stats (abs)   min: 1 max: 185 x̄: 44.63 x̃: 32
HURT stats (rel)   min: 0.13% max: 42.86% x̄: 10.25% x̃: 9.30%
95% mean confidence interval for instructions value: -18.65 59.87
95% mean confidence interval for instructions %-change: 3.29% 12.47%
Inconclusive result (value mean confidence interval includes 0).

total loops in shared programs: 5928 -> 5928 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total cycles in shared programs: 851137495 -> 851152449 (<.01%)
cycles in affected programs: 16406137 -> 16421091 (0.09%)
helped: 9
HURT: 32
helped stats (abs) min: 10 max: 13498 x̄: 6443.22 x̃: 5581
helped stats (rel) min: 0.11% max: 4.75% x̄: 1.45% x̃: 0.34%
HURT stats (abs)   min: 3 max: 15056 x̄: 2279.47 x̃: 735
HURT stats (rel)   min: 0.10% max: 23.71% x̄: 4.58% x̃: 4.65%
95% mean confidence interval for cycles value: -1315.40 2044.87
95% mean confidence interval for cycles %-change: 1.71% 4.80%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 11856 -> 11825 (-0.26%)
spills in affected programs: 2368 -> 2337 (-1.31%)
helped: 4
HURT: 0

total fills in shared programs: 16258 -> 16207 (-0.31%)
fills in affected programs: 2930 -> 2879 (-1.74%)
helped: 4
HURT: 0

total sends in shared programs: 1038194 -> 1038185 (<.01%)
sends in affected programs: 40 -> 31 (-22.50%)
helped: 4
HURT: 0
helped stats (abs) min: 1 max: 4 x̄: 2.25 x̃: 2
helped stats (rel) min: 10.00% max: 33.33% x̄: 21.46% x̃: 21.25%
95% mean confidence interval for sends value: -4.64 0.14
95% mean confidence interval for sends %-change: -40.41% -2.51%
Inconclusive result (value mean confidence interval includes 0).

LOST:   0
GAINED: 0

Some VK/DX titles result (on DG2 only), it's mostly additional
instruction counts except for the unity spaceship demo where a CS
shader gets additional SIMDness. The reason for additional
instructions is that since we're doing block loads, we need to find
the live channels in control flow to select a single lane value that
is valid.

aztec_ruins_high:
Totals from 3 (1.12% of 269) affected shaders:
Instrs: 17732 -> 17896 (+0.92%)
Cycles: 796518 -> 819302 (+2.86%)

cyberpunk_2077:
Totals from 17 (0.17% of 10301) affected shaders:
Instrs: 10848 -> 11658 (+7.47%)
Cycles: 248243 -> 259168 (+4.40%); split: -0.57%, +4.97%

fallout_4_dxvk_g2:
Totals from 2 (0.12% of 1638) affected shaders:
Instrs: 3157 -> 3368 (+6.68%)
Cycles: 487807 -> 490426 (+0.54%); split: -0.26%, +0.79%
Max live registers: 139 -> 141 (+1.44%)

red_dead_redemption2:
Totals from 68 (1.14% of 5970) affected shaders:
Instrs: 34871 -> 36486 (+4.63%)
Cycles: 551430 -> 565211 (+2.50%)
Send messages: 2074 -> 2072 (-0.10%)
Max live registers: 5078 -> 5077 (-0.02%)

total_war_warhammer2:
Totals from 5 (1.05% of 478) affected shaders:
Instrs: 6905 -> 6971 (+0.96%); split: -0.16%, +1.12%
Cycles: 97035 -> 97989 (+0.98%); split: -0.07%, +1.05%

unity spaceship demo (instruction count going up due to a CS shader
                      bump from SIMD8->16):
Totals from 53 (9.71% of 546) affected shaders:
Instrs: 223748 -> 233223 (+4.23%); split: -0.01%, +4.25%
Cycles: 23134697 -> 25207080 (+8.96%); split: -0.17%, +9.13%
Subgroup size: 480 -> 488 (+1.67%)
Spill count: 2156 -> 2242 (+3.99%); split: -0.19%, +4.17%
Fill count: 4617 -> 4845 (+4.94%); split: -0.09%, +5.02%
Max live registers: 5991 -> 6050 (+0.98%); split: -0.40%, +1.39%
Max dispatch width: 480 -> 488 (+1.67%)

witcher_3_dxvk_g2:
Totals from 27 (2.51% of 1074) affected shaders:
Instrs: 57067 -> 57677 (+1.07%); split: -0.03%, +1.10%
Cycles: 1397871 -> 1436704 (+2.78%); split: -0.35%, +3.13%

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agonir: add a load_global_constant uniform intel variant
Lionel Landwerlin [Fri, 9 Jun 2023 10:57:43 +0000 (13:57 +0300)]
nir: add a load_global_constant uniform intel variant

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agointel/fs: make use of load_ubo_uniform_block_intel
Lionel Landwerlin [Tue, 6 Jun 2023 15:03:26 +0000 (18:03 +0300)]
intel/fs: make use of load_ubo_uniform_block_intel

The principle is the same as the load_ssbo_uniform_block_intel.
Whenever we see a uniform offset, load the data only once in GRFs to
reduce register pressure.

Iris shader-db run on DG2 :

total instructions in shared programs: 23001325 -> 23094969 (0.41%)
instructions in affected programs: 1775989 -> 1869633 (5.27%)
helped: 764
HURT: 2097
helped stats (abs) min: 1 max: 102 x̄: 6.96 x̃: 2
helped stats (rel) min: 0.03% max: 16.91% x̄: 1.36% x̃: 0.63%
HURT stats (abs)   min: 1 max: 2461 x̄: 47.19 x̃: 7
HURT stats (rel)   min: <.01% max: 199.34% x̄: 5.91% x̃: 2.60%
95% mean confidence interval for instructions value: 25.43 40.03
95% mean confidence interval for instructions %-change: 3.60% 4.33%
Instructions are HURT.

total loops in shared programs: 5847 -> 5847 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total cycles in shared programs: 839329852 -> 845491482 (0.73%)
cycles in affected programs: 130229434 -> 136391064 (4.73%)
helped: 1098
HURT: 2228
helped stats (abs) min: 1 max: 130102 x̄: 1340.64 x̃: 22
helped stats (rel) min: <.01% max: 64.25% x̄: 4.03% x̃: 0.71%
HURT stats (abs)   min: 1 max: 185309 x̄: 3426.24 x̃: 87
HURT stats (rel)   min: <.01% max: 92.85% x̄: 8.12% x̃: 3.82%
95% mean confidence interval for cycles value: 1342.16 2362.97
95% mean confidence interval for cycles %-change: 3.70% 4.52%
Cycles are HURT.

total spills in shared programs: 10768 -> 11856 (10.10%)
spills in affected programs: 9717 -> 10805 (11.20%)
helped: 25
HURT: 28

total fills in shared programs: 13720 -> 16258 (18.50%)
fills in affected programs: 12016 -> 14554 (21.12%)
helped: 25
HURT: 28

total sends in shared programs: 1034790 -> 1031266 (-0.34%)
sends in affected programs: 33416 -> 29892 (-10.55%)
helped: 1005
HURT: 0
helped stats (abs) min: 1 max: 22 x̄: 3.51 x̃: 3
helped stats (rel) min: 1.69% max: 60.00% x̄: 15.20% x̃: 14.08%
95% mean confidence interval for sends value: -3.72 -3.29
95% mean confidence interval for sends %-change: -15.82% -14.57%
Sends are helped.

LOST:   26
GAINED: 183

shader-db on a number of VK/DX titles on DG2 :

 PERCENTAGE DELTAS  Shaders   Instrs    Cycles
 age_of_wonders_III 1928      +0.02%    -0.19%

 PERCENTAGE DELTAS       Shaders   Instrs    Cycles  Subgroup size Send messages Spill count Fill count Max live registers Max dispatch width
 assassins_creed_odyssey 2119      +1.12%    -0.42%      -0.03%        -0.29%       -9.10%     -4.26%         -0.64%             +0.65%

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Spill count Fill count Max live registers
 aztec_ruins_high  269       -0.05%    -0.45%     -0.29%     -7.27%         -0.33%

 PERCENTAGE DELTAS    Shaders   Instrs    Cycles  Max live registers Max dispatch width
 dark_souls_3_dxvk_g2 1420      +0.09%    +0.24%        +0.21%             +0.12%

(stats look bad, but it's just one shader affected)
 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Spill count Fill count Scratch Memory Size Max live registers
 fallout_4_dxvk_g2 1638      +0.67%    +8.32%    +16.02%     +7.17%         +100.00%            +0.48%

 PERCENTAGE DELTAS    Shaders   Instrs    Cycles  Send messages Spill count Fill count Max live registers Max dispatch width
 red_dead_redemption2 5969      +0.16%    -0.04%      -0.04%       +0.01%     +0.05%         -0.20%             +0.04%

 PERCENTAGE DELTAS          Shaders   Instrs    Cycles  Send messages Max live registers Max dispatch width
 rise_of_the_tomb_raider_g2 12129     +2.19%    +1.36%      -1.23%          -0.36%             +2.04%

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers
 shooter-game      693       +0.07%    -0.89%      -0.09%          -0.09%

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers Max dispatch width
 talos_g2          1140      +0.37%    +3.80%      -0.86%          -0.67%             +0.19%

 PERCENTAGE DELTAS    Shaders   Instrs    Cycles  Max live registers Max dispatch width
 total_war_warhammer2 477       +0.25%    +0.66%        -0.17%             +0.10%

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers Max dispatch width
 witcher_3_dxvk_g2 1074      +0.75%   -10.45%      -0.15%          -0.16%             -0.16%

 PERCENTAGE DELTAS      Shaders   Instrs    Cycles  Send messages Max live registers
 wolfenstein_youngblood 1111      +0.52%    +0.66%      -0.59%          -0.03%

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agonir: add a new ubo uniform loading intrinsic for intel
Lionel Landwerlin [Tue, 6 Jun 2023 15:02:42 +0000 (18:02 +0300)]
nir: add a new ubo uniform loading intrinsic for intel

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agointel/fs: avoid reusing the VGRF for uniform load_ubo
Lionel Landwerlin [Tue, 13 Jun 2023 17:37:22 +0000 (20:37 +0300)]
intel/fs: avoid reusing the VGRF for uniform load_ubo

Only found 3 shaders affected in Red Dead Redemption :

Totals from 3 (0.05% of 5969) affected shaders:
Instrs: 2246 -> 2230 (-0.71%)
Cycles: 156506 -> 148402 (-5.18%); split: -5.23%, +0.05%

This will have a larger effect when we add the
load_ubo_uniform_block_intel intrinsic where we will have larger
blocks (vec8/vec16 vs vec4 only now).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agointel/fs: print identation for control flow
Lionel Landwerlin [Fri, 9 Jun 2023 08:48:26 +0000 (11:48 +0300)]
intel/fs: print identation for control flow

INTEL_DEBUG=optimizer output changes from :

{ 10}   40: cmp.nz.f0.0(8) null:F, vgrf3470:F, 0f
{ 10}   41: (+f0.0) if(8) (null):UD,
{ 11}   42: txf_logical(8) vgrf3473:UD, vgrf250:D(null):UD, 0d(null):UD(null):UD(null):UD(null):UD, 31u, 0u(null):UD(null):UD(null):UD, 3d, 0d
{ 12}   43: and(8) vgrf262:UD, vgrf3473:UD, 2u
{ 11}   44: cmp.nz.f0.0(8) null:D, vgrf262:D, 0d
{ 10}   45: (+f0.0) if(8) (null):UD,
{ 11}   46: mov(8) vgrf270:D, -1082130432d
{ 12}   47: mov(8) vgrf271:D, 1082130432d
{ 14}   48: mov(8) vgrf274+0.0:D, 0d
{ 14}   49: mov(8) vgrf274+1.0:D, 0d

to :

{ 10}   40: cmp.nz.f0.0(8) null:F, vgrf3470:F, 0f
{ 10}   41: (+f0.0) if(8) (null):UD,
{ 11}   42:   txf_logical(8) vgrf3473:UD, vgrf250:D(null):UD, 0d(null):UD(null):UD(null):UD(null):UD, 31u, 0u(null):UD(null):UD(null):UD, 3d, 0d
{ 12}   43:   and(8) vgrf262:UD, vgrf3473:UD, 2u
{ 11}   44:   cmp.nz.f0.0(8) null:D, vgrf262:D, 0d
{ 10}   45:   (+f0.0) if(8) (null):UD,
{ 11}   46:     mov(8) vgrf270:D, -1082130432d
{ 12}   47:     mov(8) vgrf271:D, 1082130432d
{ 14}   48:     mov(8) vgrf274+0.0:D, 0d
{ 14}   49:     mov(8) vgrf274+1.0:D, 0d

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23477>

16 months agorusticl/queue: overhaul of the queue+event handling
Karol Herbst [Tue, 13 Jun 2023 00:07:02 +0000 (02:07 +0200)]
rusticl/queue: overhaul of the queue+event handling

This new approach handles things as follows:
1. Fences won't be attached to events anymore, applications only wait on
   the cv attached to the event.
2. Only the queue is allowed to update event status for non user events.
   This will eliminate all remaining status updating races between the
   queue and applications waiting on events.
3. Queue minimized flushing by bundling events
4. Increase cv wait timeout as there is really no point in waking up too
   often.

Reduces amount of emited fences on radeonsi in luxmark 3.1 luxball by 90%

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed by Nora Allen <blackcatgames@protonmail.com>

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

16 months agobroadcom/compiler: only use last thread switch flag to detect final section
Iago Toral Quiroga [Thu, 13 Apr 2023 08:31:17 +0000 (10:31 +0200)]
broadcom/compiler: only use last thread switch flag to detect final section

Since commit 'c98ddc778a3 broadcom/compiler: force a last thrsw for spilling'
we always ensure we signal the last thread section explicitly with a
last thread switch.

Relying on VPM stores to detect the last thread section is particularly bad,
because we can have VPM stores occurring quite early in a shader program,
which would disable TMU spilling almost entirely.

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

16 months agobroadcom/compiler: clarify use of QFILE_VPM
Alejandro Piñeiro [Fri, 12 May 2023 12:04:56 +0000 (14:04 +0200)]
broadcom/compiler: clarify use of QFILE_VPM

This was only used for version < 40 (See commit 22a02f3e3).

Adding some extra explanations and asserts of places where it is used.

As we are here also move the definition of a register with QFILE_VPM,
to avoid defining it if not needed.

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

16 months agointel/fs: fix bindless/shared surface mistake
Lionel Landwerlin [Thu, 8 Jun 2023 22:05:34 +0000 (01:05 +0300)]
intel/fs: fix bindless/shared surface mistake

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 068bf1378d ("intel/fs: enable SSBO accesses through the bindless heap")
Tested-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23536>

16 months agoanv: enable CmdCopyQueryPoolResults to use shader for copies
Lionel Landwerlin [Tue, 16 May 2023 19:11:47 +0000 (22:11 +0300)]
anv: enable CmdCopyQueryPoolResults to use shader for copies

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agointel/ds: add query count in query tracepoints
Lionel Landwerlin [Tue, 13 Jun 2023 08:11:27 +0000 (11:11 +0300)]
intel/ds: add query count in query tracepoints

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: add shaders for copying query results
Lionel Landwerlin [Tue, 16 May 2023 18:59:33 +0000 (21:59 +0300)]
anv: add shaders for copying query results

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: generalize internal kernel concept
Lionel Landwerlin [Tue, 16 May 2023 13:10:31 +0000 (16:10 +0300)]
anv: generalize internal kernel concept

We'll add more of those kernels for other purposes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: add support for simple internal compute shaders
Lionel Landwerlin [Tue, 16 May 2023 10:13:41 +0000 (13:13 +0300)]
anv: add support for simple internal compute shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: factor out generation kernel dispatch into helper
Lionel Landwerlin [Tue, 16 May 2023 09:54:39 +0000 (12:54 +0300)]
anv: factor out generation kernel dispatch into helper

We would like to reuse this mechanism to dispatch different types of
internal shader. Those would replace some of the command streamer
commands we currently use.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: limit ANV_PIPE_RENDER_TARGET_BUFFER_WRITES to blorp operations using 3D
Lionel Landwerlin [Wed, 17 May 2023 10:40:14 +0000 (13:40 +0300)]
anv: limit ANV_PIPE_RENDER_TARGET_BUFFER_WRITES to blorp operations using 3D

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: fix incorrect batch for 3DSTATE_CONSTANT_ALL emission
Lionel Landwerlin [Tue, 16 May 2023 06:53:42 +0000 (09:53 +0300)]
anv: fix incorrect batch for 3DSTATE_CONSTANT_ALL emission

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: disable mesh/task for generated draws
Lionel Landwerlin [Tue, 16 May 2023 06:20:09 +0000 (09:20 +0300)]
anv: disable mesh/task for generated draws

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoanv: only disable mesh when enabled at the VkDevice level
Lionel Landwerlin [Tue, 16 May 2023 06:25:17 +0000 (09:25 +0300)]
anv: only disable mesh when enabled at the VkDevice level

Saving ourselves some instructions since it's not going to get used.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23074>

16 months agoradv: fix smooth lines with graphics pipeline library
Samuel Pitoiset [Wed, 24 May 2023 06:20:33 +0000 (08:20 +0200)]
radv: fix smooth lines with graphics pipeline library

Need to be defensive here.

Fixes recent CTS
dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.*.line_raster_mode_smooth.

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

16 months agoradv: do not force VRS 1x1 when smooth lines are enabled
Samuel Pitoiset [Wed, 24 May 2023 12:51:46 +0000 (14:51 +0200)]
radv: do not force VRS 1x1 when smooth lines are enabled

Otherwise this will break VRS with GPL.

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

16 months agoradv: add a helper for forcing VRS 1x1 in some situations
Samuel Pitoiset [Wed, 24 May 2023 12:44:54 +0000 (14:44 +0200)]
radv: add a helper for forcing VRS 1x1 in some situations

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

16 months agoradv: gather info about load_poly_line_smooth_enabled
Samuel Pitoiset [Wed, 24 May 2023 12:42:00 +0000 (14:42 +0200)]
radv: gather info about load_poly_line_smooth_enabled

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

16 months agoradv/video: reject unsupported hevc profiles and bit depths
Lynne [Tue, 13 Jun 2023 15:50:29 +0000 (17:50 +0200)]
radv/video: reject unsupported hevc profiles and bit depths

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23625>

16 months agoradv/video: reject non-8bit H264
Lynne [Tue, 13 Jun 2023 15:50:07 +0000 (17:50 +0200)]
radv/video: reject non-8bit H264

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23625>

16 months agoradv/video: reject general unsupported video formats
Lynne [Tue, 13 Jun 2023 15:40:50 +0000 (17:40 +0200)]
radv/video: reject general unsupported video formats

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23625>

16 months agosvga: fix shader type after ntt
Charmaine Lee [Wed, 14 Jun 2023 00:14:41 +0000 (03:14 +0300)]
svga: fix shader type after ntt

Set shader type to TGSI after ntt. Fixes assert in svga_create_shader.

Fixes: 0ac95418048 ("gallium: Drop PIPE_SHADER_CAP_PREFERRED_IR")

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23638>

16 months agozink: add some ntv asserts for ms txf
Mike Blumenkrantz [Mon, 8 May 2023 12:55:03 +0000 (08:55 -0400)]
zink: add some ntv asserts for ms txf

it's illegal to do ms txf without a ms image

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

16 months agozink: assert that ntv image creation isn't clobbering existing images
Mike Blumenkrantz [Mon, 8 May 2023 12:54:26 +0000 (08:54 -0400)]
zink: assert that ntv image creation isn't clobbering existing images

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

16 months agozink: massively shrink qbo size for timestamp queries
Mike Blumenkrantz [Tue, 13 Jun 2023 17:12:37 +0000 (13:12 -0400)]
zink: massively shrink qbo size for timestamp queries

timestamp queries can only ever record a single value, so
the qbo only needs to be large enough for that single value

fixes #9092

cc: mesa-stable

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

16 months agoradv/video: program hevc max dec pic buffering correctly
Dave Airlie [Tue, 13 Jun 2023 00:44:33 +0000 (10:44 +1000)]
radv/video: program hevc max dec pic buffering correctly

This programs it like vaapi does.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23613>

16 months agoradv/video: program frame number correctly.
Dave Airlie [Mon, 12 Jun 2023 01:48:58 +0000 (11:48 +1000)]
radv/video: program frame number correctly.

doesn't appear to fix anything, but is more correct.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23613>

16 months agoanv: always report all pipeline stats regardless of stages
Lionel Landwerlin [Fri, 9 Jun 2023 13:52:17 +0000 (16:52 +0300)]
anv: always report all pipeline stats regardless of stages

Tools like the scripts in shader-db expect all the fields to be there,
as the stats are put into a CSV file. So just report 0 if a stage
doesn't support workgroup memory size.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23559>

16 months agoanv: report max simd width only once for fragment shaders
Lionel Landwerlin [Fri, 9 Jun 2023 13:32:17 +0000 (16:32 +0300)]
anv: report max simd width only once for fragment shaders

Reporting the value multiple times is confusing to shader-db scripts
because it believes multiple shaders are affected.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23559>

16 months agoanv: deal with unsupported VkImageFormatListCreateInfo::pViewFormats
Lionel Landwerlin [Mon, 12 Jun 2023 18:05:44 +0000 (21:05 +0300)]
anv: deal with unsupported VkImageFormatListCreateInfo::pViewFormats

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 697ed61e7c ("anv: Improve image/view usage bits verification")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9190
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23606>

16 months agoradv: Enable ray tracing pipelines by default
Friedrich Vock [Mon, 12 Jun 2023 17:50:55 +0000 (19:50 +0200)]
radv: Enable ray tracing pipelines by default

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

16 months agoradv: Add RADV_DEBUG=nort
Friedrich Vock [Mon, 12 Jun 2023 17:41:18 +0000 (19:41 +0200)]
radv: Add RADV_DEBUG=nort

This makes vkCmdTraceRaysKHR and ray queries no-ops and is useful
for triaging GPU hangs with raytracing.

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

16 months agolavapipe: use PACKAGE_VERSION for cache uuid in release builds
Mike Blumenkrantz [Wed, 4 Jan 2023 15:22:57 +0000 (10:22 -0500)]
lavapipe: use PACKAGE_VERSION for cache uuid in release builds

MESA_GIT_SHA1 is defined as "", which results in invalid access

fixes #7673

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20520>

16 months agoradv: directly use vk_format_map for vertex input
Mike Blumenkrantz [Thu, 8 Jun 2023 14:17:26 +0000 (10:17 -0400)]
radv: directly use vk_format_map for vertex input

this is much faster than calling a non-inline function with
conditionals to index the same array

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

16 months agovk: make vk_format_map[] public
Mike Blumenkrantz [Thu, 8 Jun 2023 14:16:54 +0000 (10:16 -0400)]
vk: make vk_format_map[] public

having to go through a function call for non-planar mappings can be
very slow

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

16 months agoetnaviv: only emit sampler config for changed samplers
Lucas Stach [Sun, 11 Jun 2023 18:29:06 +0000 (20:29 +0200)]
etnaviv: only emit sampler config for changed samplers

Currently SAMPLER_CONFIG0 is always emitted to either update the active
configuration or disable the sampler. With NTE this always emits 32 state
dwords, while there are a lot of cases that only use a small number of
samplers and never change the other samplers from their disabled state.

Track the active samplers from the last emit, so we can skip the state
emission when the sampler is already disabled. Only emit the full state
after a context flush where we don't know the previous sampler state of
the GPU.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23579>

16 months agozink: only try to create srgb mutable images if the vk format is supported
Mike Blumenkrantz [Thu, 8 Jun 2023 01:21:04 +0000 (21:21 -0400)]
zink: only try to create srgb mutable images if the vk format is supported

otherwise this is just a regular single-format image

cc: mesa-stable

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

16 months agoradv: tweak gfx pipeline stage binding
Mike Blumenkrantz [Wed, 7 Jun 2023 21:00:42 +0000 (17:00 -0400)]
radv: tweak gfx pipeline stage binding

iterating all the stages like this ends up unnecessarily calling
through to geometry stage binds when no shader was bound and no shader
is being bound by the power of optimization, so instead only do the unbind
part for the stages that are being unbound

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23600>

16 months agonir: Remove non-scoped barriers
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:55:35 +0000 (16:55 -0400)]
nir: Remove non-scoped barriers

Nothing uses them anymore.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agoradeonsi: Scan for scoped barriers
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:53:46 +0000 (16:53 -0400)]
radeonsi: Scan for scoped barriers

Instead of control barriers, radeonsi doesn't see those anymore.

Fixes: 2d1859b01e3 ("radeonsi: always use scoped barrier")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agonir: Remove handling for non-scoped barriers
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:51:54 +0000 (16:51 -0400)]
nir: Remove handling for non-scoped barriers

Nothing generates them so this is all dead.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agonir/tests: Use scoped barriers internally
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:48:09 +0000 (16:48 -0400)]
nir/tests: Use scoped barriers internally

Test what drivers actually use.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agotreewide: Remove use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:45:22 +0000 (16:45 -0400)]
treewide: Remove use_scoped_barrier

It is now set by all relevant drivers and not checked anywhere.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agottn: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:45:09 +0000 (16:45 -0400)]
ttn: Assume use_scoped_barrier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agonir: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:44:41 +0000 (16:44 -0400)]
nir: Assume use_scoped_barrier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agovtn: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:43:43 +0000 (16:43 -0400)]
vtn: Assume use_scoped_barrier

True for all backends supporting barriers. This lets us collapse lots of code,
since scoped_barriers are based on the SPIR-V definition.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agoglsl: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:43:26 +0000 (16:43 -0400)]
glsl: Assume use_scoped_barrier

True for all backends supporting barriers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agoac/llvm: Drop memory_barrier_buffer impl
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:37:50 +0000 (16:37 -0400)]
ac/llvm: Drop memory_barrier_buffer impl

Both radeonsi and radv use scoped barriers, so this should not be possible to
hit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agontt: Use scoped barriers
Alyssa Rosenzweig [Tue, 23 May 2023 17:55:43 +0000 (13:55 -0400)]
ntt: Use scoped barriers

In addition to bringing us one backend closer to the scoped-only future, this
improves the generated code in cases like:

   memoryBarrierBuffer();
   memoryBarrierShared();
   controlBarrier();

With scoped_barriers + nir_opt_combine_barriers, we now emit only one MEMBAR
instruction (and a BARRIER) rather than two MEMBARs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agottn: Emit scoped barriers when needed
Alyssa Rosenzweig [Tue, 23 May 2023 17:41:59 +0000 (13:41 -0400)]
ttn: Emit scoped barriers when needed

As we start converting more backends over.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agoir3: Drop reference to unsupported intrinsic
Alyssa Rosenzweig [Tue, 23 May 2023 14:52:02 +0000 (10:52 -0400)]
ir3: Drop reference to unsupported intrinsic

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agovtn: Handle atomic counter semantics
Alyssa Rosenzweig [Wed, 7 Jun 2023 11:59:26 +0000 (07:59 -0400)]
vtn: Handle atomic counter semantics

This can happen for GLSL-environment SPIR-V.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Suggested-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

16 months agoci: temporarily disable lima farm
Erico Nunes [Tue, 13 Jun 2023 11:37:36 +0000 (13:37 +0200)]
ci: temporarily disable lima farm

The lab is currently experiencing network instability with the ISP.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23623>

16 months agor600: tgsi cleanup
Thomas H.P. Andersen [Thu, 8 Jun 2023 21:51:53 +0000 (23:51 +0200)]
r600: tgsi cleanup

337dc7d76604e646f1a85615ab2d9d238427bf46 removed the usage of these
fields in struct r600_shader_ctx

Cleaning this up will let us drop tgsi_array_info in a later MR

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

16 months agodocs: improve OpenCL features
Karol Herbst [Tue, 13 Jun 2023 14:02:23 +0000 (16:02 +0200)]
docs: improve OpenCL features

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed by Nora Allen <blackcatgames@protonmail.com>

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

16 months agoradv: Leave primitive reset index at max on GFX8+.
Timur Kristóf [Tue, 6 Jun 2023 08:17:16 +0000 (10:17 +0200)]
radv: Leave primitive reset index at max on GFX8+.

GFX8+ only compares the bits according to the index type by default
(GFX9 can be changed by VGT_MULTI_PRIM_IB_RESET_EN.MATCH_ALL_BITS),
so we can always leave the programmed value at the maximum.

This reduces context rolls on GFX8+ when primitive restart is used.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
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/23459>

16 months agoradv: Remove primitive reset index from late scissor workaround.
Timur Kristóf [Tue, 6 Jun 2023 08:17:16 +0000 (10:17 +0200)]
radv: Remove primitive reset index from late scissor workaround.

Primitive reset has a corresponding dirty state which is already
included the used_states so it is not necessary to also check
the primitive reset index here.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
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/23459>

16 months agoetnaviv: add support for performance warnings
Christian Gmeiner [Wed, 7 Jun 2023 15:14:49 +0000 (17:14 +0200)]
etnaviv: add support for performance warnings

These performance warnings should help to get a better understanding
where we doing non performance optimal things.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23615>

16 months agoanv: use workaround framework for 1408224581, 14014097488
Tapani Pälli [Mon, 12 Jun 2023 13:37:06 +0000 (16:37 +0300)]
anv: use workaround framework for 140822458114014097488

This makes sure we apply WA only when it is required, these issues
do not happen for later MTL steppings.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

16 months agoiris: use workaround framework for 1408224581, 14014097488
Tapani Pälli [Mon, 12 Jun 2023 13:25:18 +0000 (16:25 +0300)]
iris: use workaround framework for 140822458114014097488

This makes sure we apply WA only when it is required, these issues
do not happen for later MTL steppings.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

16 months agointel/dev: add parentheses around intel_needs_workaround macro
Tapani Pälli [Mon, 12 Jun 2023 18:26:38 +0000 (21:26 +0300)]
intel/dev: add parentheses around intel_needs_workaround macro

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

16 months agor300: be more agressive when merging A0 loads
Pavel Ondračka [Wed, 7 Jun 2023 13:48:00 +0000 (15:48 +0200)]
r300: be more agressive when merging A0 loads

Specifically we would bail out previously when encountering any
control flow, now we would optimize it even when the second ARL/ARR
is inside a lower level if/else branch.

shader-db

RV530:
total instructions in shared programs: 132020 -> 131924 (-0.07%)
instructions in affected programs: 3374 -> 3278 (-2.85%)
helped: 4
HURT: 0

RV370:
no change (no control flow there)

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agor300: remove duplicate ARRs
Pavel Ondračka [Wed, 7 Jun 2023 13:36:16 +0000 (15:36 +0200)]
r300: remove duplicate ARRs

We already do this for ARL, so just generalize the pass.

shader-db

RV530:
total instructions in shared programs: 132235 -> 132020 (-0.16%)
instructions in affected programs: 8492 -> 8277 (-2.53%)
helped: 41
HURT: 1
total temps in shared programs: 16900 -> 16887 (-0.08%)
temps in affected programs: 83 -> 70 (-15.66%)
helped: 13
HURT: 0

RV370:
total instructions in shared programs: 82395 -> 82320 (-0.09%)
instructions in affected programs: 4715 -> 4640 (-1.59%)
helped: 33
HURT: 1
total temps in shared programs: 12316 -> 12305 (-0.09%)
temps in affected programs: 75 -> 64 (-14.67%)
helped: 11
HURT: 0

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agor300: optimize the load A0 pattern from wined3d
Pavel Ondračka [Fri, 9 Jun 2023 12:32:47 +0000 (14:32 +0200)]
r300: optimize the load A0 pattern from wined3d

Shader-db

RV530:
total instructions in shared programs: 129701 -> 128733 (-0.75%)
instructions in affected programs: 7011 -> 6043 (-13.81%)
helped: 48
HURT: 0
total loops in shared programs: 15 -> 11 (-26.67%)
loops in affected programs: 4 -> 0
helped: 4
HURT: 0
total temps in shared programs: 16819 -> 16832 (0.08%)
temps in affected programs: 70 -> 83 (18.57%)
helped: 0
HURT: 13
total consts in shared programs: 90830 -> 90813 (-0.02%)
consts in affected programs: 4335 -> 4318 (-0.39%)
helped: 17
HURT: 0

RV370:
total instructions in shared programs: 82027 -> 81215 (-0.99%)
instructions in affected programs: 5456 -> 4644 (-14.88%)
helped: 39
HURT: 0
total temps in shared programs: 12262 -> 12273 (0.09%)
temps in affected programs: 64 -> 75 (17.19%)
helped: 0
HURT: 11
total consts in shared programs: 79119 -> 79104 (-0.02%)
consts in affected programs: 3825 -> 3810 (-0.39%)
helped: 15
HURT: 0
GAINED:5

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9157
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agor300: move the ROUND+ARL->ARR fusing to main optimization loop
Pavel Ondračka [Wed, 7 Jun 2023 12:02:47 +0000 (14:02 +0200)]
r300: move the ROUND+ARL->ARR fusing to main optimization loop

Its particularly important to have the copy-propagate pass run first.
So that when the round is vectorized, we don't have to follow the MOVs
to find out if it leads to ARL or not (we don't vectorize ARR/ARL at the
moment).

No shader-db change.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agor300: move the ARL merging pass up in the opt loop
Pavel Ondračka [Wed, 7 Jun 2023 10:44:28 +0000 (12:44 +0200)]
r300: move the ARL merging pass up in the opt loop

Specifically after the first copy propagate run but before the
second one. Removal of ARLs will enable the copy propagate to be more
aggresive, as it is very carefull in such cases.

shader-db

RV530:
total instructions in shared programs: 131861 -> 131503 (-0.27%)
instructions in affected programs: 23949 -> 23591 (-1.49%)
helped: 199
HURT: 15
total temps in shared programs: 16997 -> 16903 (-0.55%)
temps in affected programs: 767 -> 673 (-12.26%)
helped: 69
HURT: 9

RV370:
total instructions in shared programs: 82360 -> 82027 (-0.40%)
instructions in affected programs: 19516 -> 19183 (-1.71%)
helped: 183
HURT: 15
total temps in shared programs: 12370 -> 12262 (-0.87%)
temps in affected programs: 664 -> 556 (-16.27%)
helped: 73
HURT: 0

The hurt programs are due to some constant load being copy propagated
which leads to bad interaction with source conflict resolve pass later.

v2: add missing shader type initialized to the tests. Previously we were
checking for has_omod which also practically means we have a fragment
shader, however its less readable.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agor300: move nir stuff to r300_nir file
Pavel Ondračka [Wed, 7 Jun 2023 13:11:47 +0000 (15:11 +0200)]
r300: move nir stuff to r300_nir file

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

16 months agozink/ci: enable zink-radv-vangogh-valve for pre-merge testing
Martin Roukala (né Peres) [Mon, 6 Mar 2023 13:30:07 +0000 (15:30 +0200)]
zink/ci: enable zink-radv-vangogh-valve for pre-merge testing

This should allow us to catch regressions without me having to bisect
them after they land :p

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8396
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

16 months agozink/ci: add more tests to the flake list of vangogh
Martin Roukala (né Peres) [Sat, 10 Jun 2023 08:07:02 +0000 (11:07 +0300)]
zink/ci: add more tests to the flake list of vangogh

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

16 months agoci/b2c: change the default first-console-activity timeout to 2 minutes
Martin Roukala (né Peres) [Sun, 11 Jun 2023 06:24:34 +0000 (09:24 +0300)]
ci/b2c: change the default first-console-activity timeout to 2 minutes

Having a high value for the first activity timeout made sense back in
the days when the machine may not be associated with salad early... but
this isn't the case anymore!

So let's go with a very conservative value of 2 minutes to boot :)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

16 months agobroadcom/ci: update expected results
Juan A. Suarez Romero [Tue, 13 Jun 2023 09:05:01 +0000 (11:05 +0200)]
broadcom/ci: update expected results

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23617>

16 months agogallium: Rename dri_init_screen_helper into dri_init_screen
Corentin Noël [Tue, 13 Jun 2023 09:25:38 +0000 (11:25 +0200)]
gallium: Rename dri_init_screen_helper into dri_init_screen

Makes it more obvious that this function is actually initializing the dri_screen
and not some helper.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agogallium: Use the common destroy function on screen initialization failure
Corentin Noël [Wed, 24 May 2023 14:41:57 +0000 (16:41 +0200)]
gallium: Use the common destroy function on screen initialization failure

Avoid leaking configuration options on initialization failure.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agogallium: Only call dri_init_options when the screen is actually created
Corentin Noël [Wed, 24 May 2023 14:32:26 +0000 (16:32 +0200)]
gallium: Only call dri_init_options when the screen is actually created

Avoid calling this function on screen creation failure as we will discard its
result right after.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agopipe-loader: Do not destroy the winsys on screen creation failure
Corentin Noël [Wed, 24 May 2023 14:23:35 +0000 (16:23 +0200)]
pipe-loader: Do not destroy the winsys on screen creation failure

The winsys is always destroyed on pipe_loader_device release.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9020
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agopipe-loader: Document the behavior regarding screen creating failures
Corentin Noël [Wed, 24 May 2023 14:23:02 +0000 (16:23 +0200)]
pipe-loader: Document the behavior regarding screen creating failures

Avoid inconsistent behavior on screen creation failures which might lead
to double free issues.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agogallium: Rename dri_destroy_screen_helper into dri_release_screen
Corentin Noël [Wed, 24 May 2023 14:10:18 +0000 (16:10 +0200)]
gallium: Rename dri_destroy_screen_helper into dri_release_screen

This function is actually used before the use of dri_init_screen_helper so
it is not exactly releasing the memory allocated by the screen helper.

Also clear the base.screen variable after destroy to make this function
reentrant.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agogallium: Incorporate the device release in dri_destroy_screen_helper
Corentin Noël [Wed, 24 May 2023 14:02:18 +0000 (16:02 +0200)]
gallium: Incorporate the device release in dri_destroy_screen_helper

The code to release the device was actually always used after the call
to this function.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

16 months agoradv/ci: update the list of expected failures on STONEY
Samuel Pitoiset [Thu, 25 May 2023 09:58:37 +0000 (11:58 +0200)]
radv/ci: update the list of expected failures on STONEY

Spurious changes but the failures are weird anyways.

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

16 months agoradv: disable HTILE compression only when layouts are compressed
Samuel Pitoiset [Wed, 24 May 2023 14:10:43 +0000 (16:10 +0200)]
radv: disable HTILE compression only when layouts are compressed

On RDNA2, VRS rates are part of the HTILE buffer but if we disable
HTILE completely for eg. GENERAL, VRS rates aren't read by the hw.

Fix this by disabling HTILE compression which should have the same
effect without VRS.

Fixes recent
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.attachment_rate.misc.*

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

16 months agoradv: emit DB_RENDER_CONTROL as part of the framebuffer
Samuel Pitoiset [Wed, 24 May 2023 13:56:08 +0000 (15:56 +0200)]
radv: emit DB_RENDER_CONTROL as part of the framebuffer

DB_RENDER_CONTROL controls whether depth/stencil rendering should be
compressed. Emitting this register as part of the framebuffer will
allow us to keep HTILE enabled for VRS rates, instead of disabling it
completely.

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

16 months agoradv: reset more DB registers when emitting a null ds target
Samuel Pitoiset [Thu, 25 May 2023 07:15:16 +0000 (09:15 +0200)]
radv: reset more DB registers when emitting a null ds target

PAL does that.

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

16 months agoradv: add a helper for emitting a null depth/stencil target
Samuel Pitoiset [Thu, 25 May 2023 06:53:26 +0000 (08:53 +0200)]
radv: add a helper for emitting a null depth/stencil target

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

16 months agoradeonsi: enable aco support for compute shader
Qiang Yu [Tue, 6 Jun 2023 02:04:11 +0000 (10:04 +0800)]
radeonsi: enable aco support for compute shader

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

16 months agoradeonsi: fix crash when AMD_DEBUG=cs,initnir
Qiang Yu [Wed, 7 Jun 2023 06:47:12 +0000 (14:47 +0800)]
radeonsi: fix crash when AMD_DEBUG=cs,initnir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

16 months agoac/llvm,radeonsi: lower nir_load_user_data_amd in abi
Qiang Yu [Tue, 6 Jun 2023 03:26:56 +0000 (11:26 +0800)]
ac/llvm,radeonsi: lower nir_load_user_data_amd in abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

16 months agoradeonsi: add scratch_offset arg for aco cs
Qiang Yu [Tue, 6 Jun 2023 02:04:52 +0000 (10:04 +0800)]
radeonsi: add scratch_offset arg for aco cs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

16 months agost/glsl: move linking code to the same st file
Timothy Arceri [Fri, 9 Jun 2023 04:49:01 +0000 (14:49 +1000)]
st/glsl: move linking code to the same st file

Since they call one another this makes it easier to see what is
going on without looking in multiple files.

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

16 months agodxil: Remove custom SSBO lowering
Jesse Natalie [Mon, 22 May 2023 22:15:09 +0000 (15:15 -0700)]
dxil: Remove custom SSBO lowering

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

16 months agomicrosoft/compiler: Don't over-align raw buffer load/store intrinsics
Jesse Natalie [Mon, 22 May 2023 23:38:25 +0000 (16:38 -0700)]
microsoft/compiler: Don't over-align raw buffer load/store intrinsics

DXC doesn't generate these for raw loads/stores, only structured, and
old WARP had bugs with this.

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

16 months agomicrosoft/compiler: Don't lower bit sizes for movs
Jesse Natalie [Mon, 22 May 2023 22:11:55 +0000 (15:11 -0700)]
microsoft/compiler: Don't lower bit sizes for movs

Otherwise we run into problems by putting this optimization loop
before I/O lowering, where there might still be 8-bit values that
haven't been lowered to 16 or 32. Once that's done, any remaining
movs or vec ops will have higher bit sizes already.

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