Skip to content

[SPIRV] Allow globallycoherent on DescriptorHeap accesses (#7740)#8513

Open
SteveUrquhart wants to merge 1 commit into
microsoft:mainfrom
SteveUrquhart:allow-globallycoherent-spirv
Open

[SPIRV] Allow globallycoherent on DescriptorHeap accesses (#7740)#8513
SteveUrquhart wants to merge 1 commit into
microsoft:mainfrom
SteveUrquhart:allow-globallycoherent-spirv

Conversation

@SteveUrquhart

Copy link
Copy Markdown
Contributor

This PR allows the SpirvEmitter to emit globallycoherent in combination with ResourceDescriptorHeap.

@SteveUrquhart

Copy link
Copy Markdown
Contributor Author

This addresses #7740

@llvm-beanz

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

// (a) An enclosing DeclStmt VarDecl initializer
// (b) A file-scope VarDecl initializer
// (c) A ReturnStmt inside a globallycoherent returning helper
auto isCoherentDest = [](const VarDecl *vd) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everywhere you use this vd is guaranteed to not be null, so this is just a lambda wrapping return true && fn(...).

We shouldn't use a lambda for this.

// (a) and (c): walk Stmt parents through transparent wrappers.
{
const Stmt *cur = parentExpr;
while (cur) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This approach is raising big red flags to me. This shouldn't be necessary. I think you're doing this to work around the AST not properly preserving the globally coherent attribute through implicit casts (which is a bug). I suspect this code gets a lot simpler and less buggy if we fix the issue in the AST rather than working around it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I posted #8583, which should fix the AST representation here so that the cast doesn't drop the attribute. This should make it so that the walking you're doing here is unnecessary.

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants