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

spirv-opt: Fix OpCompositeInsert with Null Constant #5008

Merged
merged 3 commits into from
Dec 6, 2022

Conversation

spencer-lunarg
Copy link
Contributor

closes #5005

Now when folding OpCompositeInsert with a null composite it correctly handles it.

The main issue is class NullConstant : public Constant {} is not a CompositeConstant because sometimes OpConstantNull can be either. For cases where there is a OpConstantNull %v3float it will turn it into a OpConstantComposite %v3float %null %null %null before continuing with the logic as normal

cc @sugoi1 I hope this fixes everything now

@sugoi1
Copy link

sugoi1 commented Dec 5, 2022

Thanks @spencer-lunarg. I'll try SPIRV-Tools' new version as soon as this lands.

@sugoi1
Copy link

sugoi1 commented Dec 5, 2022

Note: @spencer-lunarg, you could also ask alan-baker or dneto0 to review, in case one of them is available earlier than dnovillo.

dnovillo
dnovillo previously approved these changes Dec 5, 2022
Copy link
Contributor

@dnovillo dnovillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a documentation nit. Thanks for the fix.

source/opt/constants.h Outdated Show resolved Hide resolved
@dnovillo dnovillo merged commit 7b8f00f into KhronosGroup:master Dec 6, 2022
@spencer-lunarg spencer-lunarg deleted the spencer-lunarg-insert branch May 1, 2023 08:55
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

Successfully merging this pull request may close these issues.

Optimization pass doesn't seem to handle all conditions properly
4 participants