diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index d6c783b3d..7310989f3 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)