Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f6d0107d by Alexandre Janniaux at 2024-03-09T07:19:06+00:00
libplacebo: add dependency to vulkan-headers also

libplacebo depends directly on vulkan-headers, not transitionally.
The constraint was written like this to not always install the headers
if some were provided by the system.

- - - - -
69f935aa by Alexandre Janniaux at 2024-03-09T07:19:06+00:00
contrib: vulkan-headers: detect current version

Automatically enable the headers, but detect the currently available
header version with cppcheck since the pkgconfig file will actually
detect the version of the loader.

cppcheck cannot understand the full header version, which was also not
available before 1.3 anyway. Moreover, the major and minor versions are
not defined directly, but instead either through cast or not at all
(before 1.3), so we use the header guards defines and the
VK_HEADER_VERSION for the last patch revision number, which directly
matches the actual package revision.

v1.3.239 is the version provided by the vulkan-loader package on debian
bookworm, and the main constraint we have is the presence of the
vulkan/vulkan_beta.h header which should be present and the presence or
absence of the old/new video_decode extension that was promoted. 238 is
the first revision removing the previous video_decode extension and
adding the new one.

Tested on linux with headers present and android with system header
being obsolete.

- - - - -


2 changed files:

- contrib/src/libplacebo/rules.mak
- contrib/src/vulkan-headers/rules.mak


Changes:

=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -27,7 +27,7 @@ endif
 # We don't want vulkan on darwin for now
 ifndef HAVE_DARWIN_OS
 ifndef HAVE_EMSCRIPTEN
-DEPS_libplacebo += vulkan-loader $(DEPS_vulkan-loader)
+DEPS_libplacebo += vulkan-loader $(DEPS_vulkan-loader) vulkan-headers 
$(DEPS_vulkan-headers)
 endif
 endif
 


=====================================
contrib/src/vulkan-headers/rules.mak
=====================================
@@ -3,6 +3,28 @@ VULKAN_HEADERS_URL := 
$(GITHUB)/KhronosGroup/Vulkan-Headers/archive/v$(VULKAN_HE
 
 DEPS_vulkan-headers =
 
+VULKAN_HEADERS_MIN_VERSION := 1.3.219
+
+VULKAN_HEADERS_MIN_VERSION_LIST := $(subst ., ,$(VULKAN_HEADERS_MIN_VERSION))
+VULKAN_HEADERS_MIN_VERSION_NAME := $(subst $() ,_,$(wordlist 
1,2,$(VULKAN_HEADERS_MIN_VERSION_LIST)))
+
+# VK_MAKE_API_VERSION uses (uint32_t) casts which prevent the preprocessor
+# from understanding comparisons against a specific patch version. Use the
+# VK_VERSION_X_Y header guard defines instead to detect major/minor, and
+# then use VK_HEADER_VERSION which is not defined as a cast for the patch
+# version.
+define VULKAN_HEADERS_CHECK := # include <vulkan/vulkan_core.h> \n
+# if defined(VK_VERSION_$(VULKAN_HEADERS_MIN_VERSION_NAME))) \\n
+#    && VK_HEADER_VERSION >= $(lastword $(VULKAN_HEADERS_MIN_VERSION_LIST)) \n
+#  define VULKAN_HEADERS_OK \n
+# endif \n
+endef
+
+PKGS += vulkan-headers
+ifneq ($(call cppcheck, VULKAN_HEADERS_OK, $(VULKAN_HEADERS_CHECK)),)
+PKGS_FOUND += vulkan-headers
+endif
+
 $(TARBALLS)/Vulkan-Headers-$(VULKAN_HEADERS_VERSION).tar.gz:
        $(call download_pkg,$(VULKAN_HEADERS_URL),vulkan-headers)
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/ed134184799841da2f1f3335911e29d0f5be5442...69f935aa8e71ec48869a3063832b2f29eebba3b3

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/ed134184799841da2f1f3335911e29d0f5be5442...69f935aa8e71ec48869a3063832b2f29eebba3b3
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to