After commit 45eb3bfd32 (device-select: only try wayland/x11 if the
required vars are set, 2024-10-18), building `device_select_layer.c` can
results in compiler errors on some stricter build configurations
(-Werror,-Wunused-variable):
-----------------------------------------------------------------------
../src/vulkan/device-select-layer/device_select_layer.c:149:9: error: unused variable 'has_wayland' [-Werror,-Wunused-variable]
149 | bool has_wayland = getenv("WAYLAND_DISPLAY") || getenv("WAYLAND_SOCKET");
| ^~~~~~~~~~~
../src/vulkan/device-select-layer/device_select_layer.c:150:9: error: unused variable 'has_xcb' [-Werror,-Wunused-variable]
150 | bool has_xcb = !!getenv("DISPLAY");
| ^~~~~~~
2 errors generated.
-----------------------------------------------------------------------
So guard the declarations of the `has_wayland` and `has_xcb` variables
behind `VK_USE_PLATFORM_WAYLAND_KHR` and `VK_USE_PLATFORM_XCB_KHR`
respectively, just like the user code.
Note: the declarations are still kept outside of the loop body, in order
to assign the variables once and for all.
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37571>
The current code was conditionally passing empty streamout targets to
util_blitter_save_so_targets() only when ETNA_DBG_DEQP was enabled.
Since etnaviv supports hardware streamout on some GPUs, we should
always pass the actual streamout state to properly save and restore
it during blitter operations.
Fixes: 52bc3c2d20 ("etnaviv: Implement stream output target management")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37564>
The debug archive files are regular tar files, so can be
inspected by tar, and also used direct by file managers and editors.
However a few common tasks are worth having already set up in the
repository.
This tool adds convenience to some of those tasks, including
- Print last version of a shader representation;
- Print a `git-log`-like view of the changes of a shader;
- Comparing two shaders, e.g. SIMD8 and SIMD16 shaders in
Intel;
- Comparing two specific versions of any shaders.
See the "manual" inside the commit for more details.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
Instead of dumping multiple files with the optimizer passes, write a single
archive file with all the contents. The actual file is created
by the drivers, so later commits will actually enable the feature in
anv and iris.
This removes the use of INTEL_DEBUG=optimizer (and the corresponding
enum value) in brw. That environment variable is still used by ELK --
which currently doesn't support mda.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
Uses the tar format to collect multiple output files. It can
be inspected using the regular UNIX tools, but a later commit
will add a specialized tool to perform common tasks.
The tar implementation is enough to fulfill the current needs
without adding a dependency. There's also a small test mostly
to ensure scaffolding is there in case we need to expand the
implementation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
If the FS has writes to multiple color outputs, but there are not enough
color attachments for them all, we may optimize out the exceeding ones.
With VK_KHR_dynamic_rendering_local_read, we were not respecting the
mapping from output to attachment set by the application, and the wrong
writes were getting eliminated.
Fixes future CTS tests: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.remap_single_attachment*
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37531>
This ensure that the default handlers enumerated in
eglGlobal will be called. Historically the atexit() would
be set when adding a new handler, but as the code moved on
the handlers were included by default and the function
that added them is not being called anymore.
This fixes memory leaks like
```
==37635== 144 bytes in 1 blocks are still reachable in loss record 2,416 of 2,428
==37635== at 0x48463F3: calloc (vg_replace_malloc.c:1675)
==37635== by 0x7D13686: ??? (in /usr/lib64/libdrm.so.2.125.0)
==37635== by 0x7D13A13: ??? (in /usr/lib64/libdrm.so.2.125.0)
==37635== by 0x7D18310: drmGetDevices2 (in /usr/lib64/libdrm.so.2.125.0)
==37635== by 0x4FFC411: _eglDeviceRefreshList (egldevice.c:431)
==37635== by 0x4FF079A: eglInitialize (eglapi.c:672)
==37635== by 0x40078F: main (main.c:75)
```
and
```
==37664== 2,680 bytes in 1 blocks are still reachable in loss record 2,423 of 2,428
==37664== at 0x48463F3: calloc (vg_replace_malloc.c:1675)
==37664== by 0x4FFCDF3: _eglFindDisplay (egldisplay.c:270)
==37664== by 0x4FEED00: eglGetDisplay (eglapi.c:418)
==37664== by 0x501464E: __eglGLVNDGetPlatformDisplay (eglglvnd.c:67)
==37664== by 0x488170D: ??? (in /usr/lib64/libEGL.so.1.1.0)
==37664== by 0x40075C: main (main.c:68)
```
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37518>
If a client creates a semaphore, exports it, and then re-imports it back
into the device, this can trick our semaphore reset logic. When this
happens, we end up with two different vk_sync structs that have the same
underlying payload so if one is used as the signal and one is used as
the wait of the same submit, we'll end up resetting it because we think
they're different, causing us to lose the signal.
We already have the ability to handle this for the threaded case by
moving the semaphore payload into a new vk_sync which we then destroy
after we're done submitting to the driver. Use this path for shared
semaphores in the immediate case so we can just wait and signal without
worrying about the reset.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13805
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37149>