Commit graph

185044 commits

Author SHA1 Message Date
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
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