From 40baeaa965494e0d0c5fcb527dc603c726f35272 Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Mon, 6 Nov 2023 16:56:06 -0500 Subject: [PATCH] Fix regression error in argument buffer runtime arrays. - Update to latest SPIRV-Cross contining the fix. - Modify CTS options in runcts script to avoid outputting full CTS log, and use less file caching, all to reduce memory and filespace consumption, and possibly improve performance (unrelated). - Update MoltenVKShaderConverter tool to include Metal 3.1 support and improved argument buffer settings (unrelated). - Force Github CI to use Python 3.11, to avoid crash in glslang::update_glslang_sources.py due to use of distutils, removed in Python 3.12 (unrelated). - Small unrelated non-functional edits. --- .github/workflows/CI.yml | 5 +++++ Docs/Whats_New.md | 3 +++ ExternalRevisions/SPIRV-Cross_repo_revision | 2 +- MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm | 2 ++ .../xcschemes/MoltenVKShaderConverter.xcscheme | 2 +- .../MoltenVKShaderConverterTool.cpp | 8 ++++++-- Scripts/runcts | 4 ++++ 7 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3ae3d1424..9ee53ee47 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -39,6 +39,11 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 + # Python 3.12 removed distutils, which is used by glslang::update_glslang_sources.py called from fetchDependencies + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Select Xcode version run: sudo xcode-select -switch "${XCODE_DEV_PATH}" diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index ff09d596c..f69d42033 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -19,6 +19,8 @@ MoltenVK 1.2.7 Released TBD - Reduce disk space consumed after running `fetchDependencies` script by removing intermediate file caches. +- Update to latest SPIRV-Cross: + - MSL: Fix regression error in argument buffer runtime arrays. @@ -61,6 +63,7 @@ MoltenVK 1.2.5 Released 2023/08/15 - Add support for extensions: + - `VK_KHR_deferred_host_operations` - `VK_KHR_incremental_present` - `VK_KHR_shader_non_semantic_info` - `VK_EXT_4444_formats` diff --git a/ExternalRevisions/SPIRV-Cross_repo_revision b/ExternalRevisions/SPIRV-Cross_repo_revision index fa4ca5201..9f5795606 100644 --- a/ExternalRevisions/SPIRV-Cross_repo_revision +++ b/ExternalRevisions/SPIRV-Cross_repo_revision @@ -1 +1 @@ -2de1265fca722929785d9acdec4ab728c47a0254 +4818f7e7ef7b7078a3a7a5a52c4a338e0dda22f4 diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 7d342f689..99ac0ef35 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -2208,6 +2208,8 @@ if ([_mtlDevice respondsToSelector: @selector(argumentBuffersSupport)]) { _metalFeatures.argumentBuffersTier = _mtlDevice.argumentBuffersSupport; + } else { + _metalFeatures.argumentBuffersTier = MTLArgumentBuffersTier1; } #define checkSupportsMTLCounterSamplingPoint(mtlSP, mvkSP) \ diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme index eeee1a626..9f64b980d 100644 --- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme +++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/xcshareddata/xcschemes/MoltenVKShaderConverter.xcscheme @@ -97,7 +97,7 @@ isEnabled = "NO"> & spv, mslContext.options.shouldFlipVertexY = _shouldFlipVertexY; mslContext.options.mslOptions.argument_buffers = _useMetalArgumentBuffers; mslContext.options.mslOptions.force_active_argument_buffer_resources = _useMetalArgumentBuffers; - mslContext.options.mslOptions.pad_argument_buffer_resources = _useMetalArgumentBuffers; + mslContext.options.mslOptions.pad_argument_buffer_resources = false; + mslContext.options.mslOptions.argument_buffers_tier = SPIRV_CROSS_NAMESPACE::CompilerMSL::Options::ArgumentBuffersTier::Tier2; mslContext.options.mslOptions.replace_recursive_inputs = mvkOSVersionIsAtLeast(14.0, 17.0, 1.0); SPIRVToMSLConverter spvConverter; @@ -425,7 +426,10 @@ MoltenVKShaderConverterTool::MoltenVKShaderConverterTool(int argc, const char* a _quietMode = false; _useMetalArgumentBuffers = false; - if (mvkOSVersionIsAtLeast(13.0)) { + if (mvkOSVersionIsAtLeast(14.0)) { + _mslVersionMajor = 3; + _mslVersionMinor = 1; + } else if (mvkOSVersionIsAtLeast(13.0)) { _mslVersionMajor = 3; _mslVersionMinor = 0; } else if (mvkOSVersionIsAtLeast(12.0)) { diff --git a/Scripts/runcts b/Scripts/runcts index 73aee7c6d..dfac7a135 100755 --- a/Scripts/runcts +++ b/Scripts/runcts @@ -122,8 +122,12 @@ start_time=${SECONDS} "${cts_vk_dir}/deqp-vk" \ --deqp-archive-dir="${cts_vk_dir}/.." \ +--deqp-log-filename="/dev/null" \ --deqp-log-images=disable \ --deqp-log-shader-sources=disable \ +--deqp-shadercache=disable \ +--deqp-log-decompiled-spirv=disable \ +--deqp-log-flush=disable \ --deqp-caselist-file="${caselist_file}" \ &> "${results_file}"