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

SPV-in workaround for row-major matrices #682

Merged
merged 2 commits into from
Apr 9, 2021
Merged

Conversation

kvark
Copy link
Member

@kvark kvark commented Apr 9, 2021

Fixes #675
I admit, this is a real PITA, and this code reflects it.

The workaround I wanted to implement was to issue an Load into the matrix if we see it being row-major, followed by Transpose, then pretending that it was column-major all this time.
The problem is that there are many ways to cross that "ima matrix" barrier:

  • OpAccessChain doesn't have intermediate IDs, so we can't do it iteratively
  • it may start high up and end on a matrix, or on an element of it
  • it turns out, an array of matrices, when being a struct field, can also have this row-major decoration

If anybody can have a better idea, I'd love to consider it!

@kvark kvark requested a review from Napokue April 9, 2021 03:25
Copy link
Collaborator

@Napokue Napokue left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! It is quite some complexity to "only' support basically a matrix agnostically. I have no idea how to improve upon this.

@kvark kvark merged commit 67e3e0a into gfx-rs:master Apr 9, 2021
@kvark kvark deleted the row-major branch April 9, 2021 15:22
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.

Parse SPIR-V row-major matrices
2 participants