Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix struct variable size with out-of-order offsets #264

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

spencer-lunarg
Copy link
Contributor

This is follow-up for #263

I realize the struct size itself is still wrong

name     : ubo (UniformBufferObject)
    // size = 16, padded size = 16
    struct UniformBufferObject {
        float a; // abs offset = 0, rel offset = 0, size = 4, padded size =  4 UNUSED
        float b; // abs offset = 4, rel offset = 4, size = 4, padded size = 12 UNUSED
    } ubo;      

name     : ubo2 (UniformBufferObject2)
    // size = 4, padded size = 4
    struct UniformBufferObject2 {
        float b; // abs offset = 4, rel offset = 4, size = 4, padded size = 12 UNUSED
        float a; // abs offset = 0, rel offset = 0, size = 4, padded size =  4 UNUSED
    } ubo2;     

The size of ubo2 is not // size = 4, padded size = 4 and should be 16

@@ -2711,67 +2711,67 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p
}
}

if (p_var->member_count > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first commit is just removing this line, ParseDescriptorBlockVariableSizes starts with a check for this

@spencer-lunarg spencer-lunarg merged commit ee5b57f into KhronosGroup:main Apr 27, 2024
5 checks passed
@spencer-lunarg spencer-lunarg deleted the spencer-lunarg-so2 branch April 27, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants