Skip to content

Commit

Permalink
Fix bitfields not being resolved before structure uses
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jan 7, 2025
1 parent 79be74a commit 7edcbfb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qrenderdoc/Code/BufferFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7edcbfb

Please sign in to comment.