Commit Graph

177588 Commits

Author SHA1 Message Date
Mike Blumenkrantz
738eb0d78c ci: bump VVL to 1.3.263
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24925>
2023-09-09 11:29:36 +00:00
Jordan Justen
ddc3c18e4a intel/dev: Update device string for MTL PCI ID 0x7d55
Ref: bspec 55420
Cc: mesa-stable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25073>
2023-09-09 07:00:30 +00:00
Faith Ekstrand
bb91e0306c nvk: Invalidate the texture cache in PipelineBarrier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Faith Ekstrand
dff769e2bd nvk: Set the discard bit for Z/S self-deps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Faith Ekstrand
35e0989779 nvk: Don't add a dummy attachment when gl_SampleMask is written
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Ian Romanick
8ce4d7a08d intel/compiler: Don't evict for workgroup-scope fences
Flushing and invalidating caches isn't necessary for workgroup scope
fences.  In fact, the DP_FLUSH_TYPE docs (BSpec 54041) say:

   "If the fence scope is Local or Threadgroup, HW ignores the flush
    type and operates as if it was set to None(no flush)"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:25 +00:00
Ian Romanick
5eddf60e56 intel/compiler: Combine control barriers with identical memory semantics
This prevents the second barrier generating a spurious, identical fence
message as the first barrier.

fossil-db stats on Alchemist:

   Totals:
   Instrs: 196513342 -> 196512777 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14271426028 -> 14271404569 (-0.00%); split: -0.00%, +0.00%
   Send messages: 8021892 -> 8021770 (-0.00%)

   Totals from 46 (0.01% of 653252) affected shaders:
   Instrs: 76761 -> 76196 (-0.74%); split: -0.75%, +0.01%
   Cycles: 2027946 -> 2006487 (-1.06%); split: -1.45%, +0.39%
   Send messages: 7589 -> 7467 (-1.61%)

Nothing in shader-db was affected.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:25 +00:00
Kenneth Graunke
9f98f20c58 anv: Use nir_opt_barrier_modes() to drop unnecessary barriers
fossil-db stats on Alchemist:

   Totals:
   Instrs: 196514947 -> 196513342 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14271450761 -> 14271426028 (-0.00%); split: -0.00%, +0.00%
   Send messages: 8022316 -> 8021892 (-0.01%)

   Totals from 43 (0.01% of 653252) affected shaders:
   Instrs: 98558 -> 96953 (-1.63%); split: -1.63%, +0.00%
   Cycles: 15867801 -> 15843068 (-0.16%); split: -0.17%, +0.02%
   Send messages: 8997 -> 8573 (-4.71%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
2b14618daa glsl: Use nir_opt_barrier_modes() to drop unnecessary barriers
iris shader-db stats on Alchemist:

    total instructions in shared programs: 23150249 -> 23142733 (-0.03%)
    instructions in affected programs: 157322 -> 149806 (-4.78%)
    helped: 105
    HURT: 2
    helped stats (abs) min: 2 max: 821 x̄: 71.61 x̃: 15
    helped stats (rel) min: 0.13% max: 27.56% x̄: 6.21% x̃: 2.35%
    HURT stats (abs)   min: 1 max: 2 x̄: 1.50 x̃: 1
    HURT stats (rel)   min: 0.18% max: 0.23% x̄: 0.20% x̃: 0.20%
    95% mean confidence interval for instructions value: -101.99 -38.50
    95% mean confidence interval for instructions %-change: -7.59% -4.58%
    Instructions are helped.

    total sends in shared programs: 1036916 -> 1035366 (-0.15%)
    sends in affected programs: 15274 -> 13724 (-10.15%)
    helped: 108 / HURT: 0
    helped stats (abs) min: 1 max: 162 x̄: 14.35 x̃: 3
    helped stats (rel) min: 0.88% max: 33.83% x̄: 9.81% x̃: 5.05%
    95% mean confidence interval for sends value: -20.79 -7.92
    95% mean confidence interval for sends %-change: -11.66% -7.95%

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
5754461f05 dxil: Set UAV_FENCE_THREAD_GROUP any time global isn't required
With the new nir_opt_barrier_modes() pass, we may encounter control
barriers with no memory modes set, such as:

   @barrier () (execution_scope=WORKGROUP, memory_scope=WORKGROUP, mem_semantics=ACQ|REL, mem_modes=0)

The DXIL validator documentation [1] mentions an
INSTR.BARRIERMODENOMEMORY validation rule:

   "sync must include some form of memory barrier - _u (UAV) and/or
    _g (Thread Group Shared Memory). Only _t (thread group sync) is
    optional."

We were generating a dx.op.barrier instruction with only one flag,
DXIL_BARRIER_MODE_SYNC_THREAD_GROUP.  This seems to run afoul of the
above validator rule.  So, this patch adjusts the code generator to
set DXIL_BARRIER_MODE_UAV_FENCE_THREAD_GROUP too, whenever
UAV_FENCE_GLOBAL isn't required.

[1] https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
fb3e37a014 virgl, nir_to_tgsi: Add a hack for promoting partial memory barriers
Most drivers will want nir_opt_barrier_modes() to optimize out
unnecessary memory barrier modes.  However, virgl has to translate
back to GLSL, which means it can really only handle partial memory
barriers in compute shaders today, because there isn't a proper
way to express them otherwise.  Just ask nir_to_tgsi to promote
these back to full barriers as a workaround.

See KHR-GL43.shader_storage_buffer_object.advanced-readWrite-case1
on virpipe-on-gl as a case where this hack is needed.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
dd92fd8fcc lavapipe: Don't delete control barriers
Control barriers still need to do synchronization even if there are no
associated memory barrier modes.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
fc0aaa81ee nir: Reduce the scope of shared memory barriers
Originally written by Ian Romanick for the Intel backend, but ported
to the new nir_opt_barrier_modes() common optimization pass.  Ian's
original explanation and commit message follows:

Shared memory only exists within a workgroup, so synchronizing it beyond
workgroup scope is nonsense.

Basically every SPIR-V compiler generates operations like

    OpMemoryBarrier(/*Memory*/Device,
                    /*Semantics*/AcquireRelease | WorkgroupMemory)

This is suggested in numerous places, including
https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt.
Even Mesa's glsl_to_nir pass does this. This advice, which has been
copy-and-pasted everywhere, is contrary to issue 13 in the original
GL_ARB_compute_shader spec:

   "Since shared memory is only accessible to threads within a single
    work group, memoryBarrierShared() also only requires synchronization
    with other threads in the same work group."

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
7dd897e1cd nir: Add an optimization pass to reduce barrier modes
Many shaders issue full memory barriers, which may need to synchronize
access to images, SSBOs, shared local memory, or global memory.
However, many of them only use a subset of those memory types - say,
only SSBOs.

Shaders may also have patterns such as:

   1. shared local memory access
   2. barrier with full variable modes
   3. more shared local memory access
   4. image access

In this case, the barrier is needed to ensure synchronization between
the various shared memory operations.  Image reads and writes do also
exist, but they are all on one side of the barrier, so it is a no-op for
image access.  We can drop the image mode from the barrier here too.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
1c3706fc28 nir: Fix function parameter indentation in nir_opt_barriers.c
The first parameter should be on the first line, and any subsequent
lines should line up.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Mike Blumenkrantz
17a35412dc zink: re-rework i/o variable handling to make having variables entirely optional
old variables are now only used for copying names if possible, which should
make it possible for zink to process shaders which have no variables at all

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
8b4904405e zink: use right function to get src_type in eliminate_io_wrmasks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
459b49a174 zink: add a new linker pass to handle mismatched i/o components
this is the inverted version of rewrite_read_as_0 which tests for mismatched
component i/o on a given location and rewrites the inputs to zero if the
producer shader didn't write to the component

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
9af2f17937 zink: create new vars without copying existing ones
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
86668052dd zink: use explicit sizing for builtins when creating variables
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
53dab1cf40 zink: use MAX_PATCH_VERTICES directly for arrayed io var sizing
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
e81048a0e2 zink: use explicit stride from types instead of copying old_var stride
should be no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
3c422ba518 zink: simplify an arrayed io check during variable creation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
dcc1d115f9 zink: use nir_io_semantics::num_slots for indirect var creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
a91d920a63 zink: delete some bindless io lowering code
now that variables are pre-converted this is no longer necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
7fdc74b078 zink: fix typing on bindless io lowering
with lowered io this should always be an ivec2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
a3ce422a99 zink: reorder bindless io lowering
should be no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
e87b24719f zink: set is_xfb=false for all i/o variables
this can affect streamout generation, even though it so far hasn't

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
20cbc6b9a0 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
39b814b2a6 zink: handle multi-plane implicit sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
d4f8ad27f2 zink: handle implicit sync for dmabufs
this adds explicit queue transitions to FOREIGN at the end of the batch
for all written-to dmabufs, then also adds signal/wait semaphores
using the dmabuf fds

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
4932e65f1e zink: hook up cached fd semaphore usage for batch signal/waits
not yet used, matches handling of normal semaphores

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
7662ddc426 zink: add a util for getting cached fd semaphores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
5f7333b188 zink: add a screen cache for fd semaphores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
8d3ac89f97 zink: add another submitinfo for fd semaphore waits
these are semaphores created with VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT
and can't be cached with the others

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
ed17b6f817 zink: make submitinfo handling easier to manage with enum
this was starting to get hard to read

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
ffc371ba61 zink: add a third submitinfo (unused for now)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
efc339f958 zink: make zink_resource_image_barrier2_init public
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
a30deb5d31 zink: use a pointer to simplify submit struct mechanics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Yiwei Zhang
68a478870d venus: expose KHR_external_fence/sempahore_fd extensions
Re-purpose renderer has_external_sync to cover explicit sync emulation
in venus, so that we don't have to add a new flag to distinguish the
emulation path enablement for virtgpu and vtest.

This is to unblock zink implicit sync hanlding against venus for now,
and soon we should migrate to virtgpu fence passing.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25127>
2023-09-09 03:26:25 +00:00
Eric Engestrom
c9c2ba3839 ci: drop clover leftover
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24098>
2023-09-09 01:49:25 +00:00
Marek Olšák
d11900d5e7 meson: use llvm-config instead of cmake to fix linking errors with meson 1.2.1
The cmake path picks a random LLVM in /usr, which happens to be 32-bit LLVM,
which fails to link with 64-bit Mesa. This is a meson, cmake, or LLVM bug.

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25042>
2023-09-09 00:56:41 +00:00
Sagar Ghuge
6a89507be8 anv: Program and emit STATE_COMPUTE_MODE
Don't rely on the HW to set values correctly so just emit
STATE_COMPUTE_MODE with default values set to zero.

Also, this change includes workaround changes:-
   - 14015808183 (Parent HSD 14015782607)  - Need to emit pipe control
     with HDC flush and untyped cache flush set to 1 when CCS has
     non-pipelined state update with STATE_COMPUTE_MODE.
   - 14014427904 (Parent HSD 22013045878) - We need additional
     invalidate/flush when emitting non-pipelined state commands with
     multiple CCS enabled.

v2: (Tapani)
- Use lineage HSD numbers for check
- Don't use poisoned WA directly
- Use intel_needs_workaround helper

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24508>
2023-09-08 23:08:26 +00:00
Sagar Ghuge
f0d5c7848a intel/genxml: Add STATE_COMPUTE_MODE instruction
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24508>
2023-09-08 23:08:26 +00:00
Sagar Ghuge
7901b536ee iris: Enable always flush cache with DEBUG_STALL option
With DEBUG_STALL option, enable always cache flush option for debugging
purpose that aligns with anv.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25108>
2023-09-08 20:57:20 +00:00
Konstantin Seurer
28e1e33c32 radv: Don't use the depth image view for depth bias emission
If the application records a secondary command buffer that inherits
a render pass without specifying a framebuffer, we should still be able
to emit the depth bias state properly.

Fixes: 266b2cf ("radv: implement VK_EXT_depth_bias_control")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9588
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25018>
2023-09-08 19:26:59 +00:00
Tatsuyuki Ishi
4171d9ff84 radv/amdgpu: Use rwlock to protect access to virtual BOs.
Vulkan provides no external synchronization guarantees on sparse memory
objects. Use a per-BO rwlock to prevent reading data mid-update.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24806>
2023-09-08 18:53:37 +00:00
Lionel Landwerlin
eb0c197090 anv: bound image usages to the associated queue family
When applying barriers for image transitions, we're currently
considering all possible usages of an image. But when running on a
compute only queue for example, the usage of an image will never be
one of those :
   - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR

Removing unused usages for the compute queue allows us to reduce the
scope of the VK_IMAGE_LAYOUT_GENERAL for example. This a bunch of
transition operation that are completely useless when dealing with
barriers on the compute queue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25092>
2023-09-08 18:05:08 +00:00
Eric Engestrom
fafb1a897e ci/b2c: drop logic to remove install.tar
It's still buggy, and it turns out `mcli` has some logic to check if
a file really needs to be re-uploaded, so this doesn't actually change
much to the time uploads take.

This effectively reverts https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24196

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25114>
2023-09-08 17:28:15 +00:00
Lionel Landwerlin
80a352c87c anv: remove aux checking asserts
Zink is running into those asserts on CI. The problem is that with non
auxilary modifiers like I915_FORMAT_MOD_Y_TILED, we might still
allocate larger buffers with IMPLICIT_CCS.

This isn't a complete fix, the real fix with come with
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003 where
we stop overallocating and those assert will match the private binding
allocation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 569f80f2df ("anv: Reduce accesses of isl_mod_info->aux_usage")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25099>
2023-09-08 16:57:53 +00:00