From 7edcbfbdbc4c19beefbd55727a4a04f202847c9e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 7 Jan 2025 15:10:44 +0000 Subject: [PATCH] Fix bitfields not being resolved before structure uses --- qrenderdoc/Code/BufferFormatter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index d6c783b3df..7310989f3f 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -1446,10 +1446,17 @@ ParsedFormat BufferFormatter::ParseFormatString(const QString &formatString, uin break; } + if(bitfieldCurPos != ~0U) + cur->offset += (bitfieldCurPos + 7) / 8; + // all packing rules align structs in the same way as arrays. We already calculated this // when calculating the struct's alignment which will be padded to 16B for non-tight arrays cur->offset = AlignUp(cur->offset, structContext.alignment); + // reset any bitfield packing to start at 0 at the new location + if(bitfieldCurPos != ~0U) + bitfieldCurPos = 0; + if(specifiedOffset != ~0U) { if(specifiedOffset < cur->offset)