Skip to content

[SPIR-V] Fix counter in direct return stmt#8413

Merged
Keenuts merged 1 commit intomicrosoft:mainfrom
Keenuts:fix-8215
Apr 29, 2026
Merged

[SPIR-V] Fix counter in direct return stmt#8413
Keenuts merged 1 commit intomicrosoft:mainfrom
Keenuts:fix-8215

Conversation

@Keenuts
Copy link
Copy Markdown
Collaborator

@Keenuts Keenuts commented Apr 29, 2026

There is a logic to create counter variables, and find them from a source expression.
For return statements, we were first looking for the referenced counter before dealing with the RHS of the expression: the call. The fact that it worked so far was just luck:

  • if the function decl was handled/seen before the return statement, the counter variable association was handled. But in case of a direct return, this was not the case.

Fixes #8215

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

✅ With the latest revision this PR passed the C/C++ code formatter.

There is a logic to create counter variables, and find them
from a source expression.
For return statements, we were first looking for the referenced
counter before dealing with the RHS of the expression: the call.
The fact that it worked so far was just luck:
 - if the function decl was handled/seen before the return statement,
    the counter variable association was handled.
But in case of a direct return, this was not the case.

Fixes microsoft#8215
@Keenuts Keenuts enabled auto-merge (squash) April 29, 2026 16:52
@Keenuts
Copy link
Copy Markdown
Collaborator Author

Keenuts commented Apr 29, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Keenuts Keenuts merged commit 1f53295 into microsoft:main Apr 29, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Apr 29, 2026
@Keenuts Keenuts deleted the fix-8215 branch April 30, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Compilation fails with RWStructuredBuffer from ResourceDescriptorHeap not finding its associated counter variable

2 participants