Commit graph

185029 commits

Author SHA1 Message Date
Konstantin Seurer
ebbbca005e ac/parse_ib: Handle 32bit PKT3_DISPATCH_INDIRECT addrs
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27451>
2024-02-22 19:25:39 +00:00
Konstantin Seurer
fea21e5649 ac/parse_ib: Annotate addresses with UAF/OOB info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27451>
2024-02-22 19:25:39 +00:00
Konstantin Seurer
badd2131b5 ac/parse_ib: Dump the ADDR field of PKT3_SET_BASE
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27451>
2024-02-22 19:25:39 +00:00
Konstantin Seurer
160d18b273 ac/parse_ib: Add and use print_addr
Writes the whole address on one line.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27451>
2024-02-22 19:25:39 +00:00
Mike Blumenkrantz
dfe331930c zink: don't destroy the current batch state on context destroy
these are owned by the screen now

should fix some flakiness with shared contexts

Fixes: b06f6e00fb ("zink: fix heap-use-after-free on batch_state with sub-allocated pipe_resources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27749>
2024-02-22 19:04:09 +00:00
Mark Janes
dd0f6d70ba pan/va: Add missing valhall_enums dep to bifrost_tests
bifrost_tests compilation fails if the valhall_enums.h has not been
generated.

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27738>
2024-02-22 18:43:37 +00:00
Louis-Francis Ratté-Boulianne
439fce0c17 panfrost: Add AFBC packing support for RG formats
Only a matter of enabling it as packing itself works the same no
matter the number of components.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27471>
2024-02-22 18:23:51 +00:00
Sagar Ghuge
c3244135fa anv: Set timestampValidBits to 64bits
On Xe2+, timestamp register can hold value upto 64-bit.

This change also fixes the timestamp related tests on Xe2 platform.

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/27713>
2024-02-22 17:58:38 +00:00
Samuel Pitoiset
3004923ae3 radv: add support for conditional rendering on the compute queue with DGC
Conditional rendering is annoying to implement on ACE because there is
no predication packet like on GFX. With DGC it's even worse because
ACE is missing the IB2 packet which means it's not possible to predicate
the DGC IB entirely.

The provided solution is to always run the DGC prepare shader if
conditional rendering is enabled in order to generate a cmdbuf which
only contains NOPs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27673>
2024-02-22 17:32:58 +00:00
Samuel Pitoiset
f843027c22 radv: store/reset conditional rendering user info in the helpers
This also correctly initialize predication_op when the hw doesn't
support 32-bit predicate.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27673>
2024-02-22 17:32:58 +00:00
Konstantin Seurer
3fed272da7 ci: Update llvmpipe trace checksums
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27603>
2024-02-22 16:33:49 +00:00
Konstantin Seurer
41b5ff46aa lavapipe: Advertise VK_KHR_shader_maximal_reconvergence
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27603>
2024-02-22 16:33:49 +00:00
Konstantin Seurer
4d7beb22fa gallivm: Consider the initial mask when terminating loops
Partial subgroups can lead to infinite loops otherwise.

cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27603>
2024-02-22 16:33:49 +00:00
Konstantin Seurer
eb3c96d5ed llvmpipe: Use full subgroups when possible
Fixes computeFullSubgroups on lavapipe.

cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27603>
2024-02-22 16:33:48 +00:00
Jose Maria Casanova Crespo
277a5856e2 v3d: Implement GL_ARB_texture_barrier
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27550>
2024-02-22 15:42:30 +00:00
Jose Maria Casanova Crespo
51ccba82ce v3d: Early return if job is not writing the resource
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27550>
2024-02-22 15:42:30 +00:00
Jose Maria Casanova Crespo
6f138819f4 v3d: Only flush jobs that write texture from different job submission.
Avoids flushing jobs that write a texture that is read by a job in the
same job submission.

Now we need to handle the case where a texture is written by the
graphics pipeline and it is read by a compute pipeline.

Before this patch, glTextureBarrier() could be implemented as a NOP in
v3d. So the driver was doing more flushing than needed when
glTextureBarrier was not used.

v2: Use V3D_FLUSH_ALWAYS for resources written by graphics pipeline
    and read by compute insead of V3D_FLUSH_DEFAULT. (Iago Toral)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27550>
2024-02-22 15:42:30 +00:00
Jose Maria Casanova Crespo
7cbb47a86f v3d: Fix indentation at v3d_flush_jobs_writing_resource
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27550>
2024-02-22 15:42:30 +00:00
Pierre-Eric Pelloux-Prayer
c41f6ad764 mesa: deal with vbo_save_vertex_list::modes being NULL
This case was forgotten in the 9aa205668b.

Fixes: 9aa205668b ("mesa: inline {Create,Draw}GalliumVertexState callbacks")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10619
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27695>
2024-02-22 15:01:41 +00:00
Pierre-Eric Pelloux-Prayer
9a00a360ad wsi/wl: flush connection on swapchain failure
wayland-client stores up to MAX_FDS_OUT (28) outgoing fds and
then release them in batch later through close_fds.

While this is not a problem in normal situation, because the
app would also have a reference to the same buffers, this is
an issue when these buffers are released (eg: because the
swapchain creation failed).
In this situation wayland-client owns the last ref to these
buffers and prevent their deletion.

This is an issue with dEQP-VK.wsi.wayland.swapchain.simulate_oom.image_extent
because it creates swapchains in a fast loop with a failing allocator
to fail the swapchain creation.
Without this change, on a 16GB dGPU the test peaks at 95% VRAM / 60% GTT and
completes in 1.5 sec.
With this change, the max usage is 65% VRAM / 10% GTT and  completes it
in 0.3 sec.

Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27592>
2024-02-22 14:32:26 +00:00
Samuel Pitoiset
f9787864e0 radv: remove a TODO about adding mesh/task queries on GFX11
It's implemented and it's passing dEQP-VK.mesh_shader.ext.query.*.
Though, it's not enabled yet because task shader can still randomly
hang on RDNA3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22 14:12:00 +00:00
Samuel Pitoiset
35e0c88f49 radv: add support for task shader invocations queries on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22 14:12:00 +00:00
Samuel Pitoiset
b24e07e9ed radv: add support for mesh primitives queries on GFX11
This is natively supported with new pipeline statistics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22 14:12:00 +00:00
Samuel Pitoiset
4a6c18f503 radv: only enable emulated mesh/task shader invocations on GFX10.3
This shouldn't be enabled on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22 14:12:00 +00:00
Jose Maria Casanova Crespo
babb82d81a ci: Adds /usr/local/bin to PATH at piglit-traces.sh
yq and ci-fairy are installed in /usr/local/bin but on
script execution that route is not included by default
for all runners.

Identified on RPI4 runners.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27748>
2024-02-22 13:26:07 +00:00
Samuel Pitoiset
c1418dcb3d radv: re-emit more states when a shader compiled separately is bound
Shader configs are combined and they need to be re-emitted. Doesn't
fix anything known but this was obviously incorrect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27699>
2024-02-22 13:05:28 +00:00
Samuel Pitoiset
dc42ad4c6a radv: simplify emitting VGT_ESGS_RING_ITEMSIZE for ESO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27699>
2024-02-22 13:05:28 +00:00
Samuel Pitoiset
78be19fc72 radv: rename radv_emit_shaders() to radv_emit_graphics_shaders()
Also RADV_CMD_DIRTY_SHADERS to ~ADV_CMD_DIRTY_GRAPHICS_SHADERS for
consistency.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27699>
2024-02-22 13:05:28 +00:00
Samuel Pitoiset
76ccf71587 radv: simplify binding the GS copy shader with ESO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27699>
2024-02-22 13:05:28 +00:00
Erik Faye-Lund
3b23e9d89d mesa/main: allow GL_BGRA for FBOs
The EXT_texture_format_BGRA8888 spec clearly defines GL_BGRA as a
color-renderable format, so we need to support it here as well.

This has been broken since the day support for the extension was added.
Oh well, let's fix it up!

Fixes: 1d595c7cd4 ("gles2: Add GL_EXT_texture_format_BGRA8888 support")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27720>
2024-02-22 12:35:17 +00:00
Lionel Landwerlin
fa34241932 intel/ci: bump anv/tgl fraction to 6
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27693>
2024-02-22 08:30:32 +00:00
Lionel Landwerlin
da5a6d185c ci/anv: add more testing for optimization paths
Anv implements optimization paths for large numbers of queries
clears/copies and indirect draws.

We would like to make sure those don't break.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27693>
2024-02-22 08:30:32 +00:00
Samuel Pitoiset
59b0f7b6b7 radv: free NIR shaders when creating linked shaders with ESO
This was leaking memory too.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27715>
2024-02-22 07:48:02 +00:00
Samuel Pitoiset
77f036d574 radv: fix a big memleak with VK_EXT_shader_object
Shaders and binaries weren't freed at all!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27715>
2024-02-22 07:48:02 +00:00
Samuel Pitoiset
e88a5842b2 radv: remove the union in radv_shader_object
It's actually more annoying to deal with.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27715>
2024-02-22 07:48:02 +00:00
Samuel Pitoiset
9ae8f0f9d7 radv: fix indirect dispatches on compute queue with conditional rendering on GFX7
COND_EXEC needs to happen right before PKT3_DISPATCH_INDIRECT.

Like this combination will probably never happen but better to have
it fixed anyways.

Fixes: 5c03cdbd02 ("radv: fix indirect dispatches on the compute queue on GFX7")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27655>
2024-02-22 07:23:43 +00:00
Samuel Pitoiset
776f4523f9 radv: fix binary shaders compatibility with ESO
RADV needs to assume that all features that affect shaders might be
enabled. Note that disable_trunc_coord is specific to DXVK and
mesh_shader_queries is still disabled by default.

This fixes dEQP-VK.shader_object.binary.device_features.* on GFX10+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27632>
2024-02-22 07:03:04 +00:00
Samuel Pitoiset
f123a04256 radv: introduce a per physical device cache key
This introduces a new level cache key for physical device. The main
motivation is for shader object because the Vulkan spec says:

"Guaranteed compatibility of shader binaries is expressed through a
 combination of the shaderBinaryUUID and shaderBinaryVersion members of
 the VkPhysicalDeviceShaderObjectPropertiesEXT structure queried from a
 physical device. Binary shaders retrieved from a physical device with
 a certain shaderBinaryUUID are guaranteed to be compatible with all
 other physical devices reporting the same shaderBinaryUUID and the
 same or higher shaderBinaryVersion."

Meaning that with ESO, the driver needs to compile shaders for the
worst case with every possible logical device features enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27632>
2024-02-22 07:03:04 +00:00
Samuel Pitoiset
c303d399ff radv: initialize disk cache slightly later when creating a physical device
This will allow us to use a per physical device cache key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27632>
2024-02-22 07:03:04 +00:00
Samuel Pitoiset
0543394bfa radv: move mesh_fast_launch_2 to radv_physical_device
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27632>
2024-02-22 07:03:04 +00:00
Timothy Arceri
0f0fa64eed glsl: move some lowering to the compiler
Rather than doing this lowering potentially multiple times when a
shader is relinked we can instead do it once in the compiler.

This change also gets us closer to converting to NIR at compile
time.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27690>
2024-02-22 05:26:16 +00:00
Timothy Arceri
82d617e8b1 glsl: fix potential crash in expression flattening
The base_ir variable used by this pass is set via visit_list_elements()
however this pass was skipping visit_list_elements() for the initial
list of instructions i.e. it was skipping it for globals so if we
ended up trying to flatten an expression on a global we would segfault.

To quote the code comment on the base_ir variable:

   "This is implemented by visit_list_elements -- if the visitor is
   not called by it, nothing good will happen"

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27743>
2024-02-22 04:44:44 +00:00
Mike Blumenkrantz
ac45d893d6 zink: handle stencil_fallback in zink_clear_depth_stencil
ctx->blitting will already be set at this point, meaning the flag
should not be modified and no barriers are required

fixes stencil blitting on nvk

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27735>
2024-02-22 02:13:35 +00:00
Iván Briano
e3d4897dfe anv: flush query clears for all gens
Fixes: f733215c12 ("anv: enable query clear/copy using shaders on MTL/ARL")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27741>
2024-02-22 01:45:45 +00:00
Dave Airlie
62f65f4bfd egl/dri2: if zink is preferred from dri3 skip dri2 paths.
This just avoids some error prints.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27739>
2024-02-21 23:39:06 +00:00
Paulo Zanoni
a590a8ef45 anv+zink/ci: remove recently fixed tests from the crash list
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26410>
2024-02-21 22:58:42 +00:00
Paulo Zanoni
2526308dcd anv/sparse: allow binding operations to match the resource size
The resource size doesn't need to match the binding granularity. For
example, if the user wants to create a 32kb buffer, Anv will require
its memory to have 64kb, but the buffer size will still be the
original 32kb. And the spec says:

  VUID-VkSparseMemoryBind-size-01100:
    "size must be less than or equal to the size of the resource minus
     resourceOffset"
  VUID-VkSparseMemoryBind-size-01102:
    "size must be less than or equal to the size of memory minus
     memoryOffset"

So when binding such buffer, size should actually be the lesser of the
two values: 32kb, and we have to accept that. Since our binding
granularity is 64kb, we're safe to simply extend the requested size to
match our binding granularity, since we already require the memory to
be appropriately sized.

None of this is exercised by dEQP. This was caught by
piglit/arb_sparse_buffer-basic using Zink.

Testcase: piglit/arb_sparse_buffer-basic
Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10220
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26410>
2024-02-21 22:58:42 +00:00
Paulo Zanoni
a501a840a3 anv/sparse: add an extra step before anv_sparse_bind_resource_memory()
I need to add some sparse-related checks that require having the
anv_buffer and anv_image, and putting them directly inside
anv_queue_submit_sparse_bind_locked() doesn't feel like the right
thing to do. Here we change the interface so now we have
anv_sparse_bind_buffer() and anv_sparse_bind_image_opaque() as the
main interface into anv_sparse.c, so they both can call the lower
level anv_sparse_bind_resource_memory() function.

In the next patch we'll be adding changing the code of the functions
we just created, justifying their addition.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26410>
2024-02-21 22:58:42 +00:00
Paulo Zanoni
c3aa7e42ba zink: fix bind size handling in buffer_bo_commit()
What we're checking in the assertion we're changing seems to be what
the OpenGL spec describes as:

  "<offset> must be an integer multiple of the implementation
   dependent constant SPARSE_BUFFER_PAGE_SIZE_ARB, and <size> must
   either be a multiple of SPARSE_BUFFER_PAGE_SIZE_ARB, or extend to
   the end of the buffer's data store"

There are two sizes in question here: the size of the VkBuffer and the
size of its corresponding VkDeviceMemory. It looks like
bo->base.base.size corresponds to VkDeviceMemory, while res->obj->size
corresponds to VkBuffer. Here we're really talking about the VkBuffer
size, so fix the assertion.

On Anv, we're hitting this issue because piglit's
arb_sparse_buffer-basic creates a buffer of size 32k and tries to
issue a bind operation with size 32k. The catch here is that Anv
requires the memory to be 64kb, so Zink gets confused and hits the
assertion.

Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10220
Testcase: piglit/arb_sparse_buffer-basic
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26410>
2024-02-21 22:58:42 +00:00
Karol Herbst
83895d4025 intel: Only build shaders with anv and iris
This allows crocus and hasvk to be built without needing any of the OpenCL
stuff.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10634
Fixes: b52e25d3a8 ("anv: rewrite internal shaders using OpenCL")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27663>
2024-02-21 20:53:36 +00:00