Commit Graph

169756 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 657e82a72f vulkan: Add common features2_to_features
Needed to correctly implement GetPhysicalDeviceFormatProperties2.

Cc stable so the turnip patch can get backported cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:27 -04:00
Mike Blumenkrantz 6894548d6c Revert "zink: don't trigger shader variants on pcp change if driver supports dynamic pcp"
This reverts commit 472fcf74e2.

this is sort of right but then also sort of broken, going to rework a little

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22368>
2023-04-07 20:22:11 +00:00
Samuel Pitoiset 79655e2ea8 radv: copy stages instead of serializing NIR for GPL with the RETAIN flag
When the driver gets a cache hit for the binary, we still have to
retain shaders because we can't know if the LTO pipeline will be a
cache hit as well.

Though, serializing the NIR is too costly and most of the libraries
took more than 10ms to be created, which isn't acceptable. To fix this,
keep track of the shaders stage info for libs with the RETAIN flag.

This might be replaced by NIR caching later if it's worth a try.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset edb198e0b1 radv: create a helper for copying VkPipelineShaderStageCreateInfo
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset 6181ba11d5 radv/rt: stop storing unused hashes/identifiers
This is never used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
antonino a782393b1a zink: fix sampler array collision in `nir_to_spirv`
`nir_to_spirv` has flat arrays to map driver_location to sampler
variables.

Now when bindless textures are used together with non binless textures
the sampler vars are in different descriptor sets and the binding can be
the same between different descriptor sets, this causes a collision in
arrays.

This patches chamges `nir_to_spirv` to also index the array by whether
the texture is bindless.

Fixes: bc202553e9 ("zink: implement bindless textures")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
antonino 4579fe5fad zink: add `descriptor_bindless_id` to `zink_shader_info`
This field stores the id of the descriptor set used for bindless
textures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
Jesse Natalie c0c16d1ae2 dzn: Remove xfail for test that passes (if run)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie e4da9c2dfc dzn: Support >2K samplers with bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie b269c206c1 dzn: Remove skips now that WARP is faster
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie 16e70708ba dzn: Don't leave deleted physical devices in the instance pdev list
Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie 71dbb3120a dzn: Use GetResourceAllocationInfo3 for castable formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie 4fad8931f5 dzn: Clean up ABI helpers now that we require DirectX-Headers 606
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie 33051f1eb4 dzn: Early-out on no-op barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Mike Blumenkrantz 472fcf74e2 zink: don't trigger shader variants on pcp change if driver supports dynamic pcp
this otherwise pointlessly creates and binds shader variants that do nothing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22365>
2023-04-07 18:32:34 +00:00
Mike Blumenkrantz 172054e305 zink: reuse copy_vars for generated tcs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Mike Blumenkrantz 762a29279b zink: reuse d3d12 variable copying to make passthrough gs more robust
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Felix DeGrood 4dc7256bf9 anv: reset query pools using blorp
Previously we used PC to set query data to 0 during
CmdResetQueryPool. This was slow when clearing large query pools.
Switching to blorp to clear pools is faster for large query pools.

Red Dead Redemption 2: +1.5% speedup

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin bb49610973 anv: replace query flush before gpu copy by semaphore wait
All the flushes should already have happened, we just need CS to wait
for the operations to complete. Just use a MI_SEMAPHORE_WAIT to check
the availability bit is set.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin abc4111d19 anv: pass steam output as argument for anv_dump_pipe_bits
Just if you need to change it at some point ;)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood 2415d57a99 anv/blorp: add flush reasons to RT flushes
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood 43f93f5043 anv/blorp: implement anv_cmd_buffer_fill_area
Implemented function to fill an area at an address.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood 0130a4f667 anv/blorp: support surf generation for addresses
Already have support for anv_buff. Extended to support addresses.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Raun 9d38c9ca2f dzn: Enable VK_KHR_get_memory_requirements2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Raun a9a0dc3cca dzn: Enable VK_KHR_bind_memory2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Samuel Pitoiset bcd33d2937 radv: import retained NIR shaders later in the compilation process
This allows us to remove the intermediate NIR shader pointer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset e909764930 radv: do not retain noop FS for libs when a cache hit happened
Determine if the graphics pipeline needs a noop FS later instead of
retaining it. This was also suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset 34fa60e138 radv: simplify a check when retaining NIR shaders
The RETAIN flag is only allowed with graphics libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset 3b5ea90f1d radv: move the serialized NIR to radv_graphics_lib_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset 4672c6c43b radv: add a helper for retaining NIR shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Mike Blumenkrantz dc18570c0a zink: don't access non_fs part of zink_shader from fs
Fixes: a6de15eff5 ("zink: add flags to `zink_gfx_program` and `zink_context`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22347>
2023-04-07 13:10:03 +00:00
Mike Blumenkrantz 215beee16d zink: more explicitly track/check rp optimizing per-context
if tc creation fails for whatever reason, rp optimizing must be
marked as disabled for that context to avoid erroneous assumptions
about rp operation

fixes #8787

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22319>
2023-04-07 12:29:56 +00:00
Qiang Yu 2c78cbbfe1 ac/llvm: remove some unused code replaced by nir
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/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu a2cecbbc44 ac/nir/ngg: fix store shared alignment
For stream!=0, this align_mul=4 is not true. Not observe any
problem yet, just for correctness.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu c082cdacae ac/nir/ngg: fix gs culling vertex liveness check for odd vertices
If vertex does not complete a primitive, it should not set the odd
flag which miss lead liveness check when culling is enabled.

For example, if odd flag is set regardless of complete flag, when
culling is enabled, 3 vertices of a triangle's init prim flag:
  [0x00 0x04 0x01]

then after culling, this triangle has been culled, their prim flag:
  [0x00 0x04 0x00]

the second vertex is miss treat as live because its odd flag (code
check prim_flag!=0 for liveness).

Fixes: 1bdeb961bd ("ac/nir/ngg: add gs culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8725
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu fc3d8e1125 radeonsi: fix max scrach lds size calculation when ngg
Fixes: 028d0590f8 ("radeonsi: replace llvm ngg vs/tes with nir lowering")
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/22304>
2023-04-07 03:42:25 +00:00
Asahi Lina 9fcadd0c8d asahi: Allow explicit non-LINEAR modifiers for scanout
The compositor is responsible for picking the right supported modifiers
for scanout. If we get no modifiers, we have to assume linear, but if we
do, just roll with it and don't attempt to force things.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 534a04d557 asahi: Flip kmsro around to allocate on the GPU
Our display controller can handle arbitrary GPU imports, so there is no
reason to use dumb KMS buffers. Allocate everything on the GPU instead.

This also allows us to be lazy about mapping things to the KMS side, so
only clients that really want a KMS handle actually do that, which stops
us from ending up with a bunch of junk mapped to DCP (e.g. X11 clients
always request SCANOUT even under XWayland).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 9db36376a6 asahi: Fix compressed ZS support
Depth/stencil formats are "not renderable" but do support compression.

I swear I already fixed this at some point and the commit must've fallen
through the cracks...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 2296f69629 asahi: Print reasons why compression is disabled
For resource debug. Found a regression in compressed depth this way.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 888d443f29 asahi: Add resource debugging
I keep re-implementing this every time I look at resource-related
issues. Let's just make it official so we can turn it on with a flag
instead of having to add printfs every time ^^

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 0a132b0640 asahi: Add a helper macro for debug/error messages
This includes the program short name in the message, which is useful
when running entire desktop sessions with a single log to figure out who
is doing what.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 883ba4b161 asahi: Make BO import path failures more robust
These operations can fail for complex reasons through no fault of mesa,
so we should have proper runtime checks for them even in release builds.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina fcf594d00b asahi: Implement valid buffer range tracking
A common pattern is to allocate a vertex/etc buffer and write to it in
subsets. Some games interleave this with draw calls using the buffer.
This causes very expensive flushing for every draw call.

Fix this by tracking which range of a buffer has been written to, and
elide syncs when the range was previously uninitialized.

Fixes Source engine game performance and probably helps a bunch of
others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 00064ba4e3 asahi: Fix style nits
Found with a grep abomination which is probably too broken/silly to
actually implement in CI... but hey, at least it found some.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina a88b9c5540 asahi: Locate low VA BOs correctly
These need the shader_base added to them.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 030b2306a4 asahi: Enable glthread
This helps a lot with FEX, since the GPU driver runs emulated (and only
64bit supports thunking).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 4a5115c47b asahi: Make agx_alloc_staging() take a screen instead of a context
This makes it clear that it is thread-safe.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina 75e3212809 Revert "asahi: Advertise dual-source blending"
This reverts commit f4e2b22646.

This is broken until GL3 is enabled, possibly due to a core Mesa bug,
but it's a corner case not worth fixing.

Fixes Chromium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig 8a6d74d15b agx: Make signal_pix instructions explicit
Rather than implicitly packing them with the sample_mask. Again, this is just
changing where they're emitted, no functional changes yet. Bug for bug
compatibility with the old behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00