Warn user when Vulkan-Headers dependency and generated version differ when building
if you build vulkan-loader with the latest vulkan-headers (as of https://github.com/KhronosGroup/Vulkan-Headers/commit/b11eecd68fb4b770f30fe2c9da522ff966f95b1e) the build fails:
FAILED: loader/CMakeFiles/vulkan.dir/loader.c.obj
/usr/bin/ccache x86_64-w64-mingw32-gcc-posix -DHAVE_CET_H -DUNKNOWN_FUNCTIONS_SUPPORTED -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_WIN32_KHR -Dvulkan_EXPORTS -I/home/runner/work/mpv/mpv/Vulkan-Loader/loader -I/home/runner/work/mpv/mpv/Vulkan-Loader/loader/generated -I/home/runner/work/mpv/mpv/Vulkan-Loader/builddir/loader -isystem /home/runner/work/mpv/mpv/mingw_prefix/usr/local/include -O2 -pipe -Wall -Wno-error=deprecated -Wno-error=deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -O3 -DNDEBUG -std=c99 -fvisibility=hidden -Wall -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-stringop-truncation -Wno-stringop-overflow -Wshadow=local -Wpointer-arith -MD -MT loader/CMakeFiles/vulkan.dir/loader.c.obj -MF loader/CMakeFiles/vulkan.dir/loader.c.obj.d -o loader/CMakeFiles/vulkan.dir/loader.c.obj -c /home/runner/work/mpv/mpv/Vulkan-Loader/loader/loader.c
In file included from ../loader/loader.c:76:
../loader/generated/vk_loader_extensions.c: In function ‘CmdDispatchTileQCOM’:
../loader/generated/vk_loader_extensions.c:7991:5: error: too few arguments to function ‘disp->CmdDispatchTileQCOM’
7991 | disp->CmdDispatchTileQCOM(commandBuffer);
| ^~~~
Now you probably just have to update some stuff, but I'm wondering if vulkan-loader 1.4.315 strictly only supports building with vulkan-headers 1.4.315? If so, the build system should probably enforce that.
Yep, breaking API changes in a vendor extension is rare but does happen from time to time. scripts/known_good.json is where the version of Vulkan-Headers that the code expects to be built against is located.
With the header update in progress #1711 this issue should be resolved as far as building goes, but I'm going to leave it open as a reminder to add a build warning when the generated header version and the header version being built with is different. That would at least have given you a heads up. I cannot strictly enforce the 'correct' version due to the many situations that the Vulkan-Loader repo gets built in, some of which don't have a strict guarantee that the versions match perfectly (and usually its fine, because API breaking changes don't occur all the time).