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

Extended enums break validation #2310

Open
aarongreig opened this issue Nov 11, 2024 · 0 comments
Open

Extended enums break validation #2310

aarongreig opened this issue Nov 11, 2024 · 0 comments
Milestone

Comments

@aarongreig
Copy link
Contributor

We've established a convention of defining values for extended enums in a non-continuous fashion. For example we've got UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000 here and UR_DEVICE_INFO_BINDLESS_IMAGE_SUPPORT_EXP=0x2000 here. This does make sense as long as we need to manually designate these as it more or less eliminates the possibility of collisions, but this system has introduced an issue with how we validate enums. Currently the validation is set up to assume any value <= the last enumerator is valid, which works as long as the enumerators are continuous, but at the time of writing the last device info enum is 0x2020 - and the majority of values between 0x0 and 0x2020 are not valid device info enums. A mask doesn't work for this as not all of our enums are bitfields, we might need to look into generating some kind of validation helper function for each non-bitfield enum.

@aarongreig aarongreig added this to the Backlog milestone Nov 11, 2024
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

No branches or pull requests

1 participant