platform/upstream/mesa.git
15 months agofreedreno/fdperf: Use common device info helpers
Rob Clark [Fri, 30 Jun 2023 14:50:11 +0000 (07:50 -0700)]
freedreno/fdperf: Use common device info helpers

Manually constructing the chip-id will stop working with future devices.
And now that we get the generation from the device table, we can't be
sloppy about using a bogus dev_id.

Fixes: 00900b76e0f4 ("freedreno: Decouple GPU gen from gpu_id/chip_id")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23953>

15 months agovulkan/pipeline_cache: Introduce weak reference mode.
Tatsuyuki Ishi [Tue, 27 Jun 2023 12:40:49 +0000 (21:40 +0900)]
vulkan/pipeline_cache: Introduce weak reference mode.

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

15 months agovulkan/pipeline_cache: Move cache_object_unref out of header.
Tatsuyuki Ishi [Tue, 27 Jun 2023 12:23:10 +0000 (21:23 +0900)]
vulkan/pipeline_cache: Move cache_object_unref out of header.

For future use where private functions are called from unref code.

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

15 months agovulkan/pipeline_cache: Move locking outside of remove_object.
Tatsuyuki Ishi [Tue, 27 Jun 2023 12:21:41 +0000 (21:21 +0900)]
vulkan/pipeline_cache: Move locking outside of remove_object.

To match a future use case better.

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

15 months agovulkan/pipeline_cache: Do not consume object passed into remove_object.
Tatsuyuki Ishi [Tue, 27 Jun 2023 12:20:38 +0000 (21:20 +0900)]
vulkan/pipeline_cache: Do not consume object passed into remove_object.

Future use case will require removing an object with zero ref count, so
leave it up to the caller to call unref.

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

15 months agodocs/features: update anv entries
Lionel Landwerlin [Mon, 3 Jul 2023 09:15:10 +0000 (12:15 +0300)]
docs/features: update anv entries

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

15 months agoRevert "ci: disable Collabora's LAVA lab for maintance"
Sergi Blanch Torne [Tue, 20 Jun 2023 15:01:58 +0000 (17:01 +0200)]
Revert "ci: disable Collabora's LAVA lab for maintance"

This reverts commit https://gitlab.freedesktop.org/mesa/mesa/-/commit/1cf56af7cad410ba81d27e4df5c0c53ac106a7ab

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23760>

15 months agoci/microsoft: partly revert rename from container-rules to manual-rules
David Heidelberg [Mon, 3 Jul 2023 10:47:49 +0000 (12:47 +0200)]
ci/microsoft: partly revert rename from container-rules to manual-rules

We need to keep container job as a manual one, while others are always
disabled.

Fixes: c9de0d297743 ("ci/microsoft: rename manual rules according to rest introduced rules")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23968>

15 months agoci: when touching farms, never run manual jobs
David Heidelberg [Mon, 3 Jul 2023 10:44:48 +0000 (12:44 +0200)]
ci: when touching farms, never run manual jobs

It's implied, that in moments of enabling farm manual jobs never run.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23968>

15 months agotu/kgsl: Fix memory overwrite with vkFlushMappedMemoryRanges when more than 1 range
Shan-Min Chao [Wed, 7 Jun 2023 16:49:45 +0000 (09:49 -0700)]
tu/kgsl: Fix memory overwrite with vkFlushMappedMemoryRanges when more than 1 range

Fixes: 5a594109623fff43fcd3b874b160c711e81bf55d ("turnip: add cached and cached-coherent memory types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23504>

15 months agoaco: remove 64-bit integer conversion opcodes
Rhys Perry [Tue, 27 Jun 2023 18:54:56 +0000 (19:54 +0100)]
aco: remove 64-bit integer conversion opcodes

These are handled by nir_lower_int64 now.

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

15 months agoradeonsi: use nir_lower_conv64
Rhys Perry [Wed, 28 Jun 2023 16:10:28 +0000 (17:10 +0100)]
radeonsi: use nir_lower_conv64

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

15 months agoradv: call nir_lower_int64 later
Rhys Perry [Tue, 27 Jun 2023 18:23:39 +0000 (19:23 +0100)]
radv: call nir_lower_int64 later

I would rather this be after several of these complicated lowering passes.

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

15 months agoradv: use nir_lower_conv64
Rhys Perry [Tue, 27 Jun 2023 18:22:42 +0000 (19:22 +0100)]
radv: use nir_lower_conv64

This has a more accurate i2f/u2f implementation.

fossil-db (navi21):
Totals from 342 (0.26% of 133461) affected shaders:
MaxWaves: 10480 -> 10472 (-0.08%)
Instrs: 273455 -> 274019 (+0.21%); split: -0.02%, +0.22%
CodeSize: 1545020 -> 1546852 (+0.12%); split: -0.11%, +0.23%
VGPRs: 9528 -> 9552 (+0.25%)
SpillSGPRs: 553 -> 592 (+7.05%); split: -2.71%, +9.76%
SpillVGPRs: 821 -> 811 (-1.22%); split: -1.71%, +0.49%
Latency: 3837590 -> 3822989 (-0.38%); split: -0.52%, +0.14%
InvThroughput: 1284512 -> 1277012 (-0.58%); split: -0.77%, +0.19%
VClause: 6480 -> 6486 (+0.09%); split: -0.15%, +0.25%
SClause: 6640 -> 6645 (+0.08%); split: -0.02%, +0.09%
Copies: 45858 -> 46160 (+0.66%); split: -0.10%, +0.76%
Branches: 8736 -> 8741 (+0.06%); split: -0.01%, +0.07%
PreSGPRs: 14320 -> 14323 (+0.02%)
PreVGPRs: 8545 -> 8551 (+0.07%)

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

15 months agonir: split nir_lower_mov64
Rhys Perry [Tue, 27 Jun 2023 18:19:39 +0000 (19:19 +0100)]
nir: split nir_lower_mov64

ACO will want to lower the conversions, but preserve the bcsels.

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

15 months agoradv: Enable required subgroup size on mesh/task.
Timur Kristóf [Thu, 29 Jun 2023 12:39:04 +0000 (14:39 +0200)]
radv: Enable required subgroup size on mesh/task.

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

15 months agoradv: Use required subgroup info for graphics shaders.
Timur Kristóf [Thu, 29 Jun 2023 12:38:09 +0000 (14:38 +0200)]
radv: Use required subgroup info for graphics shaders.

We plan to allow setting this on some graphics shader stages.

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

15 months agoradv: Refactor required subgroup size in pipeline key.
Timur Kristóf [Thu, 29 Jun 2023 12:27:25 +0000 (14:27 +0200)]
radv: Refactor required subgroup size in pipeline key.

This is to allow setting required subgroup size and
full subgroups on more than just the compute stage.

Use an enum (not the actual subgroup size integer)
so that we can have some bits reserved there for
future use.

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

15 months agoetnaviv: nir: do a late nir_opt_cse run
Christian Gmeiner [Wed, 28 Jun 2023 11:26:50 +0000 (13:26 +0200)]
etnaviv: nir: do a late nir_opt_cse run

This cleans up a lot and helps to generate much better code. There
are only benefits on GPUs without inline immediate support.

shader-db results on GC2000:

total instructions in shared programs: 237168 -> 235101 (-0.87%)
instructions in affected programs: 17297 -> 15230 (-11.95%)
helped: 758
HURT: 0
helped stats (abs) min: 1 max: 24 x̄: 2.73 x̃: 2
helped stats (rel) min: 7.14% max: 29.41% x̄: 14.47% x̃: 14.29%
95% mean confidence interval for instructions value: -2.94 -2.51
95% mean confidence interval for instructions %-change: -14.84% -14.09%
Instructions are helped.

total temps in shared programs: 85553 -> 84969 (-0.68%)
temps in affected programs: 2879 -> 2295 (-20.28%)
helped: 584
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 5.00% max: 25.00% x̄: 21.48% x̃: 20.00%
95% mean confidence interval for temps value: -1.00 -1.00
95% mean confidence interval for temps %-change: -21.76% -21.21%
Temps are helped.

total immediates in shared programs: 154800 -> 154800 (0.00%)
immediates in affected programs: 0 -> 0
helped: 0
HURT: 0

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

No changes on GC3000 and GC7000.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23947>

15 months agoci: disable Collabora's LAVA lab for maintance
Sergi Blanch Torne [Tue, 20 Jun 2023 14:57:50 +0000 (16:57 +0200)]
ci: disable Collabora's LAVA lab for maintance

This is to inform you of some planned downtime in the LAVA lab as follows:

  * Start: 2023-07-03 07:00 UTC
  * End: 2023-07-03 11:00 UTC

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23759>

15 months agoci/traces: print version of apps used for replaying traces
David Heidelberg [Mon, 5 Jun 2023 22:35:35 +0000 (00:35 +0200)]
ci/traces: print version of apps used for replaying traces

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23268>

15 months agoci/apitrace: include version with LTO enabled
David Heidelberg [Fri, 26 May 2023 17:56:26 +0000 (19:56 +0200)]
ci/apitrace: include version with LTO enabled

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23268>

15 months agoci/traces: guard DXVK and VK behind VK_DRIVER
David Heidelberg [Mon, 5 Jun 2023 23:44:21 +0000 (01:44 +0200)]
ci/traces: guard DXVK and VK behind VK_DRIVER

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23268>

15 months agoci: create manual farm rules
David Heidelberg [Sat, 24 Jun 2023 19:54:35 +0000 (21:54 +0200)]
ci: create manual farm rules

When we enabling the farm again, we don't want to run all the manual
jobs again, since some of them may take more than 1 hour.

We just have to wait until the nightly run.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23846>

15 months agoci/microsoft: rename manual rules according to rest introduced rules
David Heidelberg [Sun, 2 Jul 2023 20:20:05 +0000 (22:20 +0200)]
ci/microsoft: rename manual rules according to rest introduced rules

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23846>

15 months agoci/microsoft: uploading artifacts gets stuck currently (retried)
David Heidelberg [Sun, 2 Jul 2023 21:27:39 +0000 (23:27 +0200)]
ci/microsoft: uploading artifacts gets stuck currently (retried)

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23963>

15 months agodocs(fix): remove last ref to i965 in features.txt
Romain Failliot [Sun, 25 Jun 2023 13:34:24 +0000 (09:34 -0400)]
docs(fix): remove last ref to i965 in features.txt

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

15 months agosfn: indent fixes after switch to use nir_foreach_function_impl
Yonggang Luo [Thu, 29 Jun 2023 20:01:43 +0000 (04:01 +0800)]
sfn: indent fixes after switch to use nir_foreach_function_impl

This is done in separate commit is for easier to review

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agosfn: Convert to use nir_foreach_function_impl
Yonggang Luo [Thu, 29 Jun 2023 18:52:15 +0000 (02:52 +0800)]
sfn: Convert to use nir_foreach_function_impl

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agollvmpipe: Convert to use nir_foreach_function_impl
Yonggang Luo [Thu, 29 Jun 2023 20:24:48 +0000 (04:24 +0800)]
llvmpipe: Convert to use nir_foreach_function_impl

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agomesa: Convert to use nir_foreach_function_impl
Yonggang Luo [Thu, 29 Jun 2023 20:24:12 +0000 (04:24 +0800)]
mesa: Convert to use nir_foreach_function_impl

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agopanfrost: Convert to use nir_foreach_function_impl when possible
Yonggang Luo [Thu, 29 Jun 2023 20:22:24 +0000 (04:22 +0800)]
panfrost: Convert to use nir_foreach_function_impl when possible

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agopanfrost: Convert to use nir_foreach_function_with_impl in function midgard_compile_s...
Yonggang Luo [Thu, 29 Jun 2023 19:42:48 +0000 (03:42 +0800)]
panfrost: Convert to use nir_foreach_function_with_impl in function midgard_compile_shader_nir

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agonir: Strip the const modifier on nir_function * in nir_foreach_function_with_impl
Yonggang Luo [Thu, 29 Jun 2023 20:09:33 +0000 (04:09 +0800)]
nir: Strip the const modifier on nir_function * in nir_foreach_function_with_impl

The function iterator should be able to modified in this foreach loop
And the latter patches needs this

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23960>

15 months agoutil/disk_cache: fix ~/.cache/ permissions
Eric Engestrom [Fri, 30 Jun 2023 15:27:20 +0000 (16:27 +0100)]
util/disk_cache: fix ~/.cache/ permissions

XDG Base Dir spec [1] says:
> If, when attempting to write a file, the destination directory is
> non-existent an attempt should be made to create it with permission
> `0700`. If the destination directory exists already the permissions
> should not be changed.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4103
Fixes: 87ab26b2ab35a29d446a ("glsl: Add initial functions to implement an on-disk cache")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23952>

15 months agodraw/gs: handle extra shader outputs in geometry.
Dave Airlie [Fri, 30 Jun 2023 03:16:17 +0000 (13:16 +1000)]
draw/gs: handle extra shader outputs in geometry.

When geometry shader is used with unfilled lines and front face,
we don't handle the extra shader output.

Instead of taking the output from the gs, ask draw for the total
which should give the correct answer.

Fixes a test program attached to:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8644

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23943>

15 months agonir: Rename nir_reg_{src,dest} -> nir_register_{src,dest}
Alyssa Rosenzweig [Fri, 16 Jun 2023 15:10:25 +0000 (11:10 -0400)]
nir: Rename nir_reg_{src,dest} -> nir_register_{src,dest}

This frees up the shorter names for the intrinsic-based versions that will
replace them.

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

15 months agonir: Rename load/store_reg -> load/store_register
Alyssa Rosenzweig [Tue, 23 May 2023 20:12:51 +0000 (16:12 -0400)]
nir: Rename load/store_reg -> load/store_register

This frees up the shorter names for the new register-based intrinsics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23956>

15 months agopan/mdg: Propagate modifiers in the backend
Alyssa Rosenzweig [Tue, 20 Jun 2023 19:31:22 +0000 (15:31 -0400)]
pan/mdg: Propagate modifiers in the backend

It really isn't that hard. This drops the roundmode optimization but otherwise
should be at parity to what there was before, and it's massively more competent
at it anyway.

   total instructions in shared programs: 1514477 -> 1508444 (-0.40%)
   instructions in affected programs: 645848 -> 639815 (-0.93%)
   helped: 2712
   HURT: 187
   Instructions are helped.

   total bundles in shared programs: 645069 -> 642999 (-0.32%)
   bundles in affected programs: 136233 -> 134163 (-1.52%)
   helped: 1242
   HURT: 319
   Bundles are helped.

   total quadwords in shared programs: 1130469 -> 1125969 (-0.40%)
   quadwords in affected programs: 379780 -> 375280 (-1.18%)
   helped: 1878
   HURT: 376
   Quadwords are helped.

   total registers in shared programs: 90577 -> 90633 (0.06%)
   registers in affected programs: 5627 -> 5683 (1.00%)
   helped: 309
   HURT: 294
   Inconclusive result (value mean confidence interval includes 0).

   total threads in shared programs: 55594 -> 55607 (0.02%)
   threads in affected programs: 118 -> 131 (11.02%)
   helped: 43
   HURT: 33
   Inconclusive result (value mean confidence interval includes 0).

   total spills in shared programs: 1399 -> 1371 (-2.00%)
   spills in affected programs: 345 -> 317 (-8.12%)
   helped: 10
   HURT: 4

   total fills in shared programs: 5273 -> 5133 (-2.66%)
   fills in affected programs: 1035 -> 895 (-13.53%)
   helped: 12
   HURT: 4

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Copy-prop even with swizzle restrictions
Alyssa Rosenzweig [Wed, 21 Jun 2023 12:29:34 +0000 (08:29 -0400)]
pan/mdg: Copy-prop even with swizzle restrictions

Some instructions are not able to swizzle their sources, so we conservatively
refused to propagate moves into them to avoid needing a swizzle on the source.
This is too conservative: we only need to do this if the move swizzles. If there
is only an identity swizzle on the move, we can propagate it without issue. This
will mitigate some instruction count regression from the later modifier
propagation, which will leave lots of moves that need to be propagated.

   total instructions in shared programs: 1514834 -> 1514477 (-0.02%)
   instructions in affected programs: 132297 -> 131940 (-0.27%)
   helped: 349
   HURT: 3
   Instructions are helped.

   total bundles in shared programs: 645093 -> 645069 (<.01%)
   bundles in affected programs: 9650 -> 9626 (-0.25%)
   helped: 42
   HURT: 23
   Bundles are helped.

   total quadwords in shared programs: 1130751 -> 1130469 (-0.02%)
   quadwords in affected programs: 78790 -> 78508 (-0.36%)
   helped: 269
   HURT: 21
   Quadwords are helped.

   total registers in shared programs: 90563 -> 90577 (0.02%)
   registers in affected programs: 163 -> 177 (8.59%)
   helped: 4
   HURT: 16
   Registers are HURT.

   total spills in shared programs: 1400 -> 1399 (-0.07%)
   spills in affected programs: 2 -> 1 (-50.00%)
   helped: 1
   HURT: 0

   total fills in shared programs: 5276 -> 5273 (-0.06%)
   fills in affected programs: 151 -> 148 (-1.99%)
   helped: 1
   HURT: 3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Reset predicate.exclude while scheduling
Alyssa Rosenzweig [Wed, 21 Jun 2023 13:18:07 +0000 (09:18 -0400)]
pan/mdg: Reset predicate.exclude while scheduling

If we need to insert a mov in order to schedule a branch, we do not schedule
anything writer to the source of that mov in the same bundle to avoid a
data race between the read and the write. That's too conservative, though: it is
legitimate to write in the first part of the ALU word (VMUL/SADD stages) and
then read from the second part (VADD/SMUL/VLUT stages). Reset the
predicate.exclude when going from scheduling the latter stages to the former, to
allow a sequence of code like:

   FCMP.vector 0.xyzw, ...
   branch 0.x

to be scheduled as

   vmul.FCMP.vector 0.xyzw
   smul r31.w, 0.x
   branch 0.x

rather than getting split up into two bundles.

This mitigates a cycle count regression from the copyprop change.

   total instructions in shared programs: 1514856 -> 1514834 (<.01%)
   instructions in affected programs: 3087 -> 3065 (-0.71%)
   helped: 5
   HURT: 1
   Inconclusive result (value mean confidence interval includes 0).

   total bundles in shared programs: 645327 -> 645093 (-0.04%)
   bundles in affected programs: 40498 -> 40264 (-0.58%)
   helped: 230
   HURT: 68
   Bundles are helped.

   total quadwords in shared programs: 1130554 -> 1130751 (0.02%)
   quadwords in affected programs: 75323 -> 75520 (0.26%)
   helped: 49
   HURT: 231
   Quadwords are HURT.

   total registers in shared programs: 90559 -> 90563 (<.01%)
   registers in affected programs: 119 -> 123 (3.36%)
   helped: 5
   HURT: 8
   Inconclusive result (value mean confidence interval includes 0).

   total threads in shared programs: 55590 -> 55594 (<.01%)
   threads in affected programs: 4 -> 8 (100.00%)
   helped: 4
   HURT: 0
   Threads are helped.

   total spills in shared programs: 1402 -> 1400 (-0.14%)
   spills in affected programs: 289 -> 287 (-0.69%)
   helped: 1
   HURT: 1

   total fills in shared programs: 5285 -> 5276 (-0.17%)
   fills in affected programs: 448 -> 439 (-2.01%)
   helped: 2
   HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Lower special reads better
Alyssa Rosenzweig [Wed, 21 Jun 2023 12:51:22 +0000 (08:51 -0400)]
pan/mdg: Lower special reads better

If we have multiple reads of the same SSA def in the same block, we don't need
to emit multiple copies for it, we can just reuse a copy (OR'ing in the mask,
knowing the source is already fully written since it's SSA). This will prevent
some regressions in moves from the copyprop patch.

There is a bit of a tradeoff here between increased pressure and reduced
instruction count but I'm not too worried. The affect on pressure seems all over
the place -- register use decreases overall, threads increase (great!) but a few
shaders that were *already spilling*, spill a bit worse. I'm not terribly
worried there.

   total instructions in shared programs: 1518289 -> 1514856 (-0.23%)
   instructions in affected programs: 292854 -> 289421 (-1.17%)
   helped: 1557
   HURT: 232
   Instructions are helped.

   total bundles in shared programs: 646903 -> 645327 (-0.24%)
   bundles in affected programs: 91872 -> 90296 (-1.72%)
   helped: 910
   HURT: 256
   Bundles are helped.

   total quadwords in shared programs: 1133728 -> 1130554 (-0.28%)
   quadwords in affected programs: 187170 -> 183996 (-1.70%)
   helped: 1399
   HURT: 44
   Quadwords are helped.

   total registers in shared programs: 90640 -> 90559 (-0.09%)
   registers in affected programs: 2676 -> 2595 (-3.03%)
   helped: 202
   HURT: 124
   Inconclusive result (%-change mean confidence interval includes 0).

   total threads in shared programs: 55561 -> 55590 (0.05%)
   threads in affected programs: 50 -> 79 (58.00%)
   helped: 23
   HURT: 6
   Threads are helped.

   total spills in shared programs: 1386 -> 1402 (1.15%)
   spills in affected programs: 231 -> 247 (6.93%)
   helped: 2
   HURT: 13

   total fills in shared programs: 5159 -> 5285 (2.44%)
   fills in affected programs: 1282 -> 1408 (9.83%)
   helped: 11
   HURT: 16

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Fix temp count calculation
Alyssa Rosenzweig [Wed, 17 May 2023 23:01:50 +0000 (19:01 -0400)]
pan/mdg: Fix temp count calculation

1. Always calculate when asked. This is the sort of optimization that just
   introduces bugs. Like one I hit when shuffling register indices around with
   the register access changes.

2. Ask before using in RA.

3. Account for precoloured blend inputs.

Small shader-db hit, didn't investigate too much.

   total instructions in shared programs: 1518017 -> 1518168 (<.01%)
   instructions in affected programs: 2895 -> 3046 (5.22%)
   helped: 0
   HURT: 24
   Instructions are HURT.

   total bundles in shared programs: 646756 -> 646782 (<.01%)
   bundles in affected programs: 1119 -> 1145 (2.32%)
   helped: 1
   HURT: 19
   Bundles are HURT.

   total quadwords in shared programs: 1133694 -> 1133728 (<.01%)
   quadwords in affected programs: 1736 -> 1770 (1.96%)
   helped: 0
   HURT: 20
   Quadwords are HURT.

   total registers in shared programs: 90596 -> 90612 (0.02%)
   registers in affected programs: 108 -> 124 (14.81%)
   helped: 0
   HURT: 16
   Registers are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Fix 2-const CSEL at block beginning
Alyssa Rosenzweig [Fri, 30 Jun 2023 20:05:58 +0000 (16:05 -0400)]
pan/mdg: Fix 2-const CSEL at block beginning

mir_prev_op will point to the last instruction of the block in that case because
the block instruction list is circular. That would cause an invald
write-after-read relationship between the move we insert with the constants and
the CSEL reading them, which DCE "helpfully" optimizes out, leaving a read from
an undefined def. That ends up getting RA'd to an invalid register.

All in all, pretty bad.

Identified due to a new assert fail after the proper temp_count fix.

Affects dEQP-GLES31.functional.separate_shader.random.12.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Fix IR from scheduling conditions
Alyssa Rosenzweig [Thu, 29 Jun 2023 22:17:08 +0000 (18:17 -0400)]
pan/mdg: Fix IR from scheduling conditions

If we start with unscheduled IR:

   0 = comparison
   csel 1, 2, 0

the old code will schedule this as

   r31.w = comparison
   csel 1, 2, 0

leaving 0 as a dangling source, which can confuse the rest of the compiler.
Instead rewrite this to

   r31.w = comparison
   csel 1, 2, r31.w

Note the swizzle as already taken care of (i.e. turned to .x for scalar
conditions) by the time we get to scheduling so we can force to .w.

This keeps register allocation from doing stupid things.

total instructions in shared programs: 1518138 -> 1518017 (<.01%)
   instructions in affected programs: 37714 -> 37593 (-0.32%)
   helped: 48
   HURT: 42
   Instructions are helped.

   total bundles in shared programs: 646877 -> 646756 (-0.02%)
   bundles in affected programs: 17024 -> 16903 (-0.71%)
   helped: 48
   HURT: 42
   Bundles are helped.

   total registers in shared programs: 90624 -> 90596 (-0.03%)
   registers in affected programs: 361 -> 333 (-7.76%)
   helped: 31
   HURT: 5
   Registers are helped.

   total threads in shared programs: 55561 -> 55566 (<.01%)
   threads in affected programs: 5 -> 10 (100.00%)
   helped: 4
   HURT: 0
   Threads are helped.

   total spills in shared programs: 1386 -> 1383 (-0.22%)
   spills in affected programs: 19 -> 16 (-15.79%)
   helped: 3
   HURT: 0

   total fills in shared programs: 5159 -> 5077 (-1.59%)
   fills in affected programs: 1305 -> 1223 (-6.28%)
   helped: 20
   HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Add is_ssa helper
Alyssa Rosenzweig [Tue, 20 Jun 2023 21:54:18 +0000 (17:54 -0400)]
pan/mdg: Add is_ssa helper

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Constant fold after algebraic_late
Alyssa Rosenzweig [Tue, 20 Jun 2023 22:03:32 +0000 (18:03 -0400)]
pan/mdg: Constant fold after algebraic_late

Late algebraic lowering turns fsub(x, #y) into fadd(x, fneg(#y)), we should
constant fold that into fadd(x, #-y).

   total instructions in shared programs: 1518414 -> 1518138 (-0.02%)
   instructions in affected programs: 18363 -> 18087 (-1.50%)
   helped: 68
   HURT: 0
   Instructions are helped.

   total bundles in shared programs: 646938 -> 646877 (<.01%)
   bundles in affected programs: 8299 -> 8238 (-0.74%)
   helped: 56
   HURT: 17
   Bundles are helped.

   total quadwords in shared programs: 1134323 -> 1133694 (-0.06%)
   quadwords in affected programs: 77445 -> 76816 (-0.81%)
   helped: 450
   HURT: 8
   Quadwords are helped.

   total registers in shared programs: 90618 -> 90624 (<.01%)
   registers in affected programs: 129 -> 135 (4.65%)
   helped: 5
   HURT: 11
   Inconclusive result (value mean confidence interval includes 0).

   total threads in shared programs: 55563 -> 55561 (<.01%)
   threads in affected programs: 4 -> 2 (-50.00%)
   helped: 0
   HURT: 2

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Lower isub in common code
Alyssa Rosenzweig [Tue, 20 Jun 2023 21:57:16 +0000 (17:57 -0400)]
pan/mdg: Lower isub in common code

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Type CSEL with a NIR pass
Alyssa Rosenzweig [Tue, 20 Jun 2023 20:43:22 +0000 (16:43 -0400)]
pan/mdg: Type CSEL with a NIR pass

As an off-shoot of trying to delete modifiers (and nir_register) from NIR, I'd
like to get rid of some of the modifier NIR silliness that Midgard is doing.
The CSEL type selection heuristic at NIR->MIR time is peak backend silly, so
replace it with nir_gather_ssa_types.

Small win on shader-db. I didn't investigate much, but this matches my intution
for how this patch would perform: very small instruction/cycle count
improvements due to slightly better decisions around modifiers, more substantial
space savings due to more float constants getting inlined.

   total instructions in shared programs: 1518422 -> 1518414 (<.01%)
   instructions in affected programs: 1914 -> 1906 (-0.42%)
   helped: 8
   HURT: 0
   Instructions are helped.

   total bundles in shared programs: 646941 -> 646937 (<.01%)
   bundles in affected programs: 344 -> 340 (-1.16%)
   helped: 4
   HURT: 0
   Bundles are helped.

   total quadwords in shared programs: 1134727 -> 1134324 (-0.04%)
   quadwords in affected programs: 66752 -> 66349 (-0.60%)
   helped: 351
   HURT: 54
   Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agopan/mdg: Optimize b32csel(inot) in NIR
Alyssa Rosenzweig [Tue, 20 Jun 2023 21:14:30 +0000 (17:14 -0400)]
pan/mdg: Optimize b32csel(inot) in NIR

This is a generic algebraic optimization. Use the generic algebraic optimizer.

The only reason we can't rely on nir_opt_algebraic to do this is because we
generate inot's late in order to optimize some comparisons. But we already have
a pass to clean that up (midgard_nir_clean_inot), it just needs to be extended
to handle more cases.

shader-db is noise:

total bundles in shared programs: 646941 -> 646942 (<.01%)
bundles in affected programs: 100 -> 101 (1.00%)
helped: 0
HURT: 1

total quadwords in shared programs: 1134727 -> 1134726 (<.01%)
quadwords in affected programs: 318 -> 317 (-0.31%)
helped: 2
HURT: 1

total registers in shared programs: 90619 -> 90618 (<.01%)
registers in affected programs: 12 -> 11 (-8.33%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agonir: Add b32fcsel_mdg opcode for Midgard
Alyssa Rosenzweig [Tue, 20 Jun 2023 20:42:13 +0000 (16:42 -0400)]
nir: Add b32fcsel_mdg opcode for Midgard

Midgard has both int and float version of b32csel. The backend needs some way to
pick between the two, and it's a lot more convenient to choose in NIR before
going out-of-SSA than in the backend.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>

15 months agoanv: retry batchbuffer submission with i915
Rohan Garg [Fri, 30 Jun 2023 15:12:15 +0000 (17:12 +0200)]
anv: retry batchbuffer submission with i915

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23950>

15 months agovenus: use feedback for vkGetQueryPoolResults
Juston Li [Wed, 31 May 2023 23:22:06 +0000 (16:22 -0700)]
venus: use feedback for vkGetQueryPoolResults

Create a feedback buffer for each query pool and retrieve the query
results from the buffer instead of a roundtrip call in
vkGetQueryPoolResults.

VK_QUERY_RESULT_WAIT_BIT queries will poll until the queries are
available in the feedback buffer.

Query results in the feedback buffer are always VK_QUERY_RESULT_64_BIT
and if needed converted to what the app requests at
vkGetQueryPoolResults time.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: batch query feedback and defer until after render pass
Juston Li [Fri, 30 Jun 2023 15:37:30 +0000 (08:37 -0700)]
venus: batch query feedback and defer until after render pass

vkCmdCopyQueryPoolResults cannot be called within a render pass so batch
and defer the query feedback copies until after the render pass.

Secondary command buffers inside render passes also have their query
feedback copies batched when recorded. When the secondary command buffer
is recorded via vkCmdExecuteCommands, it's batch is merged into the
primary command buffer's batch and is defered until the render pass ends.

If multiview is enabled, vkCmdCopyQueryPoolResults needs to copy
additional queries matching the number of bits set in viewMask.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: track render pass
Juston Li [Fri, 30 Jun 2023 15:37:22 +0000 (08:37 -0700)]
venus: track render pass

vkCmdCopyQueryPoolResults cannot be called within a render pass/or
while the render pass is suspended so track when commands are inside
a render pass. Also track whether a secondary command buffer is
considered to be entirely inside a render pass.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: track viewMask
Juston Li [Fri, 30 Jun 2023 15:37:12 +0000 (08:37 -0700)]
venus: track viewMask

Per spec 1.3.255: "If queries are used while executing a render pass
instance that has multiview enabled, the query uses N consecutive query
indices in the query pool (starting at query) where N is the number of
bits set in the view mask in the subpass the query is used in."

track viewMask so query feedback can copy the correct amount of queries
when multiview is enabled.

viewMask is passed in for vkCmdBeginRendering but for legacy
vkCmdBeginRenderPass/2 they are set by vkCreateRenderPass for each
subpass.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: add query pool feedback cmds
Juston Li [Wed, 31 May 2023 22:27:44 +0000 (15:27 -0700)]
venus: add query pool feedback cmds

Add feedback commands to write query results into a coherent buffer to
optimize out roundtrip vkGetQueryPoolResults that poll until a result
is available.

Queries are available after vkCmdEndQuery or vkCmdWriteTimeStamp, so
append a vkCmdCopyQueryPoolResults to copy to query results to our
coherent buffer.

The coherent buffer also needs to be cleared after vkCmdResetQueryPool
so append vkCmdFillBuffer.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: expose vn_feedback_buffer_create()
Juston Li [Wed, 31 May 2023 17:15:55 +0000 (10:15 -0700)]
venus: expose vn_feedback_buffer_create()

For query pool feedback, which are variable in size depending on the
query type and being contiguous will allow for simpler copies/clears.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agovenus: factor out flush barrier cmd
Juston Li [Wed, 28 Jun 2023 04:15:48 +0000 (21:15 -0700)]
venus: factor out flush barrier cmd

generic device->host flush that will be re-used by query feedback

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>

15 months agomeson: Add back execmem option as a deprecated option
Dylan Baker [Tue, 27 Jun 2023 18:39:27 +0000 (11:39 -0700)]
meson: Add back execmem option as a deprecated option

I've been betting support requests by people confused as to why their
builds broke because this option was removed. We can add the option back
with the deprecated flag set so that Meson will give a nice warning, but
builds will continue to work.

fixes: 1dd1147408e8fcfb9cbd08d5a5651152d288ef41

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

15 months agoaco,ac/llvm,ac/nir,vtn: unify cube opcodes
Rhys Perry [Thu, 29 Jun 2023 14:04:27 +0000 (15:04 +0100)]
aco,ac/llvm,ac/nir,vtn: unify cube opcodes

fossil-db (navi21):
Totals from 17068 (12.79% of 133461) affected shaders:
Instrs: 24743703 -> 24743572 (-0.00%); split: -0.00%, +0.00%
CodeSize: 132579952 -> 132580620 (+0.00%); split: -0.00%, +0.00%
VGPRs: 1227840 -> 1227984 (+0.01%)
Latency: 403180114 -> 403251188 (+0.02%); split: -0.00%, +0.02%
InvThroughput: 75311302 -> 75320892 (+0.01%); split: -0.00%, +0.01%
VClause: 415400 -> 415402 (+0.00%); split: -0.00%, +0.00%
Copies: 1715404 -> 1715258 (-0.01%); split: -0.01%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com> (r600)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23930>

15 months agodocs: update lavapipe extensions
Mike Blumenkrantz [Fri, 30 Jun 2023 14:26:38 +0000 (10:26 -0400)]
docs: update lavapipe extensions

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

15 months agozink: fix separate shader program refcounting
Mike Blumenkrantz [Tue, 27 Jun 2023 16:55:41 +0000 (12:55 -0400)]
zink: fix separate shader program refcounting

this fixes the refcount for the separate shader program to not have a leaked ref
and then fixes the owned program to have the expected number of refs

this happened to work some of the time before because there was an arbitrary unref
in replace_separable_prog(), but this shouldn't have been necessary

Fixes: e3b746e3a31 ("zink: use GPL to handle (simple) separate shader objects")

fixes #9274

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

15 months agozink: do initial program unref during program creation
Mike Blumenkrantz [Tue, 27 Jun 2023 16:54:47 +0000 (12:54 -0400)]
zink: do initial program unref during program creation

this ensures that programs are never created with more than $num_shaders
refs, which is otherwise not necessarily a bug but can lead to bugs

Fixes: a0e69e7601a ("zink: split out first-time shader module creation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23888>

15 months agollvmpipe/ci: Update expectations
Konstantin Seurer [Fri, 30 Jun 2023 06:40:45 +0000 (08:40 +0200)]
llvmpipe/ci: Update expectations

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22828>

15 months agolavapipe/ci: Update CI expectations for new extensions
Konstantin Seurer [Tue, 2 May 2023 14:38:34 +0000 (16:38 +0200)]
lavapipe/ci: Update CI expectations for new extensions

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

15 months agovenus/ci: Update fails
Konstantin Seurer [Fri, 12 May 2023 16:00:37 +0000 (18:00 +0200)]
venus/ci: Update fails

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

15 months agozink/ci: Update lavapipe expectations
Konstantin Seurer [Sun, 4 Jun 2023 11:59:36 +0000 (13:59 +0200)]
zink/ci: Update lavapipe expectations

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

15 months agozink: Increase ZINK_FBFETCH_DESCRIPTOR_SIZE to 280
Konstantin Seurer [Fri, 12 May 2023 18:06:38 +0000 (20:06 +0200)]
zink: Increase ZINK_FBFETCH_DESCRIPTOR_SIZE to 280

Work around the lavapipe descriptor buffer implementation.

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

15 months agolavapipe: Make shader compilation thread safe
Konstantin Seurer [Sun, 21 May 2023 10:06:32 +0000 (12:06 +0200)]
lavapipe: Make shader compilation thread safe

Fixes random crashes because the LLVM context is not thread safe.

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

15 months agollvmpipe: flush/reference fs ubos on bind
Mike Blumenkrantz [Fri, 12 May 2023 13:05:01 +0000 (09:05 -0400)]
llvmpipe: flush/reference fs ubos on bind

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

15 months agollvmpipe: Use lp_jit_buffer_from_pipe_const in setup
Konstantin Seurer [Fri, 12 May 2023 11:36:15 +0000 (13:36 +0200)]
llvmpipe: Use lp_jit_buffer_from_pipe_const in setup

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

15 months agolavapipe: VK_EXT_mutable_descriptor_type
Mike Blumenkrantz [Thu, 27 Apr 2023 19:38:28 +0000 (15:38 -0400)]
lavapipe: VK_EXT_mutable_descriptor_type

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

15 months agolavapipe: EXT_descriptor_indexing
Konstantin Seurer [Tue, 11 Apr 2023 09:56:26 +0000 (11:56 +0200)]
lavapipe: EXT_descriptor_indexing

fails:
dEQP-VK.descriptor_indexing.storage_texel_buffer
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind_in_loop
dEQP-VK.descriptor_indexing.storage_texel_buffer_in_loop
dEQP-VK.descriptor_indexing.storage_texel_buffer_minNonUniform

They seem to be vertex-shader related.

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

15 months agolavapipe: Lower non uniform access
Konstantin Seurer [Wed, 7 Jun 2023 20:29:52 +0000 (22:29 +0200)]
lavapipe: Lower non uniform access

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

15 months agolavapipe: EXT_descriptor_buffer
Mike Blumenkrantz [Wed, 26 Apr 2023 17:02:29 +0000 (13:02 -0400)]
lavapipe: EXT_descriptor_buffer

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

15 months agolavapipe: split out descriptor stage setting
Mike Blumenkrantz [Wed, 26 Apr 2023 17:02:02 +0000 (13:02 -0400)]
lavapipe: split out descriptor stage setting

no functional changes

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

15 months agolavapipe: create a desc set for immutable sampler layouts
Mike Blumenkrantz [Wed, 26 Apr 2023 21:06:29 +0000 (17:06 -0400)]
lavapipe: create a desc set for immutable sampler layouts

this is necessary in order to bind an all-immutable set as a buffer

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

15 months agolavapipe: Rework descriptor handling
Konstantin Seurer [Tue, 11 Apr 2023 19:35:22 +0000 (21:35 +0200)]
lavapipe: Rework descriptor handling

Instead of using gallium binding slots for binding descriptors,
descriptor sets have UBOs that contain the llvmpipe descriptors.
Descriptor sets are bound by binding their UBO to the corresponding
slot.

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

15 months agolavapipe: Make pipeline_lock generic for accessing the queue
Konstantin Seurer [Thu, 18 May 2023 08:52:27 +0000 (10:52 +0200)]
lavapipe: Make pipeline_lock generic for accessing the queue

Since we must not access the pipe_context concurrently, it makes sense
to add a lock for all kinds of quere related operations. This way, we
can safely create pipe resources inside Vulkan entry points that can be
used concurrently.

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

15 months agolavapipe: Lower more texture OPs
Konstantin Seurer [Sun, 16 Apr 2023 19:14:44 +0000 (21:14 +0200)]
lavapipe: Lower more texture OPs

Tries to reduce the number of textures we need to pre-compile.

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

15 months agolavapipe: Include llvmpipe
Konstantin Seurer [Wed, 7 Jun 2023 08:51:22 +0000 (10:51 +0200)]
lavapipe: Include llvmpipe

Will be used to initialize llvmpipe descriptors.

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

15 months agollvmpipe: Disable the linear path when running vulkan
Konstantin Seurer [Sun, 23 Apr 2023 17:29:19 +0000 (19:29 +0200)]
llvmpipe: Disable the linear path when running vulkan

It doesn't implement vulkan style resources.

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

15 months agogallivm: Implement vulkan images
Konstantin Seurer [Tue, 18 Apr 2023 07:43:35 +0000 (09:43 +0200)]
gallivm: Implement vulkan images

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

15 months agogallivm: Implement vulkan textures
Konstantin Seurer [Sun, 16 Apr 2023 19:30:05 +0000 (21:30 +0200)]
gallivm: Implement vulkan textures

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

15 months agogallivm: Implement vulkan SSBOs
Konstantin Seurer [Tue, 18 Apr 2023 07:42:01 +0000 (09:42 +0200)]
gallivm: Implement vulkan SSBOs

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

15 months agogallivm: Implement vulkan UBOs
Konstantin Seurer [Thu, 13 Apr 2023 07:18:25 +0000 (09:18 +0200)]
gallivm: Implement vulkan UBOs

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

15 months agogallivm: Add a function for loading vulkan descriptors
Konstantin Seurer [Fri, 14 Apr 2023 09:55:39 +0000 (11:55 +0200)]
gallivm: Add a function for loading vulkan descriptors

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

15 months agollvmpipe: Pre compile sample functions
Konstantin Seurer [Thu, 18 May 2023 19:23:40 +0000 (21:23 +0200)]
llvmpipe: Pre compile sample functions

With vulkan, we can not know details about texture and sampler resources
so we pre compile all possible combinations.

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

15 months agogallivm: Clamp the texel buffer size
Konstantin Seurer [Mon, 22 May 2023 16:23:21 +0000 (18:23 +0200)]
gallivm: Clamp the texel buffer size

Fixes arb_texture_buffer_object-texture-buffer-size-clamp.

cc: mesa-stable

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

15 months agogallivm: Propagate vulkan resources
Konstantin Seurer [Sun, 16 Apr 2023 19:22:52 +0000 (21:22 +0200)]
gallivm: Propagate vulkan resources

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

15 months agogallivm: Expose lp_build_texel_type
Konstantin Seurer [Thu, 4 May 2023 19:29:44 +0000 (21:29 +0200)]
gallivm: Expose lp_build_texel_type

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

15 months agollvmpipe: Add LP_TOTAL_IMAGE_OP_COUNT
Konstantin Seurer [Tue, 18 Apr 2023 07:36:17 +0000 (09:36 +0200)]
llvmpipe: Add LP_TOTAL_IMAGE_OP_COUNT

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

15 months agogallivm: Expose LP_MAX_TEX_FUNC_ARGS
Konstantin Seurer [Fri, 5 May 2023 09:22:51 +0000 (11:22 +0200)]
gallivm: Expose LP_MAX_TEX_FUNC_ARGS

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

15 months agogallivm: Add LP_IMG_OP_COUNT
Konstantin Seurer [Tue, 18 Apr 2023 07:39:33 +0000 (09:39 +0200)]
gallivm: Add LP_IMG_OP_COUNT

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

15 months agollvmpipe: Add lp_build_image_soa_dynamic_state
Konstantin Seurer [Tue, 18 Apr 2023 07:37:09 +0000 (09:37 +0200)]
llvmpipe: Add lp_build_image_soa_dynamic_state

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

15 months agollvmpipe: Add lp_build_sampler_soa_dynamic_state
Konstantin Seurer [Sun, 16 Apr 2023 19:21:48 +0000 (21:21 +0200)]
llvmpipe: Add lp_build_sampler_soa_dynamic_state

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

15 months agogallivm: Expose lp_build_sample_soa_code
Konstantin Seurer [Sun, 16 Apr 2023 19:19:35 +0000 (21:19 +0200)]
gallivm: Expose lp_build_sample_soa_code

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

15 months agogallivm: Add lp_descriptor struct
Konstantin Seurer [Wed, 7 Jun 2023 09:04:27 +0000 (11:04 +0200)]
gallivm: Add lp_descriptor struct

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

15 months agogallivm: Add missing includes
Konstantin Seurer [Wed, 7 Jun 2023 09:08:17 +0000 (11:08 +0200)]
gallivm: Add missing includes

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