Skip to content

[SPIRV] Handle associated counters for RWStructuredBuffer in base classes#7880

Merged
s-perron merged 3 commits into
microsoft:mainfrom
s-perron:i7787_counter_var
Nov 14, 2025
Merged

[SPIRV] Handle associated counters for RWStructuredBuffer in base classes#7880
s-perron merged 3 commits into
microsoft:mainfrom
s-perron:i7787_counter_var

Conversation

@s-perron
Copy link
Copy Markdown
Collaborator

@s-perron s-perron commented Nov 6, 2025

This commit fixes an issue where the associated counters for RWStructuredBuffer were not correctly handled when the buffer was a member of a base class.

The changes include:

  • Updating to recursively traverse base classes and nested structs to find associated counter variables.
  • Modifying to correctly generate instructions for accessing members of base classes.
  • Adding a new test case to verify the correct handling of counter variables in base classes.
  • Updating existing tests to reflect the changes in generation.

Fixes #7787

…sses

This commit fixes an issue where the associated counters for RWStructuredBuffer were not correctly handled when the buffer was a member of a base class.

The changes include:
- Updating  to recursively traverse base classes and nested structs to find associated counter variables.
- Modifying  to correctly generate  instructions for accessing members of base classes.
- Adding a new test case to verify the correct handling of counter variables in base classes.
- Updating existing tests to reflect the changes in  generation.

Fixes microsoft#7787
@s-perron s-perron merged commit 025ca7b into microsoft:main Nov 14, 2025
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Nov 14, 2025
@bogner
Copy link
Copy Markdown
Collaborator

bogner commented Dec 3, 2025

I think this change may have caused some issues with base classes in cbuffers - I've filed #7968 about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Assigning UAV variable to struct base class fails with "cannot handle associated counter variable assignment"

4 participants