From 8965c87e143b709b1cb8bcc4f3c379c0b2d4b0de Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Thu, 8 Dec 2022 18:38:49 -0500 Subject: [PATCH] Fix crash when buffer binding updates only offset while it is overridden. MVKMTLBufferBinding don't allow justOffset if binding was overridden. --- Docs/Whats_New.md | 1 + MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index 985dba7d6..9968bd4ec 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -22,6 +22,7 @@ Released 2022/12/08 - `VK_KHR_copy_commands2` - Fix crash on descriptor update with out-of-bounds descriptor count data. - Fix Metal buffer index binding overrides for push constants and attachment clearing. +- Fix crash when buffer binding updates only offset while it is overridden. - Fix app performance regression triggered by the previous introduction of `VK_KHR_shader_float_controls`. - Work around `MTLCounterSet` crash on additional Intel Iris Plus Graphics devices. - Fix mistaken YCBCR format support indication. diff --git a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h index 1af1b184e..443786735 100644 --- a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h +++ b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h @@ -86,7 +86,7 @@ typedef struct MVKMTLBufferBinding { isDirty = true; } else if (offset != other.offset) { offset = other.offset; - justOffset = !isDirty || justOffset; + justOffset = !isOverridden && (!isDirty || justOffset); isOverridden = false; isDirty = true; }