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

Remove the 16-field limitation on the systemparam derive #5965

Closed
wants to merge 2 commits into from

Conversation

TheRawMeatball
Copy link
Member

Objective

Since this derive macro can create arbitrary code, it shouldn't be limited by the built-in limit to 16 system-parameters a tuple can have.

Solution

  • Adjust the derive macro to use a separate type, and expose the system param tuple macro so the derive macro can call it as needed.

Changelog

The SystemParam derive now supports structs with over 16 fields.

@bjorn3
Copy link
Contributor

bjorn3 commented Sep 12, 2022

Have you checked the compile time perf effects? This generates more code and as such will likely compile slower. If this is indeed the case, maybe only use the new code for >16 fields and use the old tuple code for <=16 fields?

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Sep 12, 2022
@TheRawMeatball
Copy link
Member Author

Closing in favor of #6867

bors bot pushed a commit that referenced this pull request Dec 21, 2022
# Objective

* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
    * The error message if you exceed this limit is abysmal.
* Supercedes #5965 -- this does the same thing, but is simpler.

## Solution

If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
JoJoJet added a commit to JoJoJet/bevy that referenced this pull request Dec 21, 2022
* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
    * The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.

If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective

* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
    * The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.

## Solution

If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
    * The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.

## Solution

If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants