From a830dba677d84f04c9d3fa4428d2540ab51445f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Thu, 12 Feb 2026 23:43:01 +0200 Subject: [PATCH] [Metal] Remove glslang memory decorations. Co-authored-by: Stuart Carnie --- thirdparty/README.md | 1 + thirdparty/glslang/SPIRV/GlslangToSpv.cpp | 5 +++++ .../glslang/patches/0002-apple-m1-msaa-fix.patch | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 thirdparty/glslang/patches/0002-apple-m1-msaa-fix.patch diff --git a/thirdparty/README.md b/thirdparty/README.md index eaa5cc960d..684ea72edc 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -434,6 +434,7 @@ Files extracted from upstream source: Patches: - `0001-apple-disable-absolute-paths.patch` ([GH-92010](https://github.com/godotengine/godot/pull/92010)) +- `0002-apple-m1-msaa-fix.patch` ([GH-115893](https://github.com/godotengine/godot/issues/115893)) ## graphite diff --git a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp index 1a5c40c53a..d4af42f70b 100644 --- a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -5181,6 +5181,11 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* glslang::TQualifier typeQualifier = node->getType().getQualifier(); TranslateMemoryDecoration(typeQualifier, topLevelDecorations, glslangIntermediate->usingVulkanMemoryModel()); for (auto deco : topLevelDecorations) { +#ifdef __APPLE__ + if (deco != spv::Decoration::Restrict && + deco != spv::Decoration::RestrictPointer && + deco != spv::Decoration::RestrictPointerEXT) +#endif builder.addDecoration(var, deco); } return var; diff --git a/thirdparty/glslang/patches/0002-apple-m1-msaa-fix.patch b/thirdparty/glslang/patches/0002-apple-m1-msaa-fix.patch new file mode 100644 index 0000000000..1ed43baf8c --- /dev/null +++ b/thirdparty/glslang/patches/0002-apple-m1-msaa-fix.patch @@ -0,0 +1,16 @@ +diff --git a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp +index 1a5c40c53a..d4af42f70b 100644 +--- a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp ++++ b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp +@@ -5181,6 +5181,11 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* + glslang::TQualifier typeQualifier = node->getType().getQualifier(); + TranslateMemoryDecoration(typeQualifier, topLevelDecorations, glslangIntermediate->usingVulkanMemoryModel()); + for (auto deco : topLevelDecorations) { ++#ifdef __APPLE__ ++ if (deco != spv::Decoration::Restrict && ++ deco != spv::Decoration::RestrictPointer && ++ deco != spv::Decoration::RestrictPointerEXT) ++#endif + builder.addDecoration(var, deco); + } + return var;