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

linker: Recalculate interface variables #4784

Merged
merged 2 commits into from
May 3, 2022

Conversation

karolherbst
Copy link
Contributor

@karolherbst karolherbst commented Apr 14, 2022

By resolving extern symbols Entry Points might access variables they hadn't declared before.

Side note: we might want to rename RemoveUnusedInterfaceVariablesPass as it's not removing variables, but instead recomputing them.

By resolving extern symbols Entry Points might access variables they
hadn't declared before.
Copy link
Collaborator

@s-perron s-perron left a comment

Choose a reason for hiding this comment

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

Could you add a test for this? Otherwise this looks good.

@s-perron s-perron self-assigned this Apr 29, 2022
@karolherbst
Copy link
Contributor Author

Could you add a test for this? Otherwise this looks good.

done

@karolherbst
Copy link
Contributor Author

Mhh, it seems like that Linkage doesn't actually require the Kernel cap... but I guess this is more of a CL problem than GL/Vk?

…lidate

Without the fix Validate will complain about:

"ERROR: 9: Interface variable id <5> is used by entry point 'bar' id <1>, but is not listed as an interface\n  %5 = OpVariable %_ptr_Input_v3uint Input\n"
@karolherbst karolherbst force-pushed the fix_linking_interface branch from 64aab7a to 0b8c557 Compare May 2, 2022 17:41
@karolherbst
Copy link
Contributor Author

did something happened to CI?

@s-perron s-perron merged commit edaf510 into KhronosGroup:master May 3, 2022
@karolherbst karolherbst deleted the fix_linking_interface branch May 3, 2022 16:00
vettoreldaniele pushed a commit to vettoreldaniele/SPIRV-Tools that referenced this pull request May 9, 2022
* linker: Recalculate interface variables

By resolving extern symbols Entry Points might access variables they
hadn't declared before.

* test/linker: add test to verify linked spir-vs importing functions validate

Without the fix Validate will complain about:

"ERROR: 9: Interface variable id <5> is used by entry point 'bar' id <1>, but is not listed as an interface\n  %5 = OpVariable %_ptr_Input_v3uint Input\n"
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.

3 participants