From a045cac281b378e4b77e1eb66de914e6816cf401 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 8 Feb 2021 14:26:59 +0100 Subject: [PATCH] [d3d11] Fix vertex input alignment for small formats Fixes #1922. --- src/d3d11/d3d11_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index fa0006bc..5b3e4175 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -619,7 +619,8 @@ namespace dxvk { if (prev.binding == attrib.binding) { const DxvkFormatInfo* formatInfo = imageFormatInfo(prev.format); - attrib.offset = align(prev.offset + formatInfo->elementSize, 4); + VkDeviceSize alignment = std::min(formatInfo->elementSize, 4); + attrib.offset = align(prev.offset + formatInfo->elementSize, alignment); break; } }