Commit Graph

185056 Commits

Author SHA1 Message Date
Karol Herbst 14ccfb41bc rusticl/meson: remove -Aclippy::arc-with-non-send-sync flag
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:19 +00:00
Karol Herbst ce06bdf916 rusticl/icd: verify all cl classes are Send and Sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:19 +00:00
Karol Herbst e202903007 rusticl/kernel: make it Send and Sync
There are a few APIs which don't have to be thread-safe, but we can
optimize it later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:19 +00:00
Karol Herbst 59cba70751 rusticl/spirv: mark SPIRVBin as Send and Sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:19 +00:00
Karol Herbst 17e97a8f06 rusticl/event: make EventSig Send + Sync
The code was effecitvely that already, but now we can have the compiler
actually verify this.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:18 +00:00
Karol Herbst a97108d3c7 rusticl/memory: make closures Send and Sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:18 +00:00
Karol Herbst aa3b44c02b rusticl/memory: store host_ptr as usize
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:18 +00:00
Karol Herbst 1753b59cfd rusticl/context: complete conversion of SVM pointers to usize
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27747>
2024-02-23 14:47:18 +00:00
Danylo Piliaiev ebde7d5e87 tu/a7xx: Write even more magic regs to fix rendering issues on Android
We have to write all the same regs blob is writing or we risk using
stale reg value written by blob.

I went through blob trace again and added all missing magic regs,
I hope for the last time.

This fixes screen corruption for Mobox users and in some cases
for different emulators users. The reg which caused the issue
is HLSQ_UNKNOWN_A9AC.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27721>
2024-02-23 14:19:11 +00:00
Antonio Gomes 38ffdb883d rusticl/device: Verify for PIPE_CAP_CL_GL_SHARING when enabling gl_sharing
I think it's better to keep the other checks (check for dmabuf, uuid,
...) as we can use them to know the features required.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Antonio Gomes d43f9f9c60 radeonsi: Set PIPE_CAP_CL_GL_SHARING to true
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Antonio Gomes 6e7d1725a3 iris: Set PIPE_CAP_CL_GL_SHARING to true
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Antonio Gomes 12f1a4c311 gallium: Add new PIPE_CAP_CL_GL_SHARING
We have a situation where some drivers have all the required features,
but they are not working with gl_sharing, so we end up advertising it
wrongly. Add this cap to ensure this driver was tested to work with
cl_khr_gl_sharing.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Antonio Gomes 50f6478e3d rusticl/gl: Bump mesa_glinterop_device_info to version 4
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Antonio Gomes a7272a6f24 mesa/st: Skip querying PCI values in interop_query_device_info if version >= 4
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-23 13:29:00 +00:00
Oskar Viljasaar 89622f5089 tu: Use common physical device properties infrastructure
Use the same intializing trick as in 27d5543: first we initialize our
properties struct to { false }, then we fill the fields in one by one.
C++ does not allow assigning to an array from an initializer list, so
the properties exposed as an array in the struct are initialized either
one by one, or assigned in a chain.
As the properties are initialized at init time, move tu_get_properties
and tu_get_physical_device_properties_* before tu_physical_device_init,
so get_properties() would be callable by it.

This lets us delegate the physical device property entrypoints to
common runtime code.

Tested with drm-shim, doing a diff on vulkaninfo output. Differing
fields were pipelineCacheUUID, driverInfo and driverUUID, i.e. the
actual properties do not differ.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27723>
2024-02-23 13:03:03 +00:00
Danylo Piliaiev f4c40fc89c tu: Add workaround for D3D11 games accessing UBO out of bounds
Some D3D11 games rely on out-of-bounds indirect UBO loads to return
real values from underlying bound descriptor. This workaround would
prevent us from lowering indirectly accessed UBOs to consts.

Later DXVK would declare dynamically indexed uniforms with upper
size bound, to make the accesses spec compliant. But for now
we need our own workaround.

Known affected games:
- Dark Souls 3
- Sekiro: Shadows Die Twice
- Final Fantasy Type-0 HD
- Ultrakill
- Dishonored 2

DXVK discussions:
- https://github.com/doitsujin/dxvk/issues/405
- https://github.com/doitsujin/dxvk/issues/3861

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27727>
2024-02-23 12:08:53 +00:00
Michel Dänzer 7a6836611e egl/wayland: Flush after blitting to linear copy
We need to flush after blitting to the linear copy, or the Wayland
compositor may not see the correct linear buffer contents.

v2:
* Keep blitImage call in the same place (Daniel Stone)
* Add second flush for the blit to linear copy

Fixes: 58f90fd03f ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9816
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27718>
2024-02-23 08:43:54 +00:00
Faith Ekstrand f890b515ef nvk: Don't use WAIT_AVAILABLE in nvk_upload_queue_sync
This was a copy+paste error, probably from vk_drm_syncobj.c.  If we do
WAIT_AVAILABLE, it only waits for the dma_fence to exist, not for it to
signal.  Instead, we want WAIT_FOR_SUBMIT.  (Technically, that's not
necessary but it is typical for CPU waits to also wait for the time
point to materialize.)

Fixes: 2074e28a0d ("nvk: Add an upload queue")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27757>
2024-02-23 03:31:57 +00:00
Joshua Ashton 6767ad9c86 meson: Enable d3d12 in gallium_drivers by default on Windows
This is pretty much the only usable one that isn't
swrast for some people, eg. WoA + QCom.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27737>
2024-02-23 02:28:29 +00:00
Joshua Ashton 5a6de45bd5 meson: Enable zink in gallium_drivers by default
Zink is the only way to use hw accelerated GL on
a7xx and the preferred way for hw supporting NVK.

Start building Zink by default everywhere that we
would build swrast by default, except for Mac +
Cygwin + Haiku.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27737>
2024-02-23 02:28:29 +00:00
Karol Herbst 2b9c0e3768 zink: lower unaligned memory accesses
Fixes `vload_half` in OpenCL

Fixes: 0288cb0a0c ("zink: lower vec8/16")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27754>
2024-02-23 00:26:56 +00:00
Benjamin Lee 944ef1771e nvk: disable shaderResourceMinLod on pre-sm70
The hardware's TEX instruction doesn't support this when using indirect
texture access, which we're currently using for everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27733>
2024-02-22 21:17:17 +00:00
Benjamin Lee a7166386db nak: fix tex offset encoding on SM50
It should be bit 36, not bit 54. Bit 54 probably came from the direct
variant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27733>
2024-02-22 21:17:16 +00:00
Benjamin Lee 59d6645c6b nak: fix lod mode encoding for SM50 tld op
The bit flag was backwards, set=ll and cleared=lz. This fixes
dEQP-VK.glsl.texture_functions.texelfetch.* from the CTS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27733>
2024-02-22 21:17:16 +00:00
Charlie Turner 639a9a1c05 amd, radeonsi: Lower minimum supported video dimensions for AV1
For AV1, the hardware supports decoding at 16x16, but for AVC & HEVC,
64 is the minimum.

The following Fluster tests used to check this,

av1-1-b8-01-size-16x16.ivf
av1-1-b8-01-size-32x32.ivf

Signed-off-by: Charlie Turner <cturner@igalia.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27085>
2024-02-22 19:49:28 +00:00
Konstantin Seurer d95c30b6ec ac/parese_ib: Handle more packets
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 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