Vulkan test fails when building with clang and LTO enabled
When I build libplacebo with clang and LTO enabled, the test fails. And when I use the built binary with mpv and vulkan, mpv crashes.
When I disable LTO (-D b_lto=false
) or build it with gcc even with LTO enabled, the tests passes and the built binary is fine.
I built libplacebo with the following commands:
mkdir build
cd build
meson ../libplacebo \
-D vulkan=enabled \
-D lcms=disabled \
-D d3d11=disabled \
-D tests=true \
-D demos=false \
-D b_lto=true
ninja test
And the test results:
[1/2] Running all tests.
1/12 colorspace.c OK 0.02s
2/12 common.c OK 0.02s
3/12 lut.c OK 0.02s
4/12 filters.c OK 0.01s
5/12 string.c OK 0.01s
6/12 tone_mapping.c OK 0.01s
7/12 utils.c OK 0.01s
8/12 dither.c OK 0.02s
9/12 dav1d.c OK 0.01s
10/12 libav.c OK 0.01s
11/12 dummy.c OK 0.04s
12/12 vulkan.c FAIL 0.36s killed by signal 6 SIGABRT
>>> MALLOC_PERTURB_=108 /foo/bar/tests/test.vulkan.c
――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Listing only the last 100 lines from a long log.
... 3D
upload time: 4128, download time: 4928
testing texture roundtrip for format rgb10a2
... 1D
upload time: 1760, download time: 2240
... 2D
upload time: 1888, download time: 2272
... 3D
upload time: 4160, download time: 4928
testing texture roundtrip for format r16
... 1D
upload time: 1728, download time: 2592
... 2D
upload time: 1888, download time: 2304
... 3D
upload time: 3104, download time: 4000
testing texture roundtrip for format r16hf
... 1D
upload time: 1760, download time: 2272
... 2D
upload time: 1824, download time: 2304
... 3D
upload time: 3136, download time: 3872
testing texture roundtrip for format r16s
... 1D
upload time: 1728, download time: 2272
... 2D
upload time: 1856, download time: 2304
... 3D
upload time: 3008, download time: 3840
testing texture roundtrip for format rg16
... 1D
upload time: 1728, download time: 2272
... 2D
upload time: 1888, download time: 2272
... 3D
upload time: 4320, download time: 5056
testing texture roundtrip for format rg16hf
... 1D
upload time: 1760, download time: 2240
... 2D
upload time: 1888, download time: 2272
... 3D
upload time: 4160, download time: 4928
testing texture roundtrip for format rg16s
... 1D
upload time: 1952, download time: 2272
... 2D
upload time: 2336, download time: 2592
... 3D
upload time: 4256, download time: 5056
testing texture roundtrip for format rgba16
... 1D
upload time: 1888, download time: 2240
... 2D
upload time: 2112, download time: 2560
... 3D
[0.187][d] Allocating 262144 memory of type 0x1 (id 1) in heap 0
[0.188][d] Allocating 262144 memory of type 0x6 (id 2) in heap 1
[0.188][d] Allocating 262144 memory of type 0xe (id 3) in heap 1
upload time: 7008, download time: 7424
testing texture roundtrip for format rgba16hf
... 1D
upload time: 1856, download time: 2400
... 2D
upload time: 2016, download time: 2528
... 3D
upload time: 6784, download time: 7072
testing texture roundtrip for format rgba16s
... 1D
upload time: 1760, download time: 2304
... 2D
upload time: 2016, download time: 2432
... 3D
upload time: 6656, download time: 7072
testing texture roundtrip for format r32f
... 1D
upload time: 1728, download time: 2272
... 2D
upload time: 1856, download time: 2240
... 3D
upload time: 4288, download time: 5056
testing texture roundtrip for format rg32f
... 1D
upload time: 1792, download time: 2240
... 2D
upload time: 2016, download time: 2432
... 3D
upload time: 6880, download time: 7072
testing texture roundtrip for format rgba32f
... 1D
upload time: 1792, download time: 2304
... 2D
upload time: 2368, download time: 2752
... 3D
[0.193][d] Allocating 262144 memory of type 0x1 (id 1) in heap 0
[0.194][d] Imported host pointer is not page-aligned. This should normally be fine on most platforms, but may cause issues in some rare circumstances.
stderr:
[0.005][w] API debugging requested but no debug meta layers present... ignoring
test.vulkan.c: ../libplacebo/src/vulkan/malloc.c:860: _Bool vk_malloc_import(struct vk_malloc *, struct vk_memslice *, const struct vk_malloc_params *): Assertion `ainfo.pNext' failed.
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Summary of Failures:
12/12 vulkan.c FAIL 0.36s killed by signal 6 SIGABRT
Ok: 11
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Edited by Aviana Cruz