platform/upstream/mesa.git
13 months agopvr: Fix SPM load shader sample rate
Karmjit Mahil [Tue, 3 Oct 2023 14:28:28 +0000 (15:28 +0100)]
pvr: Fix SPM load shader sample rate

Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Refactor subpass ds and sample count setup
Karmjit Mahil [Sun, 24 Sep 2023 13:14:15 +0000 (14:14 +0100)]
pvr: Refactor subpass ds and sample count setup

Now we first check the sample count from the ds attachment as well
as setting it up.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Fix subpass sample count on ds attachment only
Karmjit Mahil [Sun, 24 Sep 2023 12:54:49 +0000 (13:54 +0100)]
pvr: Fix subpass sample count on ds attachment only

When no color attachments were used in a subpass, the sample count
was left unchanged to `1` while we should instead have picked it
up from the ds attachment if there was one.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Order tile buffer EOT emits to be last
Karmjit Mahil [Mon, 2 Oct 2023 15:26:58 +0000 (16:26 +0100)]
pvr: Order tile buffer EOT emits to be last

Tile buffer emits required a load from the tile buffer into the
output regs, so they must be placed at the end of the EOT program
as to not corrupt the output register emits.

This commit orders the emit state to place output register emits
first, and tile buffer emits last.

dEQP test fixed:
  dEQP-VK.renderpass.suballocation.attachment.4.422
  ... and others from the dEQP-VK.renderpass.suballocation.*

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Fix OOB access of pbe_{cs,reg}_words
Karmjit Mahil [Wed, 27 Sep 2023 18:17:20 +0000 (19:17 +0100)]
pvr: Fix OOB access of pbe_{cs,reg}_words

`hw_render->eot_surface_count` also includes surface which don't
need an emit. Using `i` was leading to OOB access when there were
surfaces that didn't need emits, and in total there were
`> PVR_MAX_COLOR_ATTACHMENTS` surfaces.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Fix pbe_emit assert
Karmjit Mahil [Wed, 27 Sep 2023 18:30:25 +0000 (19:30 +0100)]
pvr: Fix pbe_emit assert

The `eot_surface_count` also includes surfaces which don't need an
emit. Surfaces with PVR_RESOLVE_TYPE_TRANSFER don't need an emit
since they'll be resolved through a transfer op, but they still count
against the total, thus the assert was incorrect.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agopvr: Fix MRT index in PBE state
Karmjit Mahil [Sat, 23 Sep 2023 15:46:30 +0000 (16:46 +0100)]
pvr: Fix MRT index in PBE state

The same MRT index was incorrectly being set for all render
targets, in the PBE state.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>

13 months agonvk: Improve address space and buffer size limits
Faith Ekstrand [Wed, 11 Oct 2023 07:55:11 +0000 (02:55 -0500)]
nvk: Improve address space and buffer size limits

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

13 months agonvk: Always emit at least one color attachment
Faith Ekstrand [Wed, 11 Oct 2023 02:34:59 +0000 (21:34 -0500)]
nvk: Always emit at least one color attachment

Without this, alpha to coverage doesn't work because the hardware
ignores the output of the first color from the shader.

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

13 months agonvk: Disable depth or stencil tests when unbound
Faith Ekstrand [Tue, 10 Oct 2023 16:29:18 +0000 (11:29 -0500)]
nvk: Disable depth or stencil tests when unbound

Dynamic rendering requires that the client be able to bind just one
aspect of a depth/stencil image.  Because we only have interleaved
depth/stencil on NVIDIA and no actual disable bits, this means we need
to implicitly AND any enables with a vk_format != UNDEFINED check.  In
future, we might want to do that with a macro but we'll keep it simple
for today.

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

13 months agonil/format: Advertise R10G10B10A2_UINT texture buffer support
Faith Ekstrand [Tue, 10 Oct 2023 16:13:48 +0000 (11:13 -0500)]
nil/format: Advertise R10G10B10A2_UINT texture buffer support

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

13 months agonil/format: Use A for alpha blend
Faith Ekstrand [Tue, 10 Oct 2023 16:09:12 +0000 (11:09 -0500)]
nil/format: Use A for alpha blend

This lets us reserve B for buffer.

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

13 months agonvk: Reset descriptor pool allocator when all sets are destroyed
Faith Ekstrand [Tue, 10 Oct 2023 16:03:17 +0000 (11:03 -0500)]
nvk: Reset descriptor pool allocator when all sets are destroyed

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

13 months agonvk: Set max descriptors to 2^20 for most descriptor types
Faith Ekstrand [Tue, 10 Oct 2023 15:39:51 +0000 (10:39 -0500)]
nvk: Set max descriptors to 2^20 for most descriptor types

Dynamic is the exception here.  Those have much stricter limits.

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

13 months agonvk: Emit MME_DMA_SYSMEMBAR before indirect draw/dispatch
Faith Ekstrand [Tue, 10 Oct 2023 15:26:19 +0000 (10:26 -0500)]
nvk: Emit MME_DMA_SYSMEMBAR before indirect draw/dispatch

This fixes issues where we may read stale data from other parts of the
GPU when we go to do an indirect draw fetch.

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

13 months agonvk: Advertise more inline uniform block limits
Faith Ekstrand [Tue, 10 Oct 2023 00:27:38 +0000 (19:27 -0500)]
nvk: Advertise more inline uniform block limits

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

13 months agoci/b2c: use latest mesa-trigger image
Eric Engestrom [Tue, 10 Oct 2023 14:21:13 +0000 (15:21 +0100)]
ci/b2c: use latest mesa-trigger image

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

13 months agoci/b2c: move to the shiny new `gfx-ci/ci-tron` repo
Eric Engestrom [Tue, 10 Oct 2023 14:16:24 +0000 (15:16 +0100)]
ci/b2c: move to the shiny new `gfx-ci/ci-tron` repo

We've successfully moved the repo to its new location now that the
project is ready for general use.

Update the config to use the new paths.

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

13 months agonir/load_libclc: fix libclc memory leak
Karol Herbst [Tue, 10 Oct 2023 19:32:54 +0000 (21:32 +0200)]
nir/load_libclc: fix libclc memory leak

Fixes: ef453f54394 ("spirv: Add a shared libclc loader")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25649>

13 months agoradeonsi: disable disk cache when use aco
Qiang Yu [Mon, 9 Oct 2023 02:53:36 +0000 (10:53 +0800)]
radeonsi: disable disk cache when use aco

This is a temp fix. Currently we mix use llvm and aco to compile
shaders when AMD_DEBUG=useaco, but disk cache need function
identifier when creation, aco compiled shader should not use llvm
function identifier, so we have to disable disk cache when use
aco for now.

After aco is able to compile all shaders, we can re-enable disk
cache by removing the llvm function identifier when aco.

Fixes: d1dd36a74e1 ("radeonsi: be able to use aco compiler for mono ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9673
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/25607>

13 months agolavapipe: don't block begin/end cmdbuf pipeline barriers
Mike Blumenkrantz [Wed, 11 Oct 2023 01:17:59 +0000 (21:17 -0400)]
lavapipe: don't block begin/end cmdbuf pipeline barriers

these are now useful

fixes #9972

Fixes: 3b547a9b581 ("lavapipe: Switch to the common sync framework")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25652>

13 months agozink: set ZINK_DEBUG=quiet for polaris jobs
Mike Blumenkrantz [Tue, 10 Oct 2023 15:44:04 +0000 (11:44 -0400)]
zink: set ZINK_DEBUG=quiet for polaris jobs

modifiers aren't supported here, so this will otherwise spam infinitely

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

13 months agozink: apply ZINK_DEBUG=quiet to all missing feature warnings
Mike Blumenkrantz [Tue, 10 Oct 2023 15:43:18 +0000 (11:43 -0400)]
zink: apply ZINK_DEBUG=quiet to all missing feature warnings

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

13 months agolavapipe + docs: update ycbcr extension enables.
Dave Airlie [Tue, 10 Oct 2023 05:53:03 +0000 (15:53 +1000)]
lavapipe + docs: update ycbcr extension enables.

This passes all the dEQP-VK.ycbcr* tests and updates the docs.

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

13 months agorusticl/memory: fix potential use-after-free in clEnqueueSVMMemFill
Karol Herbst [Tue, 10 Oct 2023 11:23:52 +0000 (13:23 +0200)]
rusticl/memory: fix potential use-after-free in clEnqueueSVMMemFill

Fixes: bfee3a8563d ("rusticl: add support for fine-grained system SVM")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reported-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25637>

13 months agopvr: emit PPP state when vis_test dirty bit is set
Frank Binns [Sat, 30 Sep 2023 13:34:58 +0000 (14:34 +0100)]
pvr: emit PPP state when vis_test dirty bit is set

Unlike other dirty bits, the vis_test dirty bit wasn't being taken into
consideration when determining whether PPP state needed to be emitted as part
of a draw call.

Fixes a large number of tests in dEQP-VK.query_pool.occlusion_query.*.

Fixes: 2b1992a0005 ("pvr: Implement vkCmdBeginQuery API.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25491>

13 months agopvr: fix setup of load op unresolved msaa mask
Frank Binns [Tue, 26 Sep 2023 21:48:08 +0000 (22:48 +0100)]
pvr: fix setup of load op unresolved msaa mask

Bits were being assigned rather than ORed into the mask during setup. Noticed
through code inspection.

Fixes: e089166776d ("pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25487>

13 months agopvr: change a few places to use PVR_DW_TO_BYTES()
Frank Binns [Fri, 29 Sep 2023 08:43:04 +0000 (09:43 +0100)]
pvr: change a few places to use PVR_DW_TO_BYTES()

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25489>

13 months agopvr: fix allocation size of clear colour consts shared regs buffer
Frank Binns [Thu, 28 Sep 2023 21:24:31 +0000 (22:24 +0100)]
pvr: fix allocation size of clear colour consts shared regs buffer

The number of const shared registers was being used for the allocation size
rather than the number of bytes. In practice this doesn't make a difference as
the max allocation size is 24 bytes, which then gets rounded up to 64 bytes by
the buffer allocation function. However, we might as well make the allocation
size correct to avoid any future confusion. Noticed through code inspection.

Fixes: 7509e259f85 ("pvr: Implement color/depth/depth+stencil attachment clear.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25489>

13 months agopvr: fix attachments segfault in pvr_is_stencil_store_load_needed()
Frank Binns [Sat, 23 Sep 2023 13:58:02 +0000 (14:58 +0100)]
pvr: fix attachments segfault in pvr_is_stencil_store_load_needed()

pvr_is_stencil_store_load_needed() may be called on secondary command buffers,
which don't have any attachments. This wasn't being taken into account, meaning
a segfault could occur.

Fixes a segfault seen in:
dEQP-VK.renderpass.suballocation.attachment_allocation.input_output.39

Fixes: 54876512a14 ("pvr: Add mid fragment pipeline barrier if needed.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25486>

13 months agozink/ci: remove 42 tests from the zink-radv-polaris10-fails list
Martin Roukala (né Peres) [Tue, 10 Oct 2023 06:20:33 +0000 (09:20 +0300)]
zink/ci: remove 42 tests from the zink-radv-polaris10-fails list

Not sure which MR fixed them, but I'll take these fixes!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25629>

13 months agodri: Remove __driDriverExtensions leftovers
Roman Stratiienko [Fri, 6 Oct 2023 09:31:29 +0000 (12:31 +0300)]
dri: Remove __driDriverExtensions leftovers

Android-14/clang-17 throws an error with it:

ld.lld: error: version script assignment of 'global' to symbol
   '__driDriverExtensions' failed: symbol not defined

Fixes: d43e6a9a497f ("dri: Remove the megadriver compat stub")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25587>

13 months agozink: fix wording of warning
Erik Faye-Lund [Tue, 10 Oct 2023 14:27:25 +0000 (16:27 +0200)]
zink: fix wording of warning

The string-argument for this function is the name of the feature, not
the entire message.

Fixes: ea0e22da442 ("zink: use warn_missing_feature for missing modifier support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25644>

13 months agoac/nir: only consider overflow for valid feedback buffers
Samuel Pitoiset [Mon, 9 Oct 2023 11:50:57 +0000 (13:50 +0200)]
ac/nir: only consider overflow for valid feedback buffers

Otherwise the ordered operation above (ie. a GDS atomic return) might
return non-zero offsets for invalid buffers.

Fixes: f7076d129db ("amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25613>

13 months agoradv: allocate only 1 GDS OA counter for gfx10 NGG streamout
Samuel Pitoiset [Mon, 9 Oct 2023 14:38:42 +0000 (16:38 +0200)]
radv: allocate only 1 GDS OA counter for gfx10 NGG streamout

It works with just one counter.

This mitigates https://gitlab.freedesktop.org/drm/amd/-/issues/2902
quite a lot when you run dEQP-VK.transform_feedback.* in parallel on
more than 16 threads with RDNA3.

For example, on my GPU the kernel reports 16 GDS OA counters which means
that if you run VKCTS with 16 threads (ie. 16 Vulkan devices are
created) it's fine. Otherwise, the kernel might report ENOMEM.

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

13 months agoradv: fix destroying GDS/OA BOs
Samuel Pitoiset [Mon, 9 Oct 2023 17:03:48 +0000 (19:03 +0200)]
radv: fix destroying GDS/OA BOs

Otherwise, we have dangling BO pointers in the global BO list. Not
quite sure why this hasn't been triggered before.

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

13 months agofreedreno/ci: Minetest
Alyssa Rosenzweig [Tue, 10 Oct 2023 10:54:53 +0000 (06:54 -0400)]
freedreno/ci: Minetest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir/opt_preamble: Respect ACCESS_CAN_SPECULATE
Alyssa Rosenzweig [Tue, 18 Jul 2023 20:35:49 +0000 (16:35 -0400)]
nir/opt_preamble: Respect ACCESS_CAN_SPECULATE

In general, it is unsafe to speculatively hoist conditionally executed loads
into the preamble. For example, if the shader does:

   if (ptr is valid) {
      foo(*ptr)
   }

we cannot dereference ptr in the preamble without knowing that the pointer is
valid (which may not be determinable, since it might not be uniform).
nir_opt_preamble needs to stop speculating in this case, or otherwise using
preambles can cause faults on legal shaders.

However, some platforms may be able to speculate loads safely. For example,
Apple hardware is able to suppress MMU faults, making speculation safe.  This is
controlled global register to control this behaviour, set at boot-time by the
kernel.  (macOS suppresses these faults unconditionally, this feature may be
used in their implementation of sparse textures. Currently Linux does not
suppress any faults but this may change later.)

Since nir_opt_preamble should work soundly and optimally on a variety of
platforms, we need to respect the ACCESS flag.

Thanks to the if-else hoisting implemented earlier in the series, this isn't too
terrible of a band-aid on Asahi:

    total instructions in shared programs: 1499674 -> 1507699 (0.54%)
    instructions in affected programs: 78865 -> 86890 (10.18%)
    helped: 0
    HURT: 337
    Instructions are HURT.

    total bytes in shared programs: 10238284 -> 10279308 (0.40%)
    bytes in affected programs: 554504 -> 595528 (7.40%)
    helped: 3
    HURT: 334
    Bytes are HURT.

    total halfregs in shared programs: 452049 -> 454015 (0.43%)
    halfregs in affected programs: 7569 -> 9535 (25.97%)
    helped: 7
    HURT: 150
    Halfregs are HURT.

There are no shader-db changes on ir3 as expected, since ir3 can safely
speculate all instructions in my shader-db.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir/opt_preamble: Move phis for movable if's
Alyssa Rosenzweig [Fri, 30 Jun 2023 15:29:35 +0000 (11:29 -0400)]
nir/opt_preamble: Move phis for movable if's

Add infrastructure to reconstruct if's. Later in the series, this will let us
hoist loads from inside uniform if's without speculating. For now, it lets us
handle phi's in nir_opt_preamble in a straightforward way.

Results on AGX are good:

   total instructions in shared programs: 1504730 -> 1499674 (-0.34%)
   instructions in affected programs: 153673 -> 148617 (-3.29%)
   helped: 496
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 10287768 -> 10238284 (-0.48%)
   bytes in affected programs: 1113724 -> 1064240 (-4.44%)
   helped: 496
   HURT: 0
   Bytes are helped.

   total halfregs in shared programs: 452669 -> 452049 (-0.14%)
   halfregs in affected programs: 14825 -> 14205 (-4.18%)
   helped: 152
   HURT: 99
   Halfregs are helped.

   total threads in shared programs: 16469504 -> 16470784 (<.01%)
   threads in affected programs: 8960 -> 10240 (14.29%)
   helped: 10
   HURT: 0
   Threads are helped.

Results on ir3 is a bit more of a wash but still should be a win overall: The
regression in moves seems scary, but the cost model already accounts for them as
evidenced by instruction count coming out ahead.

   total instructions in shared programs: 3108750 -> 3105993 (-0.09%)
   instructions in affected programs: 317367 -> 314610 (-0.87%)
   helped: 675
   HURT: 242
   Instructions are helped.

   total nops in shared programs: 673152 -> 675048 (0.28%)
   nops in affected programs: 74551 -> 76447 (2.54%)
   helped: 353
   HURT: 347
   Inconclusive result (%-change mean confidence interval includes 0).

   total non-nops in shared programs: 2435598 -> 2430945 (-0.19%)
   non-nops in affected programs: 232664 -> 228011 (-2.00%)
   helped: 816
   HURT: 38
   Non-nops are helped.

   total mov in shared programs: 78201 -> 84011 (7.43%)
   mov in affected programs: 10726 -> 16536 (54.17%)
   helped: 60
   HURT: 781
   Mov are HURT.

   total cov in shared programs: 74964 -> 74906 (-0.08%)
   cov in affected programs: 273 -> 215 (-21.25%)
   helped: 17
   HURT: 0
   Cov are helped.

   total dwords in shared programs: 6716814 -> 6748726 (0.48%)
   dwords in affected programs: 879778 -> 911690 (3.63%)
   helped: 12
   HURT: 948
   Dwords are HURT.

   total full in shared programs: 193210 -> 193212 (<.01%)
   full in affected programs: 278 -> 280 (0.72%)
   helped: 12
   HURT: 22
   Inconclusive result (value mean confidence interval includes 0).

   total constlen in shared programs: 493632 -> 494816 (0.24%)
   constlen in affected programs: 19904 -> 21088 (5.95%)
   helped: 9
   HURT: 306
   Constlen are HURT.

   total cat0 in shared programs: 742476 -> 745046 (0.35%)
   cat0 in affected programs: 84455 -> 87025 (3.04%)
   helped: 277
   HURT: 489
   Cat0 are HURT.

   total cat1 in shared programs: 153303 -> 159059 (3.75%)
   cat1 in affected programs: 17810 -> 23566 (32.32%)
   helped: 69
   HURT: 780
   Cat1 are HURT.

   total cat2 in shared programs: 1144508 -> 1140731 (-0.33%)
   cat2 in affected programs: 121284 -> 117507 (-3.11%)
   helped: 841
   HURT: 0
   Cat2 are helped.

   total cat3 in shared programs: 942098 -> 934804 (-0.77%)
   cat3 in affected programs: 87140 -> 79846 (-8.37%)
   helped: 855
   HURT: 1
   Cat3 are helped.

   total cat4 in shared programs: 65261 -> 65249 (-0.02%)
   cat4 in affected programs: 42 -> 30 (-28.57%)
   helped: 12
   HURT: 0
   Cat4 are helped.

   total sstall in shared programs: 237311 -> 241281 (1.67%)
   sstall in affected programs: 33755 -> 37725 (11.76%)
   helped: 179
   HURT: 493
   Sstall are HURT.

   total (ss) in shared programs: 58166 -> 58795 (1.08%)
   (ss) in affected programs: 4535 -> 5164 (13.87%)
   helped: 35
   HURT: 664
   (ss) are HURT.

   total systall in shared programs: 503784 -> 503805 (<.01%)
   systall in affected programs: 3170 -> 3191 (0.66%)
   helped: 16
   HURT: 13
   Inconclusive result (value mean confidence interval includes 0).

   total (sy) in shared programs: 27261 -> 27259 (<.01%)
   (sy) in affected programs: 76 -> 74 (-2.63%)
   helped: 8
   HURT: 5
   Inconclusive result (value mean confidence interval includes 0).

   total waves in shared programs: 439848 -> 439872 (<.01%)
   waves in affected programs: 160 -> 184 (15.00%)
   helped: 12
   HURT: 0
   Waves are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir/opt_preamble: Unify foreach_use logic
Alyssa Rosenzweig [Fri, 30 Jun 2023 17:01:06 +0000 (13:01 -0400)]
nir/opt_preamble: Unify foreach_use logic

Deduplication in prep for reconstructing if's.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir/opt_preamble: Preserve IR when replacing phis
Alyssa Rosenzweig [Fri, 30 Jun 2023 18:21:29 +0000 (14:21 -0400)]
nir/opt_preamble: Preserve IR when replacing phis

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir/opt_preamble: Walk cf_list manually
Alyssa Rosenzweig [Mon, 26 Jun 2023 21:38:30 +0000 (17:38 -0400)]
nir/opt_preamble: Walk cf_list manually

The way backends walk NIR when translating. This will make it easy to filter
can_move based on the parent control flow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agoir3: Model cost of phi nodes for opt_preamble
Alyssa Rosenzweig [Tue, 18 Jul 2023 20:19:03 +0000 (16:19 -0400)]
ir3: Model cost of phi nodes for opt_preamble

It can be beneficial to move phi nodes, even though they can often be coalesced.
Model this cost so nir_opt_preamble can make good decisions about hoisting phi
nodes (and by extension, if-statements) into the preamble.

At this point in the series, this has no effect, but it will avoid certain
shader-db regressions associated with the nir_opt_preamble changes later in the
series.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agoir3: Set CAN_SPECULATE before opt_preamble
Alyssa Rosenzweig [Fri, 30 Jun 2023 13:46:45 +0000 (09:46 -0400)]
ir3: Set CAN_SPECULATE before opt_preamble

Speculating these loads is safe, but nir_opt_preamble doesn't know that. Set the
ACCESS bits appropriately to let it know.

This will avoid any code gen regression from the nir_opt_preamble change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agonir: Add ACCESS_CAN_SPECULATE
Alyssa Rosenzweig [Fri, 30 Jun 2023 13:10:56 +0000 (09:10 -0400)]
nir: Add ACCESS_CAN_SPECULATE

Determining whether it is safe to hoist a load instruction out of control flow
depends on complex hardware and driver details. Rather than encoding this as
knobs in every NIR pass that wants to do so (notably nir_opt_preamble and
nir_opt_peephole_select), add a per-load ACCESS flag for backends to set.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>

13 months agodocs/vulkan: fixup some typos
Jani Nikula [Tue, 10 Oct 2023 07:17:46 +0000 (09:17 +0200)]
docs/vulkan: fixup some typos

The type is called vk_object_base, not vk_vk_objet_base... This should
fix the cross-referencing of this type.

Fixes: f6d4641433e ("vulkan,docs: Document vk_instance")
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25634>

13 months agoci/traces: rename upload function to reflect it works with S3
David Heidelberg [Sun, 8 Oct 2023 21:09:33 +0000 (23:09 +0200)]
ci/traces: rename upload function to reflect it works with S3

Cosmetic change.

Acked-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25606>

13 months agoci/traces: keep images for every job except the performance testing
David Heidelberg [Sun, 8 Oct 2023 20:34:32 +0000 (22:34 +0200)]
ci/traces: keep images for every job except the performance testing

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

Acked-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25606>

13 months agoci/traces: upload only missing trace images
David Heidelberg [Sun, 8 Oct 2023 20:01:50 +0000 (22:01 +0200)]
ci/traces: upload only missing trace images

Right now, S3 always returns something, so we need to check
the content-type .

Acked-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25606>

13 months agozink: use warn_missing_feature for missing modifier support
Samuel Pitoiset [Tue, 10 Oct 2023 11:09:43 +0000 (13:09 +0200)]
zink: use warn_missing_feature for missing modifier support

To avoid spamming VKCTS output.

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

13 months agoci/etnaviv: allow failure on failing test
Erik Faye-Lund [Tue, 10 Oct 2023 10:10:08 +0000 (12:10 +0200)]
ci/etnaviv: allow failure on failing test

This test has been failing every nightly pipeline on the CI for a long,
long time. It seems nobody is currently interested in fixing it, so
let's just allow the failure for now.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/9967

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25635>

13 months agoci/etnaviv: update ci expectation
Erik Faye-Lund [Tue, 10 Oct 2023 10:09:47 +0000 (12:09 +0200)]
ci/etnaviv: update ci expectation

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25635>

13 months agotu: Zero init tu_render_pass and tu_subpass for dynamic rendering
Danylo Piliaiev [Fri, 6 Oct 2023 14:54:21 +0000 (16:54 +0200)]
tu: Zero init tu_render_pass and tu_subpass for dynamic rendering

The way we init render pass related structures is dangerous with when
structs are not zero initialized - too easy to miss a field. There
were already at least two issues with it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25592>

13 months agotu: Fix stale tu_render_pass_attachment::store_stencil with dyn rendering
Danylo Piliaiev [Fri, 6 Oct 2023 14:46:59 +0000 (16:46 +0200)]
tu: Fix stale tu_render_pass_attachment::store_stencil with dyn rendering

Attachment initialization helpers expect zeroed memory by default.

Fixes a hang when running Subnautica with TU_DEBUG="gmem".
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8702#note_1932003

Fixes: ed125e6cca188275631641784fcf3ddcbcfef193
("tu: Initial support for dynamic rendering")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25592>

13 months agonir: Use a tagged pointer for nir_src parents
Alyssa Rosenzweig [Mon, 14 Aug 2023 14:38:03 +0000 (10:38 -0400)]
nir: Use a tagged pointer for nir_src parents

This allows us to pack the is_if boolean into the bottom bit of the parent
pointer, eliminating the boolean and hence shrinking the nir_src by 8 bytes (due
to the extra 63 bits of padding incurred in the old layout).

Because all access is forced through helpers now, this is a local change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agonir: Assert the nir_src union is used safely
Alyssa Rosenzweig [Mon, 14 Aug 2023 14:41:23 +0000 (10:41 -0400)]
nir: Assert the nir_src union is used safely

It is undefined behaviour in C to read a different member of a union than was
written. Nothing in-tree should be using this behaviour with the nir_src union:
nir_if should never be read as nir_instr and vice versa. Assert this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agonir: Use getters for nir_src::parent_*
Alyssa Rosenzweig [Mon, 14 Aug 2023 13:58:47 +0000 (09:58 -0400)]
nir: Use getters for nir_src::parent_*

First, we need to give the parent_instr field a unique name to be able to
replace with a helper.  We have parent_instr fields for both nir_src and
nir_def, so let's rename nir_src::parent_instr in preparation for rework.

This was done with a combination of sed and manual fix-ups.

Then we use semantic patches plus manual fixups:

    @@
    expression s;
    @@

    -s->renamed_parent_instr
    +nir_src_parent_instr(s)

    @@
    expression s;
    @@

    -s.renamed_parent_instr
    +nir_src_parent_instr(&s)

    @@
    expression s;
    @@

    -s->parent_if
    +nir_src_parent_if(s)

    @@
    expression s;
    @@

    -s.renamed_parent_if
    +nir_src_parent_if(&s)

    @@
    expression s;
    @@

    -s->is_if
    +nir_src_is_if(s)

    @@
    expression s;
    @@

    -s.is_if
    +nir_src_is_if(&s)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agonir: Use set_parent_instr internally
Alyssa Rosenzweig [Mon, 14 Aug 2023 14:35:43 +0000 (10:35 -0400)]
nir: Use set_parent_instr internally

This properly clears is_if.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agonir: Add trivial nir_src_* getters
Alyssa Rosenzweig [Mon, 14 Aug 2023 14:33:18 +0000 (10:33 -0400)]
nir: Add trivial nir_src_* getters

These will become nontrivial later in the series. For now these have no smarts
in them, in order to make the conversion completely mechanical.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agolima/pp: Do not use union undefined behaviour
Alyssa Rosenzweig [Tue, 15 Aug 2023 13:59:01 +0000 (09:59 -0400)]
lima/pp: Do not use union undefined behaviour

It is invalid to read parent_instr for an if-use (or parent_if for a
non-if-use). Make sure we read the right one when handling if-uses.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

13 months agoradv: fix IB alignment
Samuel Pitoiset [Fri, 6 Oct 2023 10:04:50 +0000 (12:04 +0200)]
radv: fix IB alignment

This re-introduces "radv: fix alignment of DGC command buffers" and
"radv/amdgpu: fix alignment of command buffers" which were valid
changes.

IBs need to be aligned to the IB size requirement, not the number of
padded NOPs.

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

13 months agolavapipe: expose planar ycbcr formats and new ycbcr features
Dave Airlie [Mon, 9 Oct 2023 04:52:22 +0000 (14:52 +1000)]
lavapipe: expose planar ycbcr formats and new ycbcr features

This enables some extensions and a bunch of formats for ycbcr
support.

dEQP-VK.api.info.format_properties.g8_b8_r8_3plane_420_unorm,Fail
dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm,Fail

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: handle planes in texture lowering.
Dave Airlie [Fri, 6 Oct 2023 06:52:48 +0000 (16:52 +1000)]
lavapipe: handle planes in texture lowering.

This uses the descriptor set info to lower the texture/sampler
handlers properly using the stride.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: add descriptor sets bindings for planar images
Dave Airlie [Fri, 6 Oct 2023 06:22:51 +0000 (16:22 +1000)]
lavapipe: add descriptor sets bindings for planar images

This adds strided descriptor bindings that are used to handle
planar image/samplers.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: handle planes in get image sub resource
Dave Airlie [Fri, 6 Oct 2023 06:07:38 +0000 (16:07 +1000)]
lavapipe: handle planes in get image sub resource

image sub resources need to take planes into account in the calculations.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: handle planes in copies
Dave Airlie [Fri, 6 Oct 2023 05:53:35 +0000 (15:53 +1000)]
lavapipe: handle planes in copies

This adds plane support to the various copy paths.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: allocate image and image view planes.
Dave Airlie [Fri, 6 Oct 2023 05:37:38 +0000 (15:37 +1000)]
lavapipe: allocate image and image view planes.

This allocate planes and handles disjoint.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: start introducing planes structure.
Dave Airlie [Fri, 6 Oct 2023 05:15:05 +0000 (15:15 +1000)]
lavapipe: start introducing planes structure.

this just introduces a single plane and refactors code to use it.

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

13 months agolavapipe: cleanup copy code to use a local region variable.
Dave Airlie [Mon, 9 Oct 2023 04:13:36 +0000 (14:13 +1000)]
lavapipe: cleanup copy code to use a local region variable.

This should make no functional difference, except cleanup the code.

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

13 months agolavapipe: convert sampler to use vk base class.
Dave Airlie [Fri, 6 Oct 2023 08:21:33 +0000 (18:21 +1000)]
lavapipe: convert sampler to use vk base class.

This just makes things a bit cleaner, and reuses the common code.

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

13 months agollvmpipe: don't support planar formats for buffers.
Dave Airlie [Tue, 26 Sep 2023 03:11:53 +0000 (13:11 +1000)]
llvmpipe: don't support planar formats for buffers.

This stops lavapipe exposing incorrect support.

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: don't emit blit src/dst for subsampled formats.
Dave Airlie [Tue, 26 Sep 2023 02:55:21 +0000 (12:55 +1000)]
lavapipe: don't emit blit src/dst for subsampled formats.

Fixes dEQP-VK.api.info.format_properties.b8g8r8g8_422_unorm

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agollvmpipe: don't create texture functions for planar textures.
Dave Airlie [Fri, 6 Oct 2023 02:56:39 +0000 (12:56 +1000)]
llvmpipe: don't create texture functions for planar textures.

Since we can't sample from these directly, just don't create the
functions.

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

13 months agolavapipe: support host image copying on compressed texture formats
Dave Airlie [Fri, 6 Oct 2023 01:22:50 +0000 (11:22 +1000)]
lavapipe: support host image copying on compressed texture formats

dEQP-VK.image.host_image_copy.query.linear.bc5_snorm_block,Fail
dEQP-VK.image.host_image_copy.query.linear.bc7_unorm_block,Fail
dEQP-VK.image.host_image_copy.query.optimal.bc5_snorm_block,Fail
dEQP-VK.image.host_image_copy.query.optimal.bc7_unorm_block,Fail

Fixes: 9e9d90c6c381 ("lavapipe: VK_EXT_host_image_copy")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: fix subresource layers asserts
Dave Airlie [Fri, 6 Oct 2023 00:49:29 +0000 (10:49 +1000)]
lavapipe: fix subresource layers asserts

dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.array.all_remaining_layers

Fixes: 35c02f79c9b82b5 ("lavapipe: add some asserts for blit region extents")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>

13 months agolavapipe: fix some whitespace in advance of other changes.
Dave Airlie [Mon, 9 Oct 2023 05:56:20 +0000 (15:56 +1000)]
lavapipe: fix some whitespace in advance of other changes.

This is just some tab and trailing whitespace removal.

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

13 months agoradeonsi: enable aco compile for part mode ps
Qiang Yu [Thu, 17 Aug 2023 03:11:19 +0000 (11:11 +0800)]
radeonsi: enable aco compile for part mode ps

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

13 months agoradeonsi: add ps epilog shader part build
Qiang Yu [Thu, 17 Aug 2023 03:06:11 +0000 (11:06 +0800)]
radeonsi: add ps epilog shader part build

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

13 months agoradeonsi: fill aco shader info for ps part
Qiang Yu [Fri, 11 Aug 2023 09:26:37 +0000 (17:26 +0800)]
radeonsi: fill aco shader info for ps part

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

13 months agoradeonsi: extract si_get_ps_epilog_args to be shared with aco
Qiang Yu [Fri, 11 Aug 2023 09:21:27 +0000 (17:21 +0800)]
radeonsi: extract si_get_ps_epilog_args to be shared with aco

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

13 months agoradeonsi: add ps prolog shader part build
Qiang Yu [Thu, 10 Aug 2023 02:19:33 +0000 (10:19 +0800)]
radeonsi: add ps prolog shader part build

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

13 months agoac,radeonsi: remove unused ps prolog key fields
Qiang Yu [Mon, 7 Aug 2023 07:18:12 +0000 (15:18 +0800)]
ac,radeonsi: remove unused ps prolog key fields

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

13 months agoradeonsi: extract si_get_ps_prolog_args to be shared with aco
Qiang Yu [Mon, 7 Aug 2023 06:28:50 +0000 (14:28 +0800)]
radeonsi: extract si_get_ps_prolog_args to be shared with aco

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

13 months agoradeonsi: extract si_prolog_get_internal_binding_slot
Qiang Yu [Mon, 7 Aug 2023 06:25:14 +0000 (14:25 +0800)]
radeonsi: extract si_prolog_get_internal_binding_slot

To be shared with ps prolog.

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

13 months agoradeonsi: init spi_ps_input_addr for part mode ps
Qiang Yu [Sun, 6 Aug 2023 09:19:46 +0000 (17:19 +0800)]
radeonsi: init spi_ps_input_addr for part mode ps

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

13 months agoradeonsi: reduce sgpr count for scratch_offset when aco
Qiang Yu [Sun, 6 Aug 2023 03:12:17 +0000 (11:12 +0800)]
radeonsi: reduce sgpr count for scratch_offset when aco

aco add scratch_offset to shader args explicitly.

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

13 months agoaco: wait memory ops done before go to next shader part
Qiang Yu [Sat, 19 Aug 2023 07:36:00 +0000 (15:36 +0800)]
aco: wait memory ops done before go to next shader part

Next part don't know whether p_end_with_regs args are loaded from
memory ops or not, need to wait it's done here.

Other memory load needs to be waited too like:
  a = load_mem()
  b = ...
  if (...) {
    wait_mem(a)
    store_mem(a)
  }
  p_end_with_regs(b)

"a" still needs to be waited, otherwise next shader part regs may
be overwritten by unfinished memory loads.

Memory stores are waited too. When >=gfx10 and last VGT has no
parameter export, we need to wait all memeory stores done before
pos export (see ac_nir_export_position). So when merged shader
(ES+GS or VS+GS) is partially built, first stage needs to wait
all memory stores done, otherwise second stage don't know if
any memory stores pending before.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signe-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>

13 months agoaco: create exit block for p_end_with_regs to branch to
Qiang Yu [Thu, 24 Aug 2023 02:11:40 +0000 (10:11 +0800)]
aco: create exit block for p_end_with_regs to branch to

To handle ps discard in radeonsi part mode shader.

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

13 months agoaco: fix assertion fail when program contains empty block
Qiang Yu [Mon, 21 Aug 2023 02:44:45 +0000 (10:44 +0800)]
aco: fix assertion fail when program contains empty block

radeonsi may generate empty main shader or an empty exit block
for p_end_with_regs to jump to.

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

13 months agoaco: do not fix_exports when program has epilog
Qiang Yu [Thu, 17 Aug 2023 07:17:20 +0000 (15:17 +0800)]
aco: do not fix_exports when program has epilog

PS with epilog does not need to fix_exports. And radeonsi use
p_end_with_regs so does not have jump instruction at last.

radeonsi may also have exec restore instruction, so may break
before reach to p_end_with_regs.

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

13 months agoaco,radv,radeonsi: pass spi ps input ena and addr
Qiang Yu [Sat, 19 Aug 2023 03:20:00 +0000 (11:20 +0800)]
aco,radv,radeonsi: pass spi ps input ena and addr

radeonsi may pass different ena and addr when part mode shader.

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

13 months agoaco: compact ps expilog color export for radeonsi
Qiang Yu [Fri, 25 Aug 2023 08:39:19 +0000 (16:39 +0800)]
aco: compact ps expilog color export for radeonsi

radeonsi need to compact color export for ps epilog while radv does not.
radv will fill empty color slot, so won't affected by this change.

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

13 months agoaco,radv: add radeonsi spec ps epilog code
Qiang Yu [Thu, 17 Aug 2023 02:13:26 +0000 (10:13 +0800)]
aco,radv: add radeonsi spec ps epilog code

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

13 months agoaco: simplify export_fs_mrt_color
Qiang Yu [Tue, 15 Aug 2023 09:27:48 +0000 (17:27 +0800)]
aco: simplify export_fs_mrt_color

It's now used by ps epilog only.

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

13 months agoaco,radv: rename ps epilog info inputs to colors
Qiang Yu [Mon, 14 Aug 2023 09:05:32 +0000 (17:05 +0800)]
aco,radv: rename ps epilog info inputs to colors

Will add other mrtz args for radeonsi.

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

13 months agoaco,radv: remove unused ps epilog info fields
Qiang Yu [Mon, 14 Aug 2023 01:43:18 +0000 (09:43 +0800)]
aco,radv: remove unused ps epilog info fields

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

13 months agoaco: add create_fs_end_for_epilog for radeonsi
Qiang Yu [Fri, 11 Aug 2023 08:58:36 +0000 (16:58 +0800)]
aco: add create_fs_end_for_epilog for radeonsi

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

13 months agoaco: handle ps outputs from radeonsi
Qiang Yu [Fri, 11 Aug 2023 01:57:42 +0000 (09:57 +0800)]
aco: handle ps outputs from radeonsi

radeonsi will keep outputs <FRAG_RESULT_DATA0.

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

13 months agoaco: add ps prolog generation for radeonsi
Qiang Yu [Wed, 9 Aug 2023 07:07:39 +0000 (15:07 +0800)]
aco: add ps prolog generation for radeonsi

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

13 months agoaco: remove p_end_with_regs from needs_exact()
Qiang Yu [Fri, 25 Aug 2023 06:25:20 +0000 (14:25 +0800)]
aco: remove p_end_with_regs from needs_exact()

ps needs to handle wqm:
1. main part may compute with args from prolog in wqm mode, so
   prolog need to compute these args in wqm mode too.
2. prolog and main part need to end with exact exec, so next
   shader part which inherit previous shader part's exec won't
   do valid job for helper threads

1 need p_end_with_regs to operate in wqm mode and itself can't
be exact, otherwise some move instruction added by it won't be
in wqm mode so helper threads' compute result is not passed to
next shader part as args.

2 is done by p_end_wqm added by finish_program automatically
after p_end_with_regs.

Piglit tests can trigger the problem:

1. gl-2.1-polygon-stipple-fs
  a. ps prolog call discard_if
  b. ps main pass wqm exec to epilog
  c. ps epilog export color for discarded pixel

2. fs-fwidth-color.shader_test
  a. ps prolog need to pass args computed in wqm mode
  b. set p_end_with_regs to exact will end wqm mode before
     the move instructions, so helper threads's result is not
     passed to next shader part

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