Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

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 Timo-DK April 9, 2021 03:25
Copy link
Collaborator

@Timo-DK Timo-DK 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse SPIR-V row-major matrices
2 participants