diff options
author | orbea <orbea@riseup.net> | 2020-10-22 18:24:02 -0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-10-24 08:14:55 +0700 |
commit | 2f74ddf44c8a6b20e88bde95f93ece7b8c443691 (patch) | |
tree | 8b6c104f33947c2c6c2a702547a87f94630e12dd | |
parent | 50804e46731459714553832b5d943f5ca0295799 (diff) |
graphics/libplacebo: Use upstream patch.
Signed-off-by: orbea <orbea@riseup.net>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | graphics/libplacebo/glslang_version.patch | 92 | ||||
-rw-r--r-- | graphics/libplacebo/libplacebo.SlackBuild | 7 |
2 files changed, 69 insertions, 30 deletions
diff --git a/graphics/libplacebo/glslang_version.patch b/graphics/libplacebo/glslang_version.patch index 6c8363178fd8..17bb0fb9f4c2 100644 --- a/graphics/libplacebo/glslang_version.patch +++ b/graphics/libplacebo/glslang_version.patch @@ -1,70 +1,104 @@ -commit b2fa57a00d3b71c9f897bc622937d661f3c227cc -Author: orbea <orbea@riseup.net> -Date: Thu Oct 15 07:23:32 2020 -0700 +From 217edc52822845ad70eb39e95871f90d14d1dac6 Mon Sep 17 00:00:00 2001 +From: Niklas Haas <git@haasn.xyz> +Date: Wed, 21 Oct 2020 12:55:24 +0200 +Subject: [PATCH] glslang: update for new glslang versioning scheme - Hack around the newer glslang version scheme. +This updates our checks to use the new header locations as introduced in +https://github.com/KhronosGroup/glslang/pull/2277. Fortunately, it seems +that the new version scheme is backwards compatible with the old one, so +we don't need any excessively complicated logic updates. + +Fixes https://github.com/haasn/libplacebo/issues/83 +--- + src/glsl/glslang.cc | 9 +++++---- + src/meson.build | 19 ++++++++++++++++--- + 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/glsl/glslang.cc b/src/glsl/glslang.cc -index 07cf8f1..4560c77 100644 +index 3b17a4e..01ad0fa 100644 --- a/src/glsl/glslang.cc +++ b/src/glsl/glslang.cc -@@ -23,7 +23,7 @@ extern "C" { +@@ -15,6 +15,8 @@ + * License along with libplacebo. If not, see <http://www.gnu.org/licenses/>. + */ + ++#include "config_internal.h" ++ + #include <assert.h> + #include <pthread.h> + +@@ -23,7 +25,6 @@ extern "C" { } #include <glslang/Include/ResourceLimits.h> -#include <glslang/Include/revision.h> -+#include <glslang/build_info.h> #include <glslang/Public/ShaderLang.h> #include <SPIRV/GlslangToSpv.h> -@@ -36,7 +36,7 @@ static int pl_glslang_refcount; +@@ -36,7 +37,7 @@ static int pl_glslang_refcount; - int pl_glslang_version() + int pl_glslang_version(void) { - return GLSLANG_PATCH_LEVEL; -+ return GLSLANG_VERSION_MAJOR; ++ return GLSLANG_VERSION_PATCH; } - bool pl_glslang_init() -@@ -78,7 +78,7 @@ struct pl_glslang_res *pl_glslang_compile(const char *glsl, uint32_t api_ver, + bool pl_glslang_init(void) +@@ -78,7 +79,7 @@ struct pl_glslang_res *pl_glslang_compile(const char *glsl, uint32_t api_ver, if (api_ver >= EShTargetVulkan_1_1) spirv_version = EShTargetSpv_1_3; -#if GLSLANG_PATCH_LEVEL >= 3667 -+#if GLSLANG_VERSION_MAJOR >= 10 ++#if GLSLANG_VERSION_PATCH >= 3667 if (api_ver >= EShTargetVulkan_1_2) spirv_version = EShTargetSpv_1_5; #endif -@@ -200,7 +200,7 @@ const TBuiltInResource DefaultTBuiltInResource = { +@@ -200,7 +201,7 @@ const TBuiltInResource DefaultTBuiltInResource = { /* .MaxCullDistances = */ 8, /* .MaxCombinedClipAndCullDistances = */ 8, /* .MaxSamples = */ 4, -#if GLSLANG_PATCH_LEVEL >= 2892 -+#if GLSLANG_VERSION_MAJOR >= 10 ++#if GLSLANG_VERSION_PATCH >= 2892 /* .maxMeshOutputVerticesNV = */ 256, /* .maxMeshOutputPrimitivesNV = */ 512, /* .maxMeshWorkGroupSizeX_NV = */ 32, + diff --git a/src/meson.build b/src/meson.build -index 5a77cea..60cb646 100644 +index 5a77cea..dcb8137 100644 --- a/src/meson.build +++ b/src/meson.build -@@ -49,7 +49,7 @@ endif - - # work-arounds for glslang braindeath - glslang_combined = disabler() --glslang_min_ver = 2763 -+glslang_min_ver = 10 - glslang_req = get_option('glslang') - - if glslang_req.auto() and shaderc.found() -@@ -83,8 +83,8 @@ else +@@ -83,9 +83,20 @@ else endif if glslang_found - glslang_ver = cxx.get_define('GLSLANG_PATCH_LEVEL', - prefix: '#include <glslang/Include/revision.h>' -+ glslang_ver = cxx.get_define('GLSLANG_VERSION_MAJOR', -+ prefix: '#include <glslang/build_info.h>' - ).to_int() +- ).to_int() ++ glslang_header_old = 'glslang/Include/revision.h' ++ glslang_header_new = 'glslang/build_info.h' ++ ++ if cc.has_header(glslang_header_new) ++ glslang_ver = cxx.get_define('GLSLANG_VERSION_PATCH', ++ prefix: '#include <' + glslang_header_new + '>' ++ ).to_int() ++ elif cc.has_header(glslang_header_old) ++ glslang_ver = cxx.get_define('GLSLANG_PATCH_LEVEL', ++ prefix: '#include <' + glslang_header_old+ '>' ++ ).to_int() ++ else ++ error('No glslang version header found?') ++ endif if glslang_ver >= glslang_min_ver + # glslang must be linked against pthreads on platforms where pthreads is +@@ -108,6 +119,8 @@ if glslang_found + add_project_arguments('-I' + i, language: 'cpp') + endforeach + ++ conf_internal.set('GLSLANG_VERSION_PATCH', glslang_ver) ++ + else + error('glslang revision @0@ too old! Must be at least @1@' + .format(glslang_ver, glslang_min_ver)) +-- +GitLab diff --git a/graphics/libplacebo/libplacebo.SlackBuild b/graphics/libplacebo/libplacebo.SlackBuild index ff494f171616..4dd590965e77 100644 --- a/graphics/libplacebo/libplacebo.SlackBuild +++ b/graphics/libplacebo/libplacebo.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=libplacebo VERSION=${VERSION:-2.72.0} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -83,6 +83,11 @@ sed -i 's/1.4.0/1.3.1/' src/meson.build # Fix the build with newer glslang versions. patch -p1 < $CWD/glslang.patch + +# glslang: update for new glslang versioning scheme +# https://code.videolan.org/videolan/libplacebo/-/merge_requests/118 +# https://github.com/haasn/libplacebo/issues/83 +# https://code.videolan.org/videolan/libplacebo/-/commit/217edc52822845ad70eb39e95871f90d14d1dac6 patch -p1 < $CWD/glslang_version.patch CFLAGS="$SLKCFLAGS" \ |