diff --git a/Externals/MoltenVK/CMakeLists.txt b/Externals/MoltenVK/CMakeLists.txt index 5202e95970..fdc53313bf 100644 --- a/Externals/MoltenVK/CMakeLists.txt +++ b/Externals/MoltenVK/CMakeLists.txt @@ -8,6 +8,8 @@ ExternalProject_Add(MoltenVK CONFIGURE_COMMAND ${CMAKE_CURRENT_LIST_DIR}/configure.sh ${MOLTENVK_VERSION} + PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patch.sh ${CMAKE_SOURCE_DIR}/Externals/MoltenVK/patches/ ${MOLTENVK_VERSION} + BUILD_COMMAND make -C macos BUILD_IN_SOURCE ON BUILD_BYPRODUCTS /Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib diff --git a/Externals/MoltenVK/patch.sh b/Externals/MoltenVK/patch.sh new file mode 100755 index 0000000000..2a40d7eda9 --- /dev/null +++ b/Externals/MoltenVK/patch.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Applies all patches in the "patches" folder to the cloned MoltenVK git repository. +# +# Usage: patch.sh +# + +set -e + +# Reset the git repository first to ensure that it's in the base state. +git reset --hard $2 + +git apply $1/*.patch diff --git a/Externals/MoltenVK/patches/0001-SPIRVToMSLConverter-Enable-use_framebuffer_fetch_sub.patch b/Externals/MoltenVK/patches/0001-SPIRVToMSLConverter-Enable-use_framebuffer_fetch_sub.patch new file mode 100644 index 0000000000..4cd0c3d8f7 --- /dev/null +++ b/Externals/MoltenVK/patches/0001-SPIRVToMSLConverter-Enable-use_framebuffer_fetch_sub.patch @@ -0,0 +1,24 @@ +From 4ca33b7a9b149c6fbcc1c88ce08fc49f21294f6d Mon Sep 17 00:00:00 2001 +From: OatmealDome +Date: Sat, 31 Jul 2021 19:18:35 -0400 +Subject: [PATCH] SPIRVToMSLConverter: Enable use_framebuffer_fetch_subpasses + +--- + .../MoltenVKShaderConverter/SPIRVToMSLConverter.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.cpp b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.cpp +index 17c79394..97e98004 100644 +--- a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.cpp ++++ b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.cpp +@@ -92,6 +92,7 @@ MVK_PUBLIC_SYMBOL SPIRVToMSLConversionOptions::SPIRVToMSLConversionOptions() { + #endif + + mslOptions.pad_fragment_output_components = true; ++ mslOptions.use_framebuffer_fetch_subpasses = true; + } + + MVK_PUBLIC_SYMBOL bool mvk::MSLShaderInput::matches(const mvk::MSLShaderInput& other) const { +-- +2.30.1 (Apple Git-130) +