Skip to content
Discussion options

You must be logged in to vote

Edit: My pattern now uses the following and works as it should:

bitfield FrameAddressData {
    bool    IsKeyframe: 1 [[no_unique_address]];
            FrameAddress: 32 [[transform("maskFirstBit")]];
};

fn maskFirstBit(u32 originalValue) {
    return (originalValue & 0xFFFFFFFE);
};

Original comment:
I changed my pattern to this now and it's seems to give me what I need:

bitfield FrameAddressData {
    bool    IsKeyframe: 1 [[no_unique_address]];
            RawData: 32 [[hidden]];
            
    u32 FrameAddress = RawData & 0xFFFFFFFE [[export]];
};

The only question I have now is whether it's possible to get rid of the local variable and have that bitwise AND applied directly to R…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@paxcut
Comment options

paxcut Dec 16, 2025
Collaborator

@XJDHDR
Comment options

@XJDHDR
Comment options

@paxcut
Comment options

paxcut Dec 16, 2025
Collaborator

@XJDHDR
Comment options

Comment options

You must be logged in to vote
2 replies
@paxcut
Comment options

paxcut Dec 16, 2025
Collaborator

@XJDHDR
Comment options

Answer selected by XJDHDR
Comment options

You must be logged in to vote
2 replies
@WerWolv
Comment options

@XJDHDR
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants