-
Notifications
You must be signed in to change notification settings - Fork 187
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
Transfer offset decorations when legalizing laid-out structs #5525
base: master
Are you sure you want to change the base?
Conversation
Struct legalization removing fields not representable in memory should transfer offset decorations in case the struct has already had offsets calculated. Closes shader-slang#5264.
/format |
🌈 Formatted, please merge the changes from this PR |
Format code for PR shader-slang#5525
// In case the original struct had offsets calculated, transfer those as well. | ||
// The original offsets should still be valid, since we only skip fields of types | ||
// that aren't representable in memory. | ||
originalField->transferChildrenOfTypeTo<IROffsetDecoration>(newField); |
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.
Just transfer all decorations over.
@@ -780,8 +793,20 @@ struct IRInst | |||
void removeOperand(Index index); | |||
|
|||
/// Transfer any decorations of this instruction to the `target` instruction. | |||
// TODO: rewrite as transferDecorationsTo(target) -> |
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.
Superfluous comment.
@@ -593,6 +593,19 @@ struct IRInst | |||
IRDecoration* getLastDecoration(); | |||
IRInstList<IRDecoration> getDecorations(); | |||
|
|||
// Step to the next child of a certain type, T |
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.
Don’t need this, just copy all decorations.
Struct legalization removing fields not representable in memory should transfer offset decorations in case the struct has already had offsets calculated.
Closes #5264.