-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Validate vertex attribute format on insert #5259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to this discussion: #5257
Could you add a |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a wording suggestion, but this looks good to go!
); | ||
let values: VertexAttributeValues = values.into(); | ||
|
||
let values_format = VertexFormat::from(&values); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda weird that this is a From
impl instead of a .format()
getter, and funnily enough this is going to be the only place it is used.
Ignore this comment, that's for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, but why not add it to this PR? It would make that code clearer and it seems directly related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I just didn't want to push it onto you, could've worded that differently.
Feel free to :)
Co-authored-by: ira <JustTheCoolDude@gmail.com>
bors r+ |
# Objective - Validate the format of the values with the expected attribute format. - Currently, if you pass the wrong format, it will crash somewhere unrelated with a very cryptic error message, so it's really hard to debug for beginners. ## Solution - Compare the format and panic when unexpected format is passed ## Note - I used a separate `error!()` for a human friendly message because the panic message is very noisy and hard to parse for beginners. I don't mind changing this to only a panic if people prefer that. - This could potentially be something that runs only in debug mode, but I don't think inserting attributes is done often enough for this to be an issue. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Oops, I deleted the branch by mistake 😅 |
# Objective - Validate the format of the values with the expected attribute format. - Currently, if you pass the wrong format, it will crash somewhere unrelated with a very cryptic error message, so it's really hard to debug for beginners. ## Solution - Compare the format and panic when unexpected format is passed ## Note - I used a separate `error!()` for a human friendly message because the panic message is very noisy and hard to parse for beginners. I don't mind changing this to only a panic if people prefer that. - This could potentially be something that runs only in debug mode, but I don't think inserting attributes is done often enough for this to be an issue. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
# Objective - Validate the format of the values with the expected attribute format. - Currently, if you pass the wrong format, it will crash somewhere unrelated with a very cryptic error message, so it's really hard to debug for beginners. ## Solution - Compare the format and panic when unexpected format is passed ## Note - I used a separate `error!()` for a human friendly message because the panic message is very noisy and hard to parse for beginners. I don't mind changing this to only a panic if people prefer that. - This could potentially be something that runs only in debug mode, but I don't think inserting attributes is done often enough for this to be an issue. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
# Objective - Validate the format of the values with the expected attribute format. - Currently, if you pass the wrong format, it will crash somewhere unrelated with a very cryptic error message, so it's really hard to debug for beginners. ## Solution - Compare the format and panic when unexpected format is passed ## Note - I used a separate `error!()` for a human friendly message because the panic message is very noisy and hard to parse for beginners. I don't mind changing this to only a panic if people prefer that. - This could potentially be something that runs only in debug mode, but I don't think inserting attributes is done often enough for this to be an issue. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Objective
Solution
Note
error!()
for a human friendly message because the panic message is very noisy and hard to parse for beginners. I don't mind changing this to only a panic if people prefer that.