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

Do not assert for certain custom CONFIG values. #5921

Closed
wants to merge 1 commit into from

Conversation

prideout
Copy link
Contributor

Developers who know their users have powerful devices can exceed
minspec constraints by adjust CONFIG_MAX_BONE_COUNT and/or
CONFIG_MAX_MORPH_TARGET_COUNT. If they do this, they should not
hit a static_asset.

Fixes #5785.

Developers who know their users have powerful devices can exceed
minspec constraints by adjust CONFIG_MAX_BONE_COUNT and/or
CONFIG_MAX_MORPH_TARGET_COUNT. If they do this, they should not
hit a `static_asset`.

Fixes #5785.
@prideout prideout requested a review from pixelflinger August 15, 2022 18:19
@github-actions
Copy link

Please add a release note line to RELEASE_NOTES.md. If this PR does not warrant a release note, add the 'internal' label to this PR.

@prideout prideout added the internal Issue/PR does not affect clients label Aug 15, 2022

// ES3.0 only guarantees a max UBO size of 16 KiB, but users may wish to exceed the minspec
// by adjusting CONFIG_MAX_BONE_COUNT.
static_assert(sizeof(PerRenderableBoneUib) == CONFIG_MAX_BONE_COUNT * 64,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe replace 64 with sizeof(BoneData)? That makes me question if we really need this assertion now

Similar suggestion for the morph targets.

Comment on lines +294 to +295
static_assert(sizeof(PerRenderableBoneUib) == CONFIG_MAX_BONE_COUNT * 64,
"PerRenderableUibBone has unexpected size");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This assert becomes a bit useless because the structure itself is an array of CONFIG_MAX_BONE_COUNT.

The point of this assert was to make sure to not set a CONFIG_MAX_BONE_COUNT that would exceed the minspec we support.

So I think the better/correct solution is to introduce a CONFIG_MINSPEC_UBO_SIZE constant the developers can adjust. Same for CONFIG_MAX_MORPH_TARGET_COUNT

@prideout prideout closed this Aug 16, 2022
@prideout prideout deleted the pr/config_bone_count branch August 16, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Part of mesh is only visible
3 participants