[vlc-commits] [Git][videolan/vlc][master] 6 commits: contrib: update glslang to 11.10.0

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jul 17 11:12:43 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
dead5701 by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: update glslang to 11.10.0

This is the newest release version at time of commit. One patch is no
longer needed and has been dropped. The other one has been rebased.

- - - - -
11692eaf by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: simplify glslang download process

glslang has actual tagged releases now, so we no longer need to manually
checkout its git repository.

- - - - -
1c348914 by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: bump minimum required glslang version

Bumping this allows us to drop some backwards-compatibility patches in
the libplacebo contribs, by ensuring that a proper versioned glslang is
always available.

Version 10 of glslang is the first release including the new style build
info header, and is therefore also the minimum dependency required by
newer glslang versions. It makes a natural candidate to start requiring.

- - - - -
3d04025e by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: generalize cppcheck to take source code

Instead of piping in /dev/null, take the code to pipe from $(2). This
does not regress the existing usages, as passing an empty variable
expands to an empty file.

This allows it to take an extra include statement, or even a more
complicated preprocessor check.

- - - - -
593c978f by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: use proper glslang header check

Glslang does not export a pkg-config file, so the need_pkg function
always fails. Fix it by checking the header explicitly, instead.

It was somewhat annoying to get this to work with a multi-line string. I
ended up resorting to explicit \n escape sequences to work around make
stripping newlines during shell expansion.

- - - - -
9b327b86 by Niklas Haas at 2022-07-17T09:13:58+00:00
contrib: drop glslang back-compat patch

No longer needed as a consequence of the glslang version requirement
being bumped to 10.x.x or higher.

- - - - -


7 changed files:

- + contrib/src/glslang/SHA512SUMS
- contrib/src/glslang/glslang-win32.patch
- − contrib/src/glslang/remove-broken-code.patch
- contrib/src/glslang/rules.mak
- − contrib/src/libplacebo/0003-glsl-glslang-back-compat.patch
- contrib/src/libplacebo/rules.mak
- contrib/src/main.mak


Changes:

=====================================
contrib/src/glslang/SHA512SUMS
=====================================
@@ -0,0 +1 @@
+5cd0b9410403bfb75b8031760110cd89eb8029ec8015ccc13802f1697ad30e685ce9e8fd307d197e66da28dcdf3f66b9851bc9e5f6d4daa3113bbf09af9f1e5e  glslang-11.10.0.tar.gz


=====================================
contrib/src/glslang/glslang-win32.patch
=====================================
@@ -1,11 +1,13 @@
---- glslang/CMakeLists.txt.win32	2019-01-28 14:20:18.208266400 +0100
-+++ glslang/CMakeLists.txt	2019-01-28 14:19:39.874088600 +0100
-@@ -52,7 +52,7 @@ if(ENABLE_HLSL)
- endif(ENABLE_HLSL)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6a43f6ff..55914a73 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -144,7 +144,7 @@ if(ENABLE_GLSLANG_WEBMIN)
+ endif()
  
  if(WIN32)
 -    set(CMAKE_DEBUG_POSTFIX "d")
 +    #set(CMAKE_DEBUG_POSTFIX "d")
-     if(MSVC)
+     option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON)
+     if(MSVC AND OVERRIDE_MSVCCRT)
          include(ChooseMSVCCRT.cmake)
-     endif(MSVC)


=====================================
contrib/src/glslang/remove-broken-code.patch deleted
=====================================
@@ -1,24 +0,0 @@
-From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
-From: Reid Kleckner <rnk at google.com>
-Date: Wed, 4 Dec 2019 14:09:03 -0800
-Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
-
-TPoolAllocator is not copy assignable, so this setter could never have
-been used. After a recent change (878a24ee2), new versions of Clang
-reject this code outright.
----
- glslang/Include/PoolAlloc.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
-index 0e237a6a2..b8eccb883 100644
---- a/glslang/Include/PoolAlloc.h
-+++ b/glslang/Include/PoolAlloc.h
-@@ -304,7 +304,6 @@ class pool_allocator {
-     size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
-     size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
- 
--    void setAllocator(TPoolAllocator* a) { allocator = *a; }
-     TPoolAllocator& getAllocator() const { return allocator; }
- 
- protected:


=====================================
contrib/src/glslang/rules.mak
=====================================
@@ -1,25 +1,30 @@
-# GLSLANG
-GLSLANG_HASH := ef1f899b5d64a9628023f1bb129198674cba2b97
-GLSLANG_BRANCH := master
-GLSLANG_GITURL := https://github.com/KhronosGroup/glslang.git
-GLSLANG_BASENAME := $(subst .,_,$(subst \,_,$(subst /,_,$(GLSLANG_HASH))))
+# glslang
+
+GLSLANG_VERSION := 11.10.0
+GLSLANG_URL := https://github.com/KhronosGroup/glslang/archive/refs/tags/$(GLSLANG_VERSION).tar.gz
+
+# glslang doesn't export a pkg-config file, so we check the header manually
+GLSLANG_MIN_VER := 10
+define GLSLANG_CHECK :=
+# include <glslang/build_info.h> \n
+# if GLSLANG_VERSION_MAJOR >= $(GLSLANG_MIN_VER) \n
+#  define GLSLANG_OK \n
+# endif
+endef
 
 PKGS += glslang
-ifeq ($(call need_pkg,"glslang"),)
+ifneq ($(call cppcheck, GLSLANG_OK, $(GLSLANG_CHECK)),)
 PKGS_FOUND += glslang
 endif
 
-$(TARBALLS)/glslang-$(GLSLANG_BASENAME).tar.xz:
-	$(call download_git,$(GLSLANG_GITURL),$(GLSLANG_BRANCH),$(GLSLANG_HASH))
+$(TARBALLS)/glslang-$(GLSLANG_VERSION).tar.gz:
+	$(call download_pkg,$(GLSLANG_URL),glslang)
 
-.sum-glslang: $(TARBALLS)/glslang-$(GLSLANG_BASENAME).tar.xz
-	$(call check_githash,$(GLSLANG_HASH))
-	touch $@
+.sum-glslang: glslang-$(GLSLANG_VERSION).tar.gz
 
-glslang: glslang-$(GLSLANG_BASENAME).tar.xz .sum-glslang
+glslang: glslang-$(GLSLANG_VERSION).tar.gz .sum-glslang
 	$(UNPACK)
 	$(APPLY) $(SRC)/glslang/glslang-win32.patch
-	$(APPLY) $(SRC)/glslang/remove-broken-code.patch
 	$(MOVE)
 
 .glslang: glslang toolchain.cmake


=====================================
contrib/src/libplacebo/0003-glsl-glslang-back-compat.patch deleted
=====================================
@@ -1,41 +0,0 @@
-From cac77b6674b479788cd688f1aee62a764cfbbb41 Mon Sep 17 00:00:00 2001
-From: Niklas Haas <git at haasn.dev>
-Date: Fri, 8 Jul 2022 22:41:10 +0200
-Subject: [PATCH] glsl: glslang back compat
-
-This include path randomly changed at some point in time.
----
- src/glsl/glslang.cc | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/src/glsl/glslang.cc b/src/glsl/glslang.cc
-index ba16458d..a9b34f64 100644
---- a/src/glsl/glslang.cc
-+++ b/src/glsl/glslang.cc
-@@ -26,15 +26,20 @@ extern "C" {
- 
- #include <glslang/Include/ResourceLimits.h>
- #include <glslang/Public/ShaderLang.h>
--#include <glslang/SPIRV/GlslangToSpv.h>
--
--#include "glslang.h"
- 
- #define GLSLANG_VERSION_CHECK(major, minor, patch) \
-     (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
-     (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
-      ((patch) <= GLSLANG_VERSION_PATCH)))))
- 
-+#if GLSLANG_VERSION_CHECK(0, 0, 3496)
-+#include <glslang/SPIRV/GlslangToSpv.h>
-+#else
-+#include <SPIRV/GlslangToSpv.h>
-+#endif
-+
-+#include "glslang.h"
-+
- using namespace glslang;
- 
- static pthread_mutex_t pl_glslang_mutex = PTHREAD_MUTEX_INITIALIZER;
--- 
-2.36.1
-


=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -37,7 +37,6 @@ libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
 	$(UNPACK)
 	$(APPLY) $(SRC)/libplacebo/0001-vulkan-blacklist-metal-structs-from-utils_gen.py.patch
 	$(APPLY) $(SRC)/libplacebo/0002-pl_thread-use-gettimeofday-for-back-compat.patch
-	$(APPLY) $(SRC)/libplacebo/0003-glsl-glslang-back-compat.patch
 	$(MOVE)
 
 .libplacebo: libplacebo crossfile.meson


=====================================
contrib/src/main.mak
=====================================
@@ -157,7 +157,7 @@ ifneq ($(findstring clang, $(shell $(CC) --version 2>/dev/null)),)
 HAVE_CLANG := 1
 endif
 
-cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
+cppcheck = $(shell printf '$(2)' | $(CC) $(CFLAGS) -E -dM - | grep -E $(1))
 
 EXTRA_CFLAGS += -I$(PREFIX)/include
 CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1d6f077d35bfbf494e56f57d52510d05962f0064...9b327b86a9855ce5b280981eea66cfa85e1034f3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1d6f077d35bfbf494e56f57d52510d05962f0064...9b327b86a9855ce5b280981eea66cfa85e1034f3
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list