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

Fix printing of 'unknown stage' during crossStageCheck #3764

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

rj123-nv
Copy link
Contributor

Adds a 'stage' field to symbol nodes to remember what stage a symbol was
defined in.
Previously, 'unknown' stage was printed because linker object symbols are
merged into a TIntermediate with language=EShLangCount while cross stage
rules are checked. Storing the stage in the symbol fixes this problem.

Fixes errors such as

WARNING: Linking unknown stage and fragment stages: Matched shader interfaces are using different instance names.
unknown stage stage: Block: crossStageBlock2 Instance: blockName1: ""
fragment stage: Block: crossStageBlock2 Instance: blockName2: ""

Adds a 'stage' field to symbol nodes to remember what stage a symbol was
defined in.
Previously, 'unknown' stage was printed because linker object symbols are
merged into a TIntermediate with language=EShLangCount while cross stage
rules are checked. Storing the stage in the symbol fixes this problem.
@@ -59,10 +60,12 @@ namespace glslang {
void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be changed to accept another "stage" argument, but that would require changing a bunch of callers which I opted not to do.
If getStage() is EShLangCount, as in the case of the intermediate created for merging linker objects, just opt to only print "unitStage"

@rj123-nv rj123-nv marked this pull request as draft October 16, 2024 01:15
@rj123-nv rj123-nv marked this pull request as ready for review October 17, 2024 02:34
@jeffbolznv
Copy link
Contributor

@arcady-lunarg can you please help review?

Copy link
Contributor

@arcady-lunarg arcady-lunarg left a comment

Choose a reason for hiding this comment

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

Looks reasonable, and the messages are an improvement. I think you'll need to rebase this before it can be merged.

@rj123-nv
Copy link
Contributor Author

Thanks for reviewing. I rebased the changes

@arcady-lunarg arcady-lunarg added the kokoro:run Trigger Google bot runs label Nov 14, 2024
@kokoro-team kokoro-team removed the kokoro:run Trigger Google bot runs label Nov 14, 2024
@arcady-lunarg arcady-lunarg merged commit 4f8fa5f into KhronosGroup:main Nov 14, 2024
34 checks passed
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.

4 participants