-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 RDPipelineColorBlendState.attachments
setter
#81333
Fix RDPipelineColorBlendState.attachments
setter
#81333
Conversation
attachments.clear(); | ||
attachments.append_array(p_attachments); |
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.
attachments.clear(); | |
attachments.append_array(p_attachments); | |
attachments = p_attachments; |
is_same(attachments, p_attachments)
can be true
, the code will not work in this case.
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.
Wonder why the original code was this way, thanks for fixing, looks great!
I marked this as a draft because I don't think the current solution is fully correct. Must be one of the following: Option 1 void set_attachments(const TypedArray<RDPipelineColorBlendStateAttachment> &p_attachments) {
attachments.clear();
attachments.append_array(p_attachments);
}
TypedArray<RDPipelineColorBlendStateAttachment> get_attachments() const {
return attachments.duplicate();
} Option 2 void set_attachments(const TypedArray<RDPipelineColorBlendStateAttachment> &p_attachments) {
attachments = p_attachments;
}
TypedArray<RDPipelineColorBlendStateAttachment> get_attachments() const {
return attachments;
} I checked the setters and getters of other non- |
5b0b046
to
f2f0375
Compare
@BastiaanOlij Option 2 is the current option? Your comment confused me, sorry. |
@dalexeev I mean in relation to this:
We're not storing a reference, we're only passing by reference to prevent an extra copy overhead.
There is no expectation that that So:
Does exactly what we want and keeps the code concise. |
So TL;DR, Bastiaan approved without hitting the "Approve" button ;) |
Thanks! |
Fixes the error
CC @BastiaanOlij