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

Emit errors when seeing a matrix with row/col count of 1 #6044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aleino-nv
Copy link
Collaborator

Such matrices aren't well supported by our targets, and we currently don't transform such types to supported ones.
Therefore, generate an error rather than outputting invalid target code.

This closes #5987.

Such matrices aren't well supported by our targets, and we currently don't transform such
types to supported ones.
Therefore, generate an error rather than outputting invalid target code.

This closes shader-slang#5987.
@aleino-nv aleino-nv requested a review from a team as a code owner January 9, 2025 10:38
@aleino-nv aleino-nv added the pr: non-breaking PRs without breaking changes label Jan 9, 2025
@@ -11876,6 +11876,20 @@ void SemanticsDeclAttributesVisitor::checkVarDeclCommon(VarDeclBase* varDecl)
getSink()->diagnose(varDecl, Diagnostics::pushOrSpecializationConstantCannotBeStatic);
}
}

if (auto matrixType = as<MatrixExpressionType>(varDecl->getType()))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found out that this is not quite the right place for this check.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that we eventually still plan to implement the support, I am fine with just add a last minute error reporting from the backend before emitting target code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid SPIR-V generation for outer product mul
2 participants