aboutsummaryrefslogtreecommitdiff
path: root/graphics/libplacebo/glslang_version.patch
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/libplacebo/glslang_version.patch')
-rw-r--r--graphics/libplacebo/glslang_version.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/graphics/libplacebo/glslang_version.patch b/graphics/libplacebo/glslang_version.patch
new file mode 100644
index 0000000000000..6c8363178fd86
--- /dev/null
+++ b/graphics/libplacebo/glslang_version.patch
@@ -0,0 +1,70 @@
+commit b2fa57a00d3b71c9f897bc622937d661f3c227cc
+Author: orbea <orbea@riseup.net>
+Date: Thu Oct 15 07:23:32 2020 -0700
+
+ Hack around the newer glslang version scheme.
+
+diff --git a/src/glsl/glslang.cc b/src/glsl/glslang.cc
+index 07cf8f1..4560c77 100644
+--- a/src/glsl/glslang.cc
++++ b/src/glsl/glslang.cc
+@@ -23,7 +23,7 @@ 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;
+
+ int pl_glslang_version()
+ {
+- return GLSLANG_PATCH_LEVEL;
++ return GLSLANG_VERSION_MAJOR;
+ }
+
+ bool pl_glslang_init()
+@@ -78,7 +78,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 (api_ver >= EShTargetVulkan_1_2)
+ spirv_version = EShTargetSpv_1_5;
+ #endif
+@@ -200,7 +200,7 @@ const TBuiltInResource DefaultTBuiltInResource = {
+ /* .MaxCullDistances = */ 8,
+ /* .MaxCombinedClipAndCullDistances = */ 8,
+ /* .MaxSamples = */ 4,
+-#if GLSLANG_PATCH_LEVEL >= 2892
++#if GLSLANG_VERSION_MAJOR >= 10
+ /* .maxMeshOutputVerticesNV = */ 256,
+ /* .maxMeshOutputPrimitivesNV = */ 512,
+ /* .maxMeshWorkGroupSizeX_NV = */ 32,
+diff --git a/src/meson.build b/src/meson.build
+index 5a77cea..60cb646 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
+ 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()
+
+ if glslang_ver >= glslang_min_ver