Skip to content

Conversation

@farzonl
Copy link
Collaborator

@farzonl farzonl commented Oct 13, 2025

fixes #677

Moved the Vector Swizzle stuff that repeats with Matrix and moved it to a generic swizzle section.
image

The new Matrix Swizzle looks like this:
image

image

@github-actions github-actions bot added the language-spec Issue with completed spec label Oct 13, 2025
Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

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

A few suggestions, but otherwise LGTM.

Copy link
Collaborator

@V-FEXrt V-FEXrt left a comment

Choose a reason for hiding this comment

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

Approving because I'll be out next week. I'm happy with the change as long as the _m1_m2 issue is resolved


\define{matrix-one-indexed-swizzle-sequence}\br
matrix-one-indexed-swizzle\br
matrix-one-indexed-swizzle-sequence matrix-one-indexed-swizzle\br
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not exactly sure the best way to rewrite this, but as written this would require _m1_m2 instead of _m12 right?

matrix-one-indexed-swizzle-sequence matrix-one-indexed-swizzle\br

\define{matrix-one-indexed-swizzle}\br
\terminal{\_m} one-index-value\br
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
\terminal{\_m} one-index-value\br
\terminal{\_} one-index-value\br

Should be just _ not _m for 1-indexing right?


\define{matrix-zero-indexed-swizzle-sequence}\br
matrix-zero-indexed-swizzle\br
matrix-zero-indexed-swizzle-sequence matrix-zero-indexed-swizzle\br
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not exactly sure the best way to rewrite this, but as written this would require _m1_m2 instead of _m12 right?

\end{itemize}

\p A \textit{matrix-swizzle-component-sequence} is a sequence of one but less
than or equal to four swizzle components of either the
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo it would be better to encode this into the grammar

its not too crazy to write

matrix-one-indexed-swizzle-sequence:
  "_m", zero-index-value
  | "_m", zero-index-value,  zero-index-value
  | "_m", zero-index-value,  zero-index-value,  zero-index-value
  | "_m", zero-index-value,  zero-index-value,  zero-index-value,  zero-index-value

which also solves the _m1_m2 issue mentioned above

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

Labels

language-spec Issue with completed spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HLSL][Matrix] Document the ._<numeric><numeric> and ._m<numeric><numeric> accessors

3 participants